Asp. NET front-end syntax application

Source: Internet
Author: User

Character Stitching
<%# "abc" + EVAL ("column name"). ToString ()%>
<%# Eval ("column name", "abc{0}")%>
<%# 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.