Javascript checks whether it is disabled, removes all script code on the page, and removes HTML elements from HTML.

Source: Internet
Author: User

1. Use Javascript

Add a javascript section to each pageCode:

Function window. onbeforeunload ()

{

If (event. clientx> document. Body. clientwidth & event. clienty <0 | event. altkey ){

Window. Open ("logout. aspx ");

}

}

Because the onbeforeunload method is executed when the browser is closed, refreshed, and the page is adjusted, You need to determine whether you have clicked the close button or pressed alt F4 to perform the true close operation.

Write the same method as session_end in page_load of logout. aspx, and add the event onload = "javascript: window. Close ()" to logout. aspx ()"

But there is still a problem. Javascript may have different behaviors in different browsers, and it is not determined when it is closed through the file->.

Common Web Services
Http://topic.csdn.net/u/20081217/13/5a9075fc-feb1-4cde-96ac-5f982f7a1b7b.html

 

WAP Binding data <Mobile: link id = "link1" runat = "server" navigateurl = '<% # "A. aspx? Id = "+ databinder. eval (container," dataitem. No "). tostring () %>'
TEXT = "link1"> </Mobile: link>

<Mobile: link id = "link1" runat = "server" navigateurl = '<% # "A. aspx? Id = "+ eval (" no "). tostring () %> '> <% # eval (" name ") %> </Mobile: link>

 

///


// remove all script code on the page
///
//
//
Public static string filterscript (string content)
{< br> string regexstr = @ ") "; // use boundary restrictions to obtain
return RegEx. replace (content, regexstr, String. empty, regexoptions. ignorecase | regexoptions. singleline);

}

///


// remove HTML elements from HTML
///
//
//
Public static string filterhtml (string content)
{< br> string newstr = filterscript (content);
string regexstr = @ "<[^>] *>";
return RegEx. replace (newstr, regexstr, String. empty, regexoptions. ignorecase);
}

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.