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 getting that Javascript error.
i was looking in the internet and the only thing i read is that this error happends when i have a unclose tag but i review the site and its ok.
Error: __doPostBack is not defined Source File: htt://localhost:99/ProjectName/Disable.aspx Line: 1
I was getting this when I was clicking on a LinkButton. Solved this by adding
OnClick="LinkButton2_Click"
to the markup.This trick worked for me. Still would have liked to know why it wasn't rendering...
Thank you!
It is __doPostBack function not found error. Put one button in page and set its usersubmitbehavior=false, then run and see viewsource, you will have __doPostBack function automatically be added in your page.
Now put your own html button which you want to make postback from and call __doPostBack function by setting its onclick="__doPostBack('mybut','save')".
Now the __doPostBack function required for your html button is given by the above button.
__doPostBack()
should be automatically included by any ASP.NET WebControl that could cause a post back. You sound like you are calling it manually in some Javascript you wrote. If so, you will need to include a WebControl, to make sure that function in inserted onto the page.The run time/client side error
__doPostBack
is undefined hassled me for a few hours. There was lots of misleading/incorrect help on the net. I inserted the following line of code in thePage_Load
event of thedefault.aspx.cs
file and everything worked fine, on my system and in production with GoDaddy.