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
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.
An alternative: set IE11 Browser definiton file
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()
}
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>
Just add this code to your .aspx
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
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!
lnkDeactivate.Attributes("onclick") = ClientScript.GetPostbackClientHyperlink(lnkDeactivate, "deactivate")