How to validate that a string is a valid date?
VB.NET Dim blnValid As Boolean = False Try DateTime.Parse(MyString) blnValid = True Catch blnValid = False End Try C# bool blnValid=false; try { DateTime.Parse(MyString); blnValid=true; } catch { blnValid=false; }
How to check if the ArrayList is empty
VB.NET if arrList= 0 then .. else .. end if C# if (arrList ==0) { … } else { … }
How to hide and show a Column based on the authenticated user
In the DataGrid_ItemDataBound Event write the following code VB.NET If Not User.Identity.IsAuthenticated Then e.Item.Cells(1).Visible = False End If C# if ( ! User.Identity.IsAuthenticated ) { e.Item.Cells[1].Visible =false; }
How to determine if the Browser supports javascript?
VB.NET if Page.Request.Browser.JavaScript then … else … end if C# if (Page.Request.Browser.JavaScript ) { … } else { … }
How to Configure the ASP.NET Version to use for Each Application(developed using 1.0 or 1.1)?
To configure WebApp1 to use ASP.NET 1.0, follow these steps: Click Start, and then click Run. In the Open text box, type cmd, and then click OK. At the command prompt, locate the following directory: WindowsDirectory\Microsoft.NET\Framework\v1.0.3705\ At the command prompt, type one of the following commands: To Install ASP.NET 1.0 recursively aspnet_regiis -s W3SVC/1/ROOT/WebApp1 To Install ASP.NET 1.0 non-recursively aspnet_regiis -sn W3SVC/1/ROOT/WebApp1 To configure WebApp2 to use ASP.NET 1.1, follow these steps: Click Start, and then click Run. In the Open text box, type cmd, and then click OK. At the command prompt, locate the following directory: WindowsDirectory\Microsoft.NET\Framework\v1.1.4322\ At the command prompt, type one of the following commands: To Install ASP.NET 1.1 recursively aspnet_regiis -s W3SVC/1/ROOT/WebApp2 To Install ASP.NET 1.1 non-recursively aspnet_regiis -sn W3SVC/1/ROOT/WebApp2