ASP.NET C#: using System

At the top of the .cs file (code behind) you will see a list of using statements, which act almost like includes, and provide functions from the specified file being used. For example, the oft used ArrayList collection object is part of the System.Collections namespace. Without the directive used here below, you won’t be able [...]

ASP.NET C#: Using DataTable

To auto-close a datatable after it is done being used (as well as creating a DataTable), a using statement is most helpful. using (DataTable dt = new DataTable()){ //your datatable specific code here }

ASP.NET C#: DropDownList SelectedIndex

A dropdown’s SelectedIndex property is the number (int) of the line item selected, 0 for the first, 1 for the second, regardless of data. Example: if(ddlCustomer.SelectedIndex == 0){ Response.Write("Hello World."); }

ASP.NET C#: Output to Screen

Response.Write("this is the message");

ASP.NET C#: Redirect

Response.Redirect("http://www.google.com");