So, seems the browser has javascript enabled but a function is missing. Get a view source and search for it, if __doPostBack is missing you may need to enable viewstate for the page, or, that function is getting called before it was available if a lot of
other things are loading ...
Im not sure what ViewState has to do with __doPostBack().
But with that said, by simply placing a <form runat="server"></form> on the page then the __Viewstate hidden field will be generated, even if you have viewstate disabled. And since you pretty much have to have a form tag to load a page in asp.net the viewstate
hidden field will basically always be there.
_doPostBack is generated whenever you place a control that does not ordinarily generate a postback on a page, but which you enable to cause a post back.
For instance, in plain html an <input type="submit"> will cause a postback, you get that html when you use an <asp:button> control. So in that case you don't need the _doPostBack() function as submit buttons do this on their own.
However an <asp:LinkButton> generates an html <a> tag which does not normally cause a postback, but instead creates a fresh page request to the linked to page. However the LinkButton adds some javascript to force the </a><a> tag to act like an <input type="submit">
and therefore it needs the _doPostBack() function which is generated for you by asp.net.
Same thing goes for a DropDownList. By default an html <select> </select><select> </select></a></asp:LinkButton></asp:button>
Im not sure what ViewState has to do with __doPostBack().
But with that said, by simply placing a <form runat="server"></form> on the page then the __Viewstate hidden field will be generated, even if you have viewstate disabled. And since you pretty much have to have a form tag to load a page in asp.net the viewstate
hidden field will basically always be there.
_doPostBack is generated whenever you place a control that does not ordinarily generate a postback on a page, but which you enable to cause a post back.
For instance, in plain html an <input type="submit"> will cause a postback, you get that html when you use an <asp:button> control. So in that case you don't need the _doPostBack() function as submit buttons do this on their own.
However an <asp:LinkButton> generates an html <a> tag which does not normally cause a postback, but instead creates a fresh page request to the linked to page. However the LinkButton adds some javascript to force the </a><a> tag to act like an <input type="submit">
and therefore it needs the _doPostBack() function which is generated for you by asp.net.
Same thing goes for a DropDownList. By default an html <select> </select><select> </select></a></asp:LinkButton></asp:button>
Error: __doPostBack is not defined
Source File: javascript:__doPostBack('ctl00$CareersContent$JobListByDate$gvJobList','Page$2')
Line: 1
The error says doPostBack is not defined, viewstate is part of the clientside data along with javascript so I'm assuming that function is part of it.
I don't know what causes this error, just trying to help you out, the error means the function doesn't exist ... did you add an event handler manually?
the strange thing is it works for 2 minutes and it starts to give this error.
did anyone solved this error?
I debug the scripts and i find this.
function Sys$UI$_Timer$_doPostback(){
__doPostBack(this.get_uniqueID(),'');
}
Uncaught ReferenceError: __doPostBack is not defined
[Exception] ReferenceError: __doPostBack is not defined
It sounds strange, but try adding a call to
GetPostBackEventReference in your code-behind (Page_Load works). Even if you ignore its return value, the presence of the call forces ASP.NET to render the __doPostBack client-side function declaration.
liamsmith
Member
60 Points
29 Posts
__doPostBack is not defined
Oct 09, 2007 04:26 PM|LINK
I have a GridView control with paging on my page, amoung a number of other things.
On some computers (same operating system, same browser), I get the following error when clicking on the paging links:
Error: __doPostBack is not defined Source File: javascript:__doPostBack('ctl00$CareersContent$JobListByDate$gvJobList','Page$2') Line: 1Anyone know what might be causing this? I'm afraid the page is far too large to post any useful source code here.
gt1329a
All-Star
15377 Points
2501 Posts
ASPInsiders
MVP
Re: __doPostBack is not defined
Oct 09, 2007 11:59 PM|LINK
A guide to combining jQuery and ASP.NET: jQuery for the ASP.NET developer
timallard
Member
636 Points
160 Posts
Re: __doPostBack is not defined
Oct 10, 2007 02:18 AM|LINK
So, seems the browser has javascript enabled but a function is missing. Get a view source and search for it, if __doPostBack is missing you may need to enable viewstate for the page, or, that function is getting called before it was available if a lot of other things are loading ...
hth,
analyst/architect, SDE
liamsmith
Member
60 Points
29 Posts
Re: __doPostBack is not defined
Oct 10, 2007 03:12 PM|LINK
The error was happening under both Windows XP and Windows Server 2003, with IE 7.
I checked the source of the page and the entire ViewState and __doPostBack function area was missing.
I've temporarily solved the problem by adding a blank LinkButton into the page. This seems to force ASP.NET to create the ViewState code.
viscious
Participant
1240 Points
216 Posts
Re: __doPostBack is not defined
Oct 10, 2007 08:05 PM|LINK
Im not sure what ViewState has to do with __doPostBack().
But with that said, by simply placing a <form runat="server"></form> on the page then the __Viewstate hidden field will be generated, even if you have viewstate disabled. And since you pretty much have to have a form tag to load a page in asp.net the viewstate hidden field will basically always be there.
_doPostBack is generated whenever you place a control that does not ordinarily generate a postback on a page, but which you enable to cause a post back.
For instance, in plain html an <input type="submit"> will cause a postback, you get that html when you use an <asp:button> control. So in that case you don't need the _doPostBack() function as submit buttons do this on their own.
However an <asp:LinkButton> generates an html <a> tag which does not normally cause a postback, but instead creates a fresh page request to the linked to page. However the LinkButton adds some javascript to force the </a><a> tag to act like an <input type="submit"> and therefore it needs the _doPostBack() function which is generated for you by asp.net.
Same thing goes for a DropDownList. By default an html <select> </select><select> </select></a></asp:LinkButton></asp:button>
timallard
Member
636 Points
160 Posts
Re: __doPostBack is not defined
Oct 11, 2007 03:16 AM|LINK
Error: __doPostBack is not defined Source File: javascript:__doPostBack('ctl00$CareersContent$JobListByDate$gvJobList','Page$2') Line: 1analyst/architect, SDE
erdsah88
Contributor
3453 Points
930 Posts
Re: __doPostBack is not defined
Jan 04, 2010 09:40 AM|LINK
I have the same error.
the strange thing is it works for 2 minutes and it starts to give this error.
did anyone solved this error?
I debug the scripts and i find this.
function Sys$UI$_Timer$_doPostback(){ __doPostBack(this.get_uniqueID(),''); } Uncaught ReferenceError: __doPostBack is not defined [Exception] ReferenceError: __doPostBack is not definedgt1329a
All-Star
15377 Points
2501 Posts
ASPInsiders
MVP
Re: __doPostBack is not defined
Jan 04, 2010 12:52 PM|LINK
It sounds strange, but try adding a call to GetPostBackEventReference in your code-behind (Page_Load works). Even if you ignore its return value, the presence of the call forces ASP.NET to render the __doPostBack client-side function declaration.
A guide to combining jQuery and ASP.NET: jQuery for the ASP.NET developer
erdsah88
Contributor
3453 Points
930 Posts
Re: __doPostBack is not defined
Jan 18, 2010 12:48 PM|LINK
i have the same issue.
the asp.net engine seems to have an internal bug.
i get the same error after 3 minutes.
<div>timallard
Member
636 Points
160 Posts
Re: __doPostBack is not defined
Jan 18, 2010 01:25 PM|LINK
What version of visual studio is the from? I've had trouble with vs2008 publishing ...
analyst/architect, SDE