The first day of learning purposes:
Master the most basic Label, TextBox, button control usage
Master the StringBuider class connection string
Understanding the server's environment variable StringBuilder class: Namespace is: System.Text. The StringBuilder class is an efficient class, and the StringBuilder.Append connection string is very fast. Used to connect a large number of strings, the superiority of its speed will be embodied. First mention a few examples first:
In the head of the CS or VB file, add [C #] useing system.text; [vb] imports system.text [c #] stringbuilder sbfirst = new stringbuilder ();
SBFirst.Append ("This is the first example of the example of ASPNET ");
SBFirst.Append ("This example is too simple ");
SBFirst.Append ("I will do it in three years old, I know, hehe.");
Response.write (sbfirst.tostring ()); [VB] DIM SBFIRS STRINGBUILDER = New StringBuilder ()
Sbfirst.Append ("This is the first example of the example of ASPNET ")
SBFirst.Append ("This example is too simple ")
SBFirst.Append ("I have done it in three years old, I know, hehe.")
RESPONSE.WRITE (SBFirst.TOString) can do the topic: first establish a C # web application project, I will say less. Put a Button Control: ID Put a Label Control for btnshowvariable: ID Add button to LabSerVariable, the following code
Private void btnshowvariable_click (Object Sender, System.Eventargs E)
{
LabserVariables.text = "";
StringBuilder Info = New StringBuilder ();
Foreach (Object Objvar in Request.ServerVariables)
{
Info.append ("");
Info.append (objvar.tostring ());
Info.append ("= );
Info.Append (Request.ServerVariables [objvar.tostring ()]);
Info.append (" font> span>
);
}
LabserVariables.text = info.toString ();
} The result shows: The picture is as follows: This allows us to use Response.write (Request.ServerVariables ["remote_addr"]);
// IP address response.write ("
"); response.write (Request.ServerVariables ["URL"]);
// URL of the web page The second day of learning purposes:
Master the usage of text boxes
First contact TRY ... CAT ... grammatical today is easy, use an example, enter the year and month, judge whether the input is correct, using a text box, ID is txtyear, txtmonth, txtdate; check button: Private Void Btncheck_Click (Object Sender, System.EventArgs E)
{
Int year, month, date;
// Turn the input characters to an int type, if not digital,
// Trigger an error
Try
{
Year = Convert.Toint32 (txtYear.text);
Month = convert.toint32 (txtmonth.text);
Date = Convert.Toint32 (TXTDATE.TEXT);
}
Catch
{
LabCheckInfo.text = "Enter non-numeric characters."
Return;
}
// If the first step is passed, the input number is converted into a date format.
// If you don't meet the date format, an error is caused.
Try
{
DateTime DT = New DateTime (Year, Month, Date);
}
Catch
{
LabCheckInfo.text = "The number of inputs does not meet the date format";
Return;
}
LabCheckInfo.text = "Enter the correct";
} Well, add it, many people like =, for StringBuider, in fact, for String, once defined, the so-called just new String variables are defined and assigned to use it as much as possible StringBuider's Append method, this will learn a lot of resources on the third day of the third day of the resource of the server:
Master the usage of the drop-down list, understand the AutoPostBack property; understand the ISPOSKBACK and usage; the method of initiating DataTable, line, line, and the drop-down list box binding. Today's content is slightly more, and there are some basic uses, such as IsPostback and DataTable. Knowledge point: ispostback: The value is false between the page OnLoad, and when the server is passed back, the value becomes true. When the Button or ImageButton and other in the page are triggered, it will return the form to the server, and the ONLOAD event will be caused when it returns. In order to save server resources, some load is required once, without having to happen multiple times after passing, you can use! Isposkback as a condition, then the page will not happen after the page is loaded. This attribute can help you improve the performance of the program. Dataable: That is, the most common class in the .NET program, especially database development, programs without such classes are unimaginable. First make a small program to practice hands, very simple, just a drop menu, name DLstWeb. Open the following dialog in the ITMES option of the attribute, add each: The image is as follows: The code in the ASPX is: Width = "88px" autopostback = "true"> Private void dlstweb_selectedIndexchanged (Object Sender, System.EventArgs E) {