Summary of ASP. NET

Source: Internet
Author: User

@ 2011-09-05

1. Check whether the user is logged on before entering each page. If no logon is performed, response. Redirect () is sent to the logon page:

Create a page, check whether the page is logged on in the page constructor, and then let each page that you want to check for Logon inherit the page

2. Page class attributes:

-- Ispostback (whether to return data)

-- Validaterequest (whether to check the dangerous code entered by the client). If you want to allow the input, set validaterequest = "false" at the top of the ASPX page"

-- Clientscript. The final false indicates whether to add the <SCRIPT> </SCRIPT> flag to the string. Because the scripts string already exists, it is false.

String scripts = "<SCRIPT type = 'javascript '> alert ('hello'); </SCRIPT>"; clientscriptmanager CSM = page. clientscript; // CSM. registerclientscriptblock (this. getType (), "Sss", scripts,False); // The registered script file only starts with the form tag on the page.
CSM. registerstartupscript (this. GetType (), "Sss", scripts,False); // And this is ended by the form label only.

If (! Page. clientscript. isregisteredstartupscript (this. GetType (), script )){

Page. clientscript. registeredstartupscript (this. GetType (), "Sss", script, false );

}

@

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.