Loss of _ eventtarget _ dopost Asp.net's built-in hidden domain and script Phenomenon

Source: Internet
Author: User
A program suddenly went wrong recently,
I found that I previously wrote a JavaScript function in the program to call the _ dopost function deleteapplication (eventtarget, eventargument) provided by Asp.net)
{
If (window. Confirm ("Are you sure? "))
_ Dopostback (eventtarget, eventargument );

}

As a result, we are surprised to find that the JavaScript code that we often see is not generated in the entire HTML code. <script language = "JavaScript" type = "text/JavaScript">
<! --
Function _ dopostback (eventtarget, eventargument ){
VaR theform;
If (window. Navigator. appname. tolowercase (). indexof ("Microsoft")>-1 ){
Theform = Document. form1;
}
Else {
Theform = Document. Forms ["form1"];
}
Theform. _ eventtarget. value = eventtarget. Split ("$"). Join (":");
Theform. _ eventargument. value = eventargument;
Theform. Submit ();
}
// -->
</SCRIPT>

<Input type = "hidden" name = "_ eventtarget" value = "/>
<Input type = "hidden" name = "_ eventargument" value = ""/>

Because these are automatically generated by. net, there is a problem here. Under what circumstances will Asp.net automatically generate these codes?

According to my idea, if Asp.net finds that there is an event processing control during compilation, it will automatically generate the code.
A program error occurs because there is no event-supported control on my page,
The processing method is to add a button and set its style visiblity = hidden,
Asp.net automatically generates the above Code.
Note: If you set the visible = false of the button, this method will not allow ASPNET to automatically generate the above Code.

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.