__doPostBack is not defined

后端 未结 26 2038
不知归路
不知归路 2020-12-09 08:12

Im getting that error when try to call a __doPostBack on one of my pages, every page that i have in the project use __doPostBack function but in this particular page im gett

相关标签:
26条回答
  • 2020-12-09 08:27

    Solution for my Problem: IIS ASP.NET Webforms generates web pages depending on user Agent string

    My IIS had no definition for the IE11 browser so it defaulted to a very simple browser profile which doesn't even Support JavaScript.

    • short term solution: run browser in compatibility mode.
    • medium term solution: Deployment of .Net Framework 4.5.1 which contains IE11 browser profile definitions.

    An alternative: set IE11 Browser definiton file

    0 讨论(0)
  • 2020-12-09 08:27

    i used this method in my script that included to asp.net form:

    main form id sample:
    <script src="myscript" />
    
    <form id="frmPost" runat="server">
    </form>
    
    // myscript.js in java script function
    mypostboack: function () {
    $('#frmPost').context.forms[0].submit()
    }
    
    0 讨论(0)
  • 2020-12-09 08:29

    Wrapping my server side controls in a form element with runat="server" attribute worked for me. According to asp environment there should be only one form element with runat="server" attribute in it otherwise some serious issue may happen.

    <form runat="server" id="form1">
       <!-- Server side controls go here -->
    </form>
    
    0 讨论(0)
  • 2020-12-09 08:34

    Just add this code to your .aspx

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    0 讨论(0)
  • 2020-12-09 08:34

    I had this problem just today, but none of the solutions I found worked, unfortunately including yours. So if someone reads this and it doesn't work for them try this

    http://you.arenot.me/2010/11/03/asp-net-__dopostback-is-not-defined/

    Cheers though for helping me through the process of working out what went wrong!

    0 讨论(0)
  • 2020-12-09 08:35
    lnkDeactivate.Attributes("onclick") = ClientScript.GetPostbackClientHyperlink(lnkDeactivate, "deactivate")
    
    0 讨论(0)
提交回复
热议问题