IE10,IE11 Click LinkButton appears _dopostback undefined error resolution

Source: Internet
Author: User

Cause of the occurrence

  . NET2.0 and . there is an error in the browser definition file published with NET4.0, which saves a significant portion of the browser version definition. However, some versions of the browser (such as ie10,11) are no longer within this range. As a result,ASP . NET sees them as unknown browsers, default demotion processing, which will cause inconvenience to users, such as not support JavaScript features. An error occurs when the rendering mechanism of the ASP. NET server control Asp:linkbutton .

  server controls: 

<asp:linkbutton id="Logout" runat="server" onclick= "  logout_click"> logout </asp:LinkButton>

  Post-rendered HTML code:

<id= "Logout"  href= "Javascript:__dopostback (' Logout ', ')" > logout </a>

Then look at the automatically generated JS code:

var theform = document.forms[' Form1 ']; if (! theform) {    = document.form1;} function __doPostBack (Eventtarget, eventargument) {    iffalse)) {        =  Eventtarget;         = eventargument;        Theform.submit ();    }}

As you can see, LinkButton relies on the JS method _dopostback to submit the form, thus executing the server method. The browser's JS interpreter will report _dopostback undefined error to the user because the browser is not recognized and causes it to not generate _dopostback correctly.

Solution Solutions

  symptoms: Installing NuGet app_browsersupdate Package. Help the. NET Framework understand the new browser. Only valid on pages of this website.

  Fix it: Install patches on your server. 2600088 for. NET4.0 or 2600100 for. NET2.0

  When the client is Windows7, IE10 and IE11 generally do not appear this error. However, when the client OS is Windows8 , the IE11 situation still exists.

At this point, try to install. NET Framework4.5 on the server to resolve this issue.

  However, . NET Framework4.5 does not support OS Windows Server 2003, so if your site is under construction, it is recommended that you discard the LinkButton control .

Finish

IE10,IE11 Click LinkButton appears _dopostback undefined error resolution

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.