Character Stitching
<%# "abc" + EVAL ("column name"). ToString ()%>
<%# Eval ("column name", "abc{0}")%>
Formatting
<%# Eval ("column name" {0:YYY-MM-DD} ")%>//date formatting
<%# Eval ("Price" {0:000.0#} ")%>//if not three bits on 0, such as 001, force after a decimal place 001.0
Calling functions
<%# function (Eval ("column name"))%>
Use <%=username%> when outputting the value of an expression at the current position;
Equivalent to the current location call Response.Write (UserName)
The function used, the code is equivalent to calling the function at this location, executing the code
Note the member level of the call CS in ASPX must be protected or public, not private
The relationship between Aspx,cs,dll
Execute the following code in the WebForm (CS file)
Response.Write (this. GetType () + "<br/>"); The type name of the current execution class
Response.Write (this. GetType (). Assembly.location + "<br/>"); The location of the assembly (DLL file) where the current class resides
Response.Write (this. GetType (). BaseType + "<br/>"); The type name of the parent class of the current object
Response.Write (this. GetType (). BaseType.Assembly.Location + "<br/>"); The Assembly location of the parent class
Use reflector to open this temporary DLL, decompile these two classes, and discover that WebForm1 is the Aspx.cs class written in VS
While Asp.webform1_aspx is a subclass of inherited WebForm1, Asp.webform1_aspx is dynamically based on the ASPX content
The class that generated the build content.
The current class is WebForm1, and after execution it is found that the class name of the current execution page is asp.webform1_aspx class name, the parent class is WebForm1
Description Asp.webform1_aspx inherits the WebForm1, so setting the member level to private in CS is not allowed in subclasses
Asp. NET front-end syntax application