How to solve the Script Error of ASP. NET Website & #39 ;__ doPostBack & #39; is undefined

Source: Internet
Author: User

I recently encountered a very strange problem!

A new ASP.. NET website, based on. net 4.0 framework, basically no new technology is used, but because the server used for previewing is relatively old for the customer, the operating system uses Windows 2003. By default, only IIS 6 is supported. After the website is published, most functions can run normally, but some operations may inexplicably report the '_ dopostback' is undefined script error. Find the cause of the error on the Internet, this is a bug in. net 4.0 framework, you can view this article http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx

Some ASP. NET Control will expire in postback and throw the '_ dopostback' is undefined Script Error, such as triggered by the SelectedIndexChanged event of DropDownList, RadioButtonList or CheckBoxList in postback, there are also LinkButton and other controls. This problem only occurs in the later version of IE browser (because I only have IE11 on the machine, I am not sure whether or not the earlier version of IE will also have this problem ), everything works normally on FireFox and Chrome. In addition, changing the User agent string to IE10 or below in IE also runs normally.

($ ('#__ EVENTTARGET '). length <= 0 & $ ('#__ EVENTARGUMENT '). length <= 0' # YOUR_ASPNET_FORMID '). prepend ('<input type = "hidden" name = "_ EVENTTARGET" id = "_ EVENTTARGET" value = ""/> <input type = "hidden" name =" _ EVENTARGUMENT "id =" _ EVENTARGUMENT "value =" "/> '(_ doPostBack = 'undefined' = theForm = document. forms ['your _ ASPNET_FORMID '(! = (! TheForm. onsubmit | (theForm. onsubmit ()! ===

 

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.