Web-side controls, page-pass values

Source: Internet
Author: User

I. Memory Web-side controls need to mate with form elements in HTML

Label-compiled into <span> in HTML

Literal-compiled into null in HTML

Text class

    • text box <input type= "text" > TextBox
    • Password box <input type= "Password" > TextBox properties textmode= "Password"
    • Text fields <textarea> TextBox properties Textmode= "Mutilline"
    • Hide Text field <input type= "Hidden> hiddenfiled

Button class

    • Normal Pushbutton button No
    • Submit button (default commit)
    • Reset button Reset None
    • Image Button Image ImageButton

Select Class

    • Radio RadioButtonList (This is not a panel, each default is a set, there are many items) property ListItem Enable selected Text Value
    • CheckBox CheckBoxList (This also does not use a panel, each default is a set, there are many items) property ListItem Enable selected Text Value
    • Select option DropDownList
    • File (not learned)

Two. Data binding

1.Foreach Traversal (recommended)

 //Binding National InformationList<nation> Li =NewNationdata ().            Selectnation (); foreach(Nation Iinchli) {ListItem Li=NewListItem (); LI. Text=I.nationname; LI. Value=I.nationcode; if(LI. Value = ="N001") {LI. Selected=true; }            DLNATION.ITEMS.ADD (LI); }

2.

Three. Questions about binding Data refresh

Data option cannot be changed when binding data is present
Page_Load event will be executed every time the page refreshes
It will rebind the data once and then execute the button event.
Determine whether a page is first loaded or responds to a postback

if (!ispostback)
{
Only the code that executes when the page is loaded the first time is written in this area.
Note that 95% of the code is written in this area.
! Event delegate cannot be written to this side
}

Four. Page Pass value

Value of Value-Cross page pass value
Querystring-url pass value, address value
Pass value: [Address? Key=value&key=value]

Take out the value passed by the URL.
Value: String value = request["Key"];

Five. C # service-side jump page
Response.Redirect ("url");

Web-side controls, page-pass values

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: info-contact@alibabacloud.com 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.