Convert 2003 to 2005 problem: LinkButton JavaScript error: WebForm_DoPostBackWithOptions undefined

Last post 02-26-2009 3:14 PM by g4j. 4 replies.

Sort Posts:

  • Convert 2003 to 2005 problem: LinkButton JavaScript error: WebForm_DoPostBackWithOptions undefined

    12-13-2006, 10:07 AM
    • Member
      point Member
    • kira1
    • Member since 12-13-2006, 2:50 PM
    • Posts 8

    Hi,

    I have converted my project from .Net 1.1 in VS 2003 to .Net 2.0 in VS 2005 (web application).

    My link buttons which have validation on them now dont work. These are EDIT and ADD links in my datagrids. They fire a javascript called WebForm_DoPostBackWithOptions which is missing. I have googled a long time on this and cant find a definitive answer.

    Some say it is HTTP Modules that need removed from web.config but I am only using 1 NeatUpload by Brettle Development. I removed it anyway but this makes no difference.

    Other advice was that WebResource.axd file was not referenced in the page source but it is.

    Another suggestion I found (but with no solution) was it was a problem with WebUIValidation.js file (but the post did not say what!).

    When viewing the source in the browser __doPostBack js function is present (and works on 'delete' and 'cancel' linkbuttons  - but my 'edit' and 'add' link buttons call  WebForm_DoPostBackWithOptions (which I assuming is new in 2.0 and called due to the validation) and it is not present in the page source.  Do I need to manually update the WebUIValidation.js for my converted project anbd if so how do i do that?

    Help!

    Cheers
    Alan

  • Re: Convert 2003 to 2005 problem: LinkButton JavaScript error: WebForm_DoPostBackWithOptions undefined

    12-18-2006, 5:04 AM
    • Member
      point Member
    • kira1
    • Member since 12-13-2006, 2:50 PM
    • Posts 8

    Hi,

    In case anyone else experiences this problem and finds this post I have now fixed this. Problem was that the request to the server for WebResource.axd (which nows happens in .Net 2.0) actually triggers Application_PreRequestHandlerExecute from within Global.asax.cs

    So, not only does any code in there now get run twice but for some reason my refernce to a session variable != null was throwing a .Net 500 error 'null reference' which was not visible until I used Fiddler to examine the requests to the server.  The page still loaded OK but the error meant that some of teh required javascript was not sent with it.   I have removed all code from Application_PreRequestHandlerExecute and the error has gone away and all teh javascript now gets sent. So, no error on my Update and Add LinkButtons in my DataGrid.  Not that any of the 'snap-on' .Net JavaScript Validation does anything in any browser other than IE, (making it useless!) .. but thats another days problem...

    Cheers
    Al

  • Re: Convert 2003 to 2005 problem: LinkButton JavaScript error: WebForm_DoPostBackWithOptions undefined

    05-22-2007, 1:02 PM
    • Member
      10 point Member
    • Thelma
    • Member since 05-22-2007, 4:53 PM
    • Posts 5

    Hi,

    I also could not get session to work with Application_PreRequestHandlerExecute in ASP.NET 2.0.

    Finally after alot of searching found this link:

    http://www.velocityreviews.com/forums/t282576-aspnet-20-session-availability-in-globalasax.html

    Basically you check to see if the request uses sessions first before looking to access session variables.

    Thel

  • Re: Convert 2003 to 2005 problem: LinkButton JavaScript error: WebForm_DoPostBackWithOptions undefined

    01-21-2008, 8:11 AM
    • Member
      2 point Member
    • ghazzaghi
    • Member since 01-21-2008, 1:06 PM
    • Posts 1

    Hi
    This Problem occures when you developed your project in .net1.1 and you wnt to publish it on servever with .net2.

    Solution:

    In IIS while creating virtual directory, in the properties window of your web,in the ASP.NET Tab: in the field of asp.net version select: 1.1.4 instead of 2

    Is it so easy?!Wink

    Good Luck

  • Re: Convert 2003 to 2005 problem: LinkButton JavaScript error: WebForm_DoPostBackWithOptions undefined

    02-26-2009, 3:14 PM
    • Member
      2 point Member
    • g4j
    • Member since 02-26-2009, 3:07 PM
    • Posts 1

     I was developing a ASP.net 2.0 website (started in Net 2.0) and had the same problem. It seem that the problem was that I had remove (commented) the <form> tag form my master page (I was using <div> as my main container). It seem that ASP.net needs these tag do what ever they need to do.

     

    I hope this works for you guys too.

     

    Arrrrr.

     

    God Bless!

Page 1 of 1 (5 items)