Display Summary information in the GridView’s Footer in ASP.NET
SomeTime we need to sum up the data and display it in the Gridview. Since Gridview does not provide any method to implement it, so We would implement it by myself. The RowDataBound event is raised when...
View ArticleUse Linq to enquire selected value in CheckBoxList in ASP.NET
Linq to object can help us to simplify the coding of retrieving the selected value from a checkboxList. It can provide a better performance than running a for loop, and make the code more clear. For...
View ArticleGenerate a real “random” random number in ASP.NET
Sometime we need to generate a set of random number. The most effect way is generate the number in a loop. for (int i = 0; i < 100; i++) { Random r = new Random(); txtRandom.Text += r.Next(100) + "...
View ArticleDisplay and filter directory files in GridView with LINQ in ASP.NET
Last time we have introduced how to enquire selected value in CheckBoxList with Linq. We would keep on to introduce how LINQ can make the coding more easy. This time we would use LINQ to display and...
View ArticleException handling redirect on Error in ASP.NET
Do you see below error before? It is a 404 error page. In ASP.net, we can capture the HTTP status and redirect to specify page in web.config. For an example, it will redirect to 404.aspx when the web...
View ArticleCase insensitive compare on string in ASP.NET
String.Compare has a optional parameters to ignoring or honoring their case. string.Compare("xxx", "XXX", False); Below is the sample. Compare.aspx using System; using System.Collections.Generic; using...
View ArticleDefault IE version “X-UA-Compatible” in ASP.NET
I believe most of the ASP.NET developers know that IE version would affect your screen layout. When a new IE version was released, you have to check the web site still look well. If you have IT...
View ArticleRetrieve random row in Linq in ASP.NET
In MSSQL, we can use NewID function to retrieve a random row. select top 1 * from table order by NewID() How can we implement it with LINQ? There is a Skip function can do the same thing....
View ArticleValidation Controls in ASP.NET
There are several kinds of validation controls provide form input validation. CompareValidator Control Details the ASP.NET syntax for the CompareValidator control. You can use this control to compare a...
View ArticleHangFire, ASP.net Request Processing Pipeline Monitor
A reliable way to kick off long-running processes from the ASP.NET request processing pipeline, backed by Redis, SQL Server, SQL Azure or MSMQ. HangFire let you incredible easy to handle the running...
View Article