Page command description: <% @ Page Language = " C # " Autoeventwireup = " True " Codefile = " Default. aspx. CS " Inherits = " _ Default "
Enableviewstate = " False " %>
The page command defines the programming languages to be used,
Autoeventwrieup: Specifies the event handling mechanism for the response.ProgramThe automatic token is attached to a specific method name.
Codefile: What is the background file based on inherits?
Inherits: indicates that the class automatically generated in the aspx file is derived from the base class default_aspx. This class is a post-file with fixed codefile adequacy (in this example, default. aspx. CS.
Previouspagetype command description: <%@ Previouspagetype virtualpath="~ /Default. aspx" %>
@ Previouspagetype: provides a method to obtain the strong type of the previous page. You can access the previous page through the previouspage attribute.
Format: <% @ previouspagetype adequacy = "value" [adequacy = "value"...] %>
Adequacy:
Typename: indicates the last vertex to be finalized.
Virtualpath: Specifies the path of a production-dependent case.
"~ /": Indicates the same region.
Previouspage. findcontrol ("txtfirstname "):
Previouspage: gets the page for transferring controls to the current page.
Source statement: Using System;
Using System. Data;
Using System. configuration;
Using System. Web;
Using System. Web. Security;
Using System. Web. UI;
Using System. Web. UI. webcontrols;
Using System. Web. UI. webcontrols. webparts;
Using System. Web. UI. htmlcontrols;
//_ Default corresponds to the value of inherits in the page command "_ default"
Public Partial Class_ Default: system. Web. UI. Page
{
Protected VoidPage_load (ObjectSender, eventargs E)
{
}
}
Runat description: < ASP: Label ID = " Labelresult " Runat = " Server " Text = " Label " > </ ASP: Label >
Runat: if this value is runat = "server", this attribute specifiesCodeRun on the server rather than the client. This attribute is required for server-side code blocks.
Ctrip: < Script runat = " Server " Language = " Codelanguage " SRC = " Pathname " >
Code goes here...
</ Script >
Language: Specifies the language in which the block is declared by code. This value can represent any language compatible with the. NET Framework, such as Visual Basic (VB), C #, or JScript. net. If no language is specified, this value defaults to the language specified in the @ page or @ control command. If no language is specified in the command, the default value is VB unless the default value has been changed in the web. config file of the application.
Runat: If the value is runat = "server", this attribute specifies that the Code contained in the script block runs on the server rather than on the client. This attribute is required for server-side code blocks.
SRC: Specifies the path and file name of the external script file to be loaded. When this attribute is used, any other code in the declared block is ignored.
Using description: UsingSystem. Web. UI. htmlcontrols;
UsingSystem. Web. UI. webcontrols;
Htmlcontrols: HTML Server Control. The methods and features provided by the HTML server control are similar to those provided by the HTML control. They can access the HTML interface of the customer through JavaScript.
Webcontrols: Web Server Control. Web server controls provide methods and features similar to Windows controls.
Component Description:
Destinationpageurl: gets or sets the URL of the page displayed to the user when the logon attempt is successful.
Postbackurl: gets or sets the URL of the webpage sent from the current page when the button control is clicked. The postbackurl attribute allows you to use the button control to send cross pages. Set the postbackurl attribute to the URL of the webpage to be sent when you click the button control. For example, if page2.aspx is specified, the page containing the button control is sent to page2.aspx. If the value of the postbackurl attribute is not specified, the page is sent back to itself.
Retrieve the content in APP. config:
Content in APP. config: < Appsettings >
< Add key = " Connectionstring " Value = " Data Source = cm; persist Security info = true; user id = webuser; Password = cmgwebapplication; Unicode = true " />
</ Appsettings >
Retrieve app. config Private Static StringConnstring=System. configuration. configurationsettings. deleettings ["Connectionstring"]. Tostring ();
Obtain the path of the Asp.net program in the service.
String Text1 = Path. Combine (server. mappath ( " . " ), " Uploadfile " );
result : D:" Projects "cmeip" 05_develop "cmeip" fileshare "uploadfile
solution :< br> httpserverutility. mappath
method : Returns and Web the physical file path corresponding to the specified virtual path on the server.
path. combine method : merge two path strings.