C#web programming

Source: Internet
Author: User

1. Web server controls can contain event handlers that are called on the server. Events are triggered on the server only when they are returned to the server. Set AutoPostBack to True and the event will be passed to the server immediately. This causes the client to invoke JavaScript to pass the form data to the server immediately. After the page is returned to the server, the value of the control is changed by hiding the field viewstate.

2. PreviousPage: Gets the page that transmits the control to the current page.

FindControl (): Searches the page naming container for a server control with the specified identifier.

3, <%@ PreviousPageType virtualpath = "~/registration.aspx"%>

<%@ previouspagetype attribute= "value" [attribute= "value" ...]%>

PreviousPageType creates a PreviousPage property that returns the type associated with the directive.

TypeName Specifies the type name of the previous page. Define a base class for all previous pages.

VIRTUALPATH specifies the path to a file that generates strongly typed files.

4. In the general ASP. NET loopback, the entire page is requested. Returning the same page that the user has loaded will return the entire page again. To reduce the amount of traffic on the network, you can use the ASP. NET AJAX loopback. In the Ajax loopback, only JavaScript is used to return and refresh part of the page, which is easy to do with UpdatePanel.

The UpdatePanel internally issues a ajaxpost request. Ajaxpost requests that a XMLHttpRequest object be used to send a request to the server. The server returns only the data for the update UI. After explaining the data, the JavaScript code modifies the HTML control inside the UpdatePanel and displays a new UI.

Note: 1) You need a ScriptManager control on the page before using the "UpdatePanel" control.

2) When there are multiple UpdatePanel, multiple UpdatePanel are modified by default at the same time. If you change the UpdateMode property of a single UpdatePanel from always to condition, this UpdatePanel is modified only for this UpdatePanel operation.

3) Modify the UpdatePanel trigger property to point to an object event in another UpdatePanel, and refresh the UI of this UpdatePanel when an object event in another UpdatePanel is triggered. (defines a trigger outside UpdatePanel that is raised by the UpdatePanel external control)

5. Validity Verification:

The validation control creates the client-side JavaScript code, validates the input on the client, and creates the server code to validate the input on the server side. If you set the Validation property enableclientscript to False, you can turn off JavaScript. Set the page's ClientTarget property, or you can close JavaScript without having to perform an action that alters the property value for each validation control.

C#web programming

Related Article

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.