ASP. NET learning materials 4 attributes that cannot be forgotten in the Page Object

Source: Internet
Author: User

Page Object

 

This. ClientQueryString; // obtain the string following the question mark in the url request

 

ClientScript: Read-only attribute of a ClientScriptManager object. With ClientScript, you can manage scripts, register scripts, and add scripts to pages.

The following is a simple example.

Code Page. ClientScript. RegisterStartupScript (this. GetType (), "MyScript", "function AlertHello ()"
+ "{Alert ('hello, ASP. net') ;}", true );

Button1.Attributes ["onclick"] = "AlertHello ()";

Button2.Attributes ["onclick"] = "AlertHello ()";

 

ContentType attribute: gets and sets the http mime type associated with the current page.

IsPostBack: If it is false, it indicates the first page to be loaded.

This. MaintainScrollPositionOnPostBack = true; // keep the position of the scroll bar at the time of callback.

Master: MasterPage.

MasterPageFile: String obtains and sets the file name of the master page. Note that only the files set in the PreInit event are allowed.

 

 

 

 

 

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.