2.0 runtime javascript error - WebForm_PostBackOptions is undefine

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rich

    2.0 runtime javascript error - WebForm_PostBackOptions is undefine

    I am converting my enterprise solution from VS 2003 (.NET v1.1.4322) to VS
    2005 (.NET v2.0.50727). The entire solution uses serveral technologies -
    Windows Server 2003 (AD, SQL Server 2000, IIS, ASP.NET, ASP.NET Mobile)
    Windows Mobile 2003 (Pocket IE)

    I have completed a portion of the conversion (ASP.NET Mobile pages for PIE,
    and some of the ASP.NET-bases web services), and while
    testing I have a runtime error that did not exist in the 1.1 version.
    It is associated with a Windows Mobile ObjectList (mobile:ObjectL ist )
    When debugging on the desktop in IE 6.0 (I have *not* yet started conversion
    testing with PIE on the PDA), I click on a linkbutton in the object list and
    now receive a JavaScript error -
    WebForm_PostBac kOptions is undefined.

    I am not using Javascript explicitly in my code, the error is caused by
    ASP.NET 2.0-generated Javascript.
    My .aspx code for LinkButtons in the ObjectList looks like -
    (<asp:LinkButto n ID="lbnTask" CommandName="de tails" Runat="server"> <%#
    ((ObjectListIte m)Container)["name"] %></asp:LinkButton> )

    ASP.NET 2.0 generates javascript for the browser that looks like -
    <TD><a id="olstTask__c tl1_lbnTask"
    href="javascrip t:WebForm_DoPos tBackWithOption s(new
    WebForm_PostBac kOptions("olstT ask:_ctl1:lbnTa sk", "", true, "", "", false,
    true))">medicat e patient</a></TD>

    Previously, ASP.NET 1.1 generated javascript for the browser that looks very
    similar -
    <TD><a id="olstTask__c tl1_lbnTask"
    href="javascrip t:WebForm_DoPos tBackWithOption s(new
    WebForm_PostBac kOptions("olstT ask:_ctl1:lbnTa sk", "", true, "", "", false,
    true))">medicat e patient</a></TD>

    I know there is JavaScript embedded in System.Web.dll, for example -
    function WebForm_PostBac kOptions(eventT arget, eventArgument, validation,
    validationGroup , actionUrl, trackFocus, clientSubmit)
    My C# code behind already has "using System.Web;", and I tried adding "<%@
    Import Namespace="Syst em.Web" %>" to the 2.0 .aspx file, but it did not help
    with
    this issue.

    Is there a configuration step I am missing as part of the "port" to 2.0?
  • Josh Twist

    #2
    Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is undefine

    I had a similar problem and it was a HttpModule that prevented ASP.NET
    from serving the "WebResource.ax d" file (ASP.NET 2.0 uses this to
    deliver scripts, this is different to ASP.NET 1.1).

    Could this be your problem? Maybe try temporarily removing any modules
    and see if it goes away.

    Josh


    Comment

    • Rich

      #3
      Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

      Josh -
      Thanks for your reply.

      You said it might be that an HttpModule prevented ASP.NET from serving the
      "WebResource.ax d" file.

      I am not at all sure what that means. Can you say a few more words about
      what I might check to see if it is blocked. A log file somewhere?

      "Josh Twist" wrote:
      [color=blue]
      > I had a similar problem and it was a HttpModule that prevented ASP.NET
      > from serving the "WebResource.ax d" file (ASP.NET 2.0 uses this to
      > deliver scripts, this is different to ASP.NET 1.1).
      >
      > Could this be your problem? Maybe try temporarily removing any modules
      > and see if it goes away.
      >
      > Josh
      > http://www.thejoyofcode.com/
      >
      >[/color]

      Comment

      • Josh Twist

        #4
        Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

        Most of the JavaScript functions used by ASP.NET are served by a new
        'page' called WebResource.axd . Can you see a link to this in your
        source, would look something like:

        <script src="WebResourc e.axd...

        I had a HttpModule that intercepted all requests to my service to
        rewrite urls (e.g. http://mydomain.com/showcategory.aspx?cat=taps to
        http://mydomain.com/taps). It turned out that this was stopping the axd
        from sending the script down and I got a heap of XXX is undefined
        errors.

        Josh

        Comment

        • Rich

          #5
          Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

          Josh,
          Thanks again for hanging with me!

          There is no reference to WebResource.axd anywhere in my "solution" directory
          (C:\Inetpub\www root\poc_web\).
          However, under C:\WINNT\Micros oft.NET\Framewo rk\v2.0.50727, in "web.config "
          (which I have not modified directly), there is a section that starts
          <httpHandlers >
          <add path="trace.axd " verb="*"
          type="System.We b.Handlers.Trac eHandler" validate="True" />
          <add path="WebResour ce.axd" verb="GET"
          type="System.We b.Handlers.Asse mblyResourceLoa der" validate="True" />
          <add path="*.axd" verb="*" type="System.We b.HttpNotFoundH andler"
          validate="True" />

          etc....

          Does that look OK? Is there some other configuration change I need to make,
          or is there anything to look at while debugging?



          "Josh Twist" wrote:
          [color=blue]
          > Most of the JavaScript functions used by ASP.NET are served by a new
          > 'page' called WebResource.axd . Can you see a link to this in your
          > source, would look something like:
          >
          > <script src="WebResourc e.axd...
          >
          > I had a HttpModule that intercepted all requests to my service to
          > rewrite urls (e.g. http://mydomain.com/showcategory.aspx?cat=taps to
          > http://mydomain.com/taps). It turned out that this was stopping the axd
          > from sending the script down and I got a heap of XXX is undefined
          > errors.
          >
          > Josh
          >
          >[/color]

          Comment

          • Josh Twist

            #6
            Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

            Don't change that - that's supposed to be there. That's the bit that
            makes sure WebResource.axd works properly :)

            I suspect you'd know if you were using HttpModules, so this isn't your
            problem. To be sure you can check your web.config file and see if there
            are any httpModules configured. They'd be inside a <httpModules> node
            somewhere under <system.web>.

            However, I mean the web.config in your application, not the one in the
            the folder you mention above.

            Josh

            Comment

            • Rich

              #7
              Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

              Josh -
              I don't have any httpModules set up in the application-level web.config file.

              Any other ideas?

              "Josh Twist" wrote:
              [color=blue]
              > Don't change that - that's supposed to be there. That's the bit that
              > makes sure WebResource.axd works properly :)
              >
              > I suspect you'd know if you were using HttpModules, so this isn't your
              > problem. To be sure you can check your web.config file and see if there
              > are any httpModules configured. They'd be inside a <httpModules> node
              > somewhere under <system.web>.
              >
              > However, I mean the web.config in your application, not the one in the
              > the folder you mention above.
              >
              > Josh
              >
              >[/color]

              Comment

              • Josh Twist

                #8
                Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

                Hmmm, not sure...

                Let's make sure it is something to do with your WebResource.axd file.
                Have a look in your src, you should have a line that looks something
                like this (the random characters will be different)

                <script
                src="/WebResource.axd ?d=3v2Q4FZSi09Z wjYwg-vpMg2&amp;t=632 674154005468750 "
                type="text/javascript"></script>

                Grab the src path and try and view the file in your browser, i.e. goto



                (again your random chars will be different)

                You will probably need to save the file and view it notepad. If
                everything goes OK you should see a file full of lovely javascript...
                if not then something is wrong... let me know how you get on.

                You could also use ieHTTPHeaders to make sure the file is being
                requested and sent back with a normal 200 response code. I wrote an
                article about how to use ieHTTPHeaders here:


                Hope that helps

                Josh

                Comment

                • Rich

                  #9
                  Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

                  Josh,
                  Thanks for hanging with me.
                  Here is the entire server-generated file for the page in 2.0.
                  Notice there is no reference to WebResource.axd at all!

                  -----start file-----

                  <html><body>
                  <form id="frmTasks" name="frmTasks" method="post"
                  action="poc_web _form1.aspx?__u fps=740275">
                  <input type="hidden" name="__VIEWSTA TE"
                  value="aDxfX1A7 QDxmcm1UYXNrczv pobPnlrTvuZngo4 gsMjs+Oz5tQovZR H9n2Sgf16Bh56ff mAdj3w==">
                  <input type="hidden" name="__EVENTTA RGET" value="">
                  <input type="hidden" name="__EVENTAR GUMENT" value="">
                  <script language=javasc ript><!--
                  function __doPostBack(ta rget, argument){
                  var theform = document.frmTas ks
                  theform.__EVENT TARGET.value = target
                  theform.__EVENT ARGUMENT.value = argument
                  theform.submit( )
                  }
                  // -->
                  </script>
                  <TABLE id="tblMyTasks " cellSpacing="1" cellPadding="1" width="300" border="0">
                  <TR><TD><IMG alt="Sea State 1" src="ss1_logo.p ng"></TD></TR>
                  <TR>
                  <TD>Task start:</TD>
                  <TD>Patient:</TD>
                  <TD>Task:</TD></TR>
                  <font size="-1">
                  <TR>
                  <TD><a id="olstTask__c tl1_lbnStart" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl1:l bnStart','')} ">10/24 9:00</a></TD>
                  <TD><a id="olstTask__c tl1_lbnPatient" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl1:l bnPatient','')} ">Lee, Terry</a></TD>
                  <TD><a id="olstTask__c tl1_lbnTask" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl1:l bnTask','')} ">medicate patient</a></TD></TR>
                  <TR bgcolor="#ccffc c">
                  <TD><a id="olstTask__c tl2_lbnStart_al t" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl2:l bnStart_alt','' )} ">10/24 9:20</a></TD>
                  <TD><a id="olstTask__c tl2_lbnPatient_ alt" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl2:l bnPatient_alt', '')} ">Sahu, Subakanta</a></TD>
                  <TD><a id="olstTask__c tl2_lbnTask_alt " href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl2:l bnTask_alt','') } ">medicate
                  patient</a></TD></TR>
                  <TR>
                  <TD><a id="olstTask__c tl3_lbnStart" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl3:l bnStart','')} ">10/24 9:30</a></TD>
                  <TD><a id="olstTask__c tl3_lbnPatient" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl3:l bnPatient','')} ">Sahu, Subakanta</a></TD>
                  <TD><a id="olstTask__c tl3_lbnTask" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl3:l bnTask','')} ">medicate patient</a></TD></TR>
                  <TR bgcolor="#ccffc c">
                  <TD><a id="olstTask__c tl4_lbnStart_al t" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl4:l bnStart_alt','' )} ">10/24 10:00</a></TD>
                  <TD><a id="olstTask__c tl4_lbnPatient_ alt" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl4:l bnPatient_alt', '')} ">Bar, Dale</a></TD>
                  <TD><a id="olstTask__c tl4_lbnTask_alt " href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl4:l bnTask_alt','') } ">medicate
                  patient</a></TD></TR>
                  <TR>
                  <TD><a id="olstTask__c tl5_lbnStart" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl5:l bnStart','')} ">10/24 10:10</a></TD>
                  <TD><a id="olstTask__c tl5_lbnPatient" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl5:l bnPatient','')} ">Bar, Dale</a></TD>
                  <TD><a id="olstTask__c tl5_lbnTask" href="javascrip t:{if
                  (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                  __doPostBack('o lstTask:_ctl5:l bnTask','')} ">medicate patient</a></TD></TR>
                  </TABLE>
                  <font size="+0"><a href="javascrip t:__doPostBack( 'frmTasks','2') "[color=blue]
                  >Next</a></font></font></form></body></html>[/color]

                  -----end file-----

                  "Josh Twist" wrote:
                  [color=blue]
                  > Hmmm, not sure...
                  >
                  > Let's make sure it is something to do with your WebResource.axd file.
                  > Have a look in your src, you should have a line that looks something
                  > like this (the random characters will be different)
                  >
                  > <script
                  > src="/WebResource.axd ?d=3v2Q4FZSi09Z wjYwg-vpMg2&t=6326741 54005468750"
                  > type="text/javascript"></script>
                  >
                  > Grab the src path and try and view the file in your browser, i.e. goto
                  > http://localhoast/MyApplication/WebR...74154005468750
                  >
                  >
                  > (again your random chars will be different)
                  >
                  > You will probably need to save the file and view it notepad. If
                  > everything goes OK you should see a file full of lovely javascript...
                  > if not then something is wrong... let me know how you get on.
                  >
                  > You could also use ieHTTPHeaders to make sure the file is being
                  > requested and sent back with a normal 200 response code. I wrote an
                  > article about how to use ieHTTPHeaders here:
                  > http://www.thejoyofcode.com/Better_u...TPHeaders.aspx
                  >
                  > Hope that helps
                  >
                  > Josh
                  >
                  >[/color]

                  Comment

                  • Josh Twist

                    #10
                    Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

                    Hi Rich,

                    The source you've just sent doesn't contain any Javascript errors? I
                    just c&p'd it into a HTML file and viewed it in my browser, worked a
                    treat??

                    Josh

                    Comment

                    • Rich

                      #11
                      Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

                      Josh,
                      If you c&p to an HTML file it should display OK. (That gives you an idea of
                      what my very ASP.NET mobile simple page looks like.) However, when I select
                      the "medicate patient" list under the "Task:" column while running ASP.NET
                      2.0 in the VS2005 debugger, I get a javascript error:
                      WebForm_PostBac kOptions is undefined.

                      I previously did not get this error while running ASP.NET 1.1 in the VS2003
                      debugger.

                      My confusion (the reason for my original post) is around what might have
                      gone wrong with the 1.1 -> 2.0 conversion process or with my VS 2005
                      environment settings.

                      "Josh Twist" wrote:
                      [color=blue]
                      > Hi Rich,
                      >
                      > The source you've just sent doesn't contain any Javascript errors? I
                      > just c&p'd it into a HTML file and viewed it in my browser, worked a
                      > treat??
                      >
                      > Josh
                      >
                      >[/color]

                      Comment

                      • Josh Twist

                        #12
                        Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

                        Strange...

                        The medicate patient link works OK in full IE. There is no javascript
                        error at all in the source you provided. Here's a snippet...

                        <a id="olstTask__c tl5_lbnTask" href="javascrip t:{if
                        (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                        __doPostBack('o lstTask:_ctl5:l bnTask','')} ">medicate patient</a>

                        The javascript here says
                        1. Is there a function called Page_ClientVali date available?
                        2. If so, call it, if not don't (there isn't so it doesn't)
                        3. Finally, it calls __doPostBack function (which is available - you'll
                        see it at the top of you page) which causes the page to postback.

                        And there the script ends.

                        I beginning to wonder if this is a mobile IE problem and I run out of
                        steam there. Sorry.

                        Have a great weekend.

                        Josh


                        Comment

                        • Rich

                          #13
                          Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

                          Josh,
                          I am such a putz!!!!

                          The code I posted yesterday was the *1.1* generated client code, and not the
                          *2.0* code. I am very sorry.

                          The error is "WebForm_PostBa ckOptions is undefined", and the 1.1 file does
                          not use WebForm_PostBac kOptions. If you have a chance to take one last look,
                          the 2.0 generated client code is below:

                          <html><body>
                          <form id="frmTasks" name="frmTasks" method="post"
                          action="poc_web _form1.aspx?__u fps=918838">
                          <input type="hidden" name="__VIEWSTA TE"
                          value="/wEXAQUDX19QDwUI ZnJtVGFza3MPBsE 1LJaX48eIAgLnby z/0czpG1XLJnTWdrR j4a6t9w==">
                          <input type="hidden" name="__EVENTTA RGET" value="">
                          <input type="hidden" name="__EVENTAR GUMENT" value="">
                          <script language=javasc ript><!--
                          function __doPostBack(ta rget, argument){
                          var theform = document.frmTas ks
                          theform.__EVENT TARGET.value = target
                          theform.__EVENT ARGUMENT.value = argument
                          theform.submit( )
                          }
                          // -->
                          </script>

                          <TABLE id="tblMyTasks " cellSpacing="1" cellPadding="1" width="300" border="0">
                          <TR><TD><IMG alt="Sea State 1" src="ss1_logo.p ng"></TD></TR>
                          <TR><TD>Task start:</TD><TD>Patient: </TD><TD>Task:</TD></TR>
                          <font size="-1">
                          <TR>
                          <TD><a id="olstTask__c tl1_lbnStart"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl1:lbnSt art", "", true, "", "", false,
                          true))">10/24 9:00</a></TD>
                          <TD><a id="olstTask__c tl1_lbnPatient"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl1:lbnPa tient", "", true, "", "", false,
                          true))">Lee, Terry</a></TD>
                          <TD><a id="olstTask__c tl1_lbnTask"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl1:lbnTa sk", "", true, "", "", false,
                          true))">medicat e patient</a></TD></TR>
                          <TR bgcolor="#ccffc c">
                          <TD><a id="olstTask__c tl2_lbnStart_al t"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl2:lbnSt art_alt", "", true, "", "",
                          false, true))">10/24 9:10</a></TD>
                          <TD><a id="olstTask__c tl2_lbnPatient_ alt"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl2:lbnPa tient_alt", "", true, "", "",
                          false, true))">Lee, Terry</a></TD>
                          <TD><a id="olstTask__c tl2_lbnTask_alt "
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl2:lbnTa sk_alt", "", true, "", "",
                          false, true))">medicat e patient</a></TD></TR>
                          <TR>
                          <TD><a id="olstTask__c tl3_lbnStart"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl3:lbnSt art", "", true, "", "", false,
                          true))">10/24 9:20</a></TD>
                          <TD><a id="olstTask__c tl3_lbnPatient"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl3:lbnPa tient", "", true, "", "", false,
                          true))">Sahu, Subakanta</a></TD>
                          <TD><a id="olstTask__c tl3_lbnTask"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl3:lbnTa sk", "", true, "", "", false,
                          true))">medicat e patient</a></TD></TR>
                          <TR bgcolor="#ccffc c">
                          <TD><a id="olstTask__c tl4_lbnStart_al t"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl4:lbnSt art_alt", "", true, "", "",
                          false, true))">10/24 9:30</a></TD>
                          <TD><a id="olstTask__c tl4_lbnPatient_ alt"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl4:lbnPa tient_alt", "", true, "", "",
                          false, true))">Sahu, Subakanta</a></TD>
                          <TD><a id="olstTask__c tl4_lbnTask_alt "
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl4:lbnTa sk_alt", "", true, "", "",
                          false, true))">medicat e patient</a></TD></TR>
                          <TR>
                          <TD><a id="olstTask__c tl5_lbnStart"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl5:lbnSt art", "", true, "", "", false,
                          true))">10/24 10:00</a></TD>
                          <TD><a id="olstTask__c tl5_lbnPatient"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl5:lbnPa tient", "", true, "", "", false,
                          true))">Bar, Dale</a></TD>
                          <TD><a id="olstTask__c tl5_lbnTask"
                          href="javascrip t:WebForm_DoPos tBackWithOption s(new
                          WebForm_PostBac kOptions("olstT ask:_ctl5:lbnTa sk", "", true, "", "", false,
                          true))">medicat e patient</a></TD></TR>
                          </TABLE>
                          <font size="+0"><a href="javascrip t:__doPostBack( 'frmTasks','2') "[color=blue]
                          >Next</a></font></font></form></body></html>[/color]


                          "Josh Twist" wrote:
                          [color=blue]
                          > Strange...
                          >
                          > The medicate patient link works OK in full IE. There is no javascript
                          > error at all in the source you provided. Here's a snippet...
                          >
                          > <a id="olstTask__c tl5_lbnTask" href="javascrip t:{if
                          > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                          > __doPostBack('o lstTask:_ctl5:l bnTask','')} ">medicate patient</a>
                          >
                          > The javascript here says
                          > 1. Is there a function called Page_ClientVali date available?
                          > 2. If so, call it, if not don't (there isn't so it doesn't)
                          > 3. Finally, it calls __doPostBack function (which is available - you'll
                          > see it at the top of you page) which causes the page to postback.
                          >
                          > And there the script ends.
                          >
                          > I beginning to wonder if this is a mobile IE problem and I run out of
                          > steam there. Sorry.
                          >
                          > Have a great weekend.
                          >
                          > Josh
                          > http://www.thejoyofcode.com/
                          >
                          >[/color]

                          Comment

                          • Rich

                            #14
                            Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

                            Apologies. My post identified the code as generated by the 2.0 server. In
                            fact, I posted my 1.1 server-generated code. The real 2.0 server-generated
                            code is -

                            <html><body>
                            <form id="frmTasks" name="frmTasks" method="post"
                            action="poc_web _form1.aspx?__u fps=918838">
                            <input type="hidden" name="__VIEWSTA TE"
                            value="/wEXAQUDX19QDwUI ZnJtVGFza3MPBsE 1LJaX48eIAgLnby z/0czpG1XLJnTWdrR j4a6t9w==">
                            <input type="hidden" name="__EVENTTA RGET" value="">
                            <input type="hidden" name="__EVENTAR GUMENT" value="">
                            <script language=javasc ript><!--
                            function __doPostBack(ta rget, argument){
                            var theform = document.frmTas ks
                            theform.__EVENT TARGET.value = target
                            theform.__EVENT ARGUMENT.value = argument
                            theform.submit( )
                            }
                            // -->
                            </script>

                            <TABLE id="tblMyTasks " cellSpacing="1" cellPadding="1" width="300" border="0">
                            <TR><TD><IMG alt="Sea State 1" src="ss1_logo.p ng"></TD></TR>
                            <TR><TD>Task start:</TD><TD>Patient: </TD><TD>Task:</TD></TR>
                            <font size="-1">
                            <TR>
                            <TD><a id="olstTask__c tl1_lbnStart"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl1:lbnSt art", "", true, "", "", false,
                            true))">10/24 9:00</a></TD>
                            <TD><a id="olstTask__c tl1_lbnPatient"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl1:lbnPa tient", "", true, "", "", false,
                            true))">Lee, Terry</a></TD>
                            <TD><a id="olstTask__c tl1_lbnTask"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl1:lbnTa sk", "", true, "", "", false,
                            true))">medicat e patient</a></TD></TR>
                            <TR bgcolor="#ccffc c">
                            <TD><a id="olstTask__c tl2_lbnStart_al t"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl2:lbnSt art_alt", "", true, "", "",
                            false, true))">10/24 9:10</a></TD>
                            <TD><a id="olstTask__c tl2_lbnPatient_ alt"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl2:lbnPa tient_alt", "", true, "", "",
                            false, true))">Lee, Terry</a></TD>
                            <TD><a id="olstTask__c tl2_lbnTask_alt "
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl2:lbnTa sk_alt", "", true, "", "",
                            false, true))">medicat e patient</a></TD></TR>
                            <TR>
                            <TD><a id="olstTask__c tl3_lbnStart"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl3:lbnSt art", "", true, "", "", false,
                            true))">10/24 9:20</a></TD>
                            <TD><a id="olstTask__c tl3_lbnPatient"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl3:lbnPa tient", "", true, "", "", false,
                            true))">Sahu, Subakanta</a></TD>
                            <TD><a id="olstTask__c tl3_lbnTask"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl3:lbnTa sk", "", true, "", "", false,
                            true))">medicat e patient</a></TD></TR>
                            <TR bgcolor="#ccffc c">
                            <TD><a id="olstTask__c tl4_lbnStart_al t"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl4:lbnSt art_alt", "", true, "", "",
                            false, true))">10/24 9:30</a></TD>
                            <TD><a id="olstTask__c tl4_lbnPatient_ alt"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl4:lbnPa tient_alt", "", true, "", "",
                            false, true))">Sahu, Subakanta</a></TD>
                            <TD><a id="olstTask__c tl4_lbnTask_alt "
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl4:lbnTa sk_alt", "", true, "", "",
                            false, true))">medicat e patient</a></TD></TR>
                            <TR>
                            <TD><a id="olstTask__c tl5_lbnStart"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl5:lbnSt art", "", true, "", "", false,
                            true))">10/24 10:00</a></TD>
                            <TD><a id="olstTask__c tl5_lbnPatient"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl5:lbnPa tient", "", true, "", "", false,
                            true))">Bar, Dale</a></TD>
                            <TD><a id="olstTask__c tl5_lbnTask"
                            href="javascrip t:WebForm_DoPos tBackWithOption s(new
                            WebForm_PostBac kOptions("olstT ask:_ctl5:lbnTa sk", "", true, "", "", false,
                            true))">medicat e patient</a></TD></TR>
                            </TABLE>
                            <font size="+0"><a href="javascrip t:__doPostBack( 'frmTasks','2') "[color=blue]
                            >Next</a></font></font></form></body></html>[/color]

                            "Rich" wrote:
                            [color=blue]
                            > Josh,
                            > Thanks for hanging with me.
                            > Here is the entire server-generated file for the page in 2.0.
                            > Notice there is no reference to WebResource.axd at all!
                            >
                            > -----start file-----
                            >
                            > <html><body>
                            > <form id="frmTasks" name="frmTasks" method="post"
                            > action="poc_web _form1.aspx?__u fps=740275">
                            > <input type="hidden" name="__VIEWSTA TE"
                            > value="aDxfX1A7 QDxmcm1UYXNrczv pobPnlrTvuZngo4 gsMjs+Oz5tQovZR H9n2Sgf16Bh56ff mAdj3w==">
                            > <input type="hidden" name="__EVENTTA RGET" value="">
                            > <input type="hidden" name="__EVENTAR GUMENT" value="">
                            > <script language=javasc ript><!--
                            > function __doPostBack(ta rget, argument){
                            > var theform = document.frmTas ks
                            > theform.__EVENT TARGET.value = target
                            > theform.__EVENT ARGUMENT.value = argument
                            > theform.submit( )
                            > }
                            > // -->
                            > </script>
                            > <TABLE id="tblMyTasks " cellSpacing="1" cellPadding="1" width="300" border="0">
                            > <TR><TD><IMG alt="Sea State 1" src="ss1_logo.p ng"></TD></TR>
                            > <TR>
                            > <TD>Task start:</TD>
                            > <TD>Patient:</TD>
                            > <TD>Task:</TD></TR>
                            > <font size="-1">
                            > <TR>
                            > <TD><a id="olstTask__c tl1_lbnStart" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl1:l bnStart','')} ">10/24 9:00</a></TD>
                            > <TD><a id="olstTask__c tl1_lbnPatient" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl1:l bnPatient','')} ">Lee, Terry</a></TD>
                            > <TD><a id="olstTask__c tl1_lbnTask" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl1:l bnTask','')} ">medicate patient</a></TD></TR>
                            > <TR bgcolor="#ccffc c">
                            > <TD><a id="olstTask__c tl2_lbnStart_al t" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl2:l bnStart_alt','' )} ">10/24 9:20</a></TD>
                            > <TD><a id="olstTask__c tl2_lbnPatient_ alt" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl2:l bnPatient_alt', '')} ">Sahu, Subakanta</a></TD>
                            > <TD><a id="olstTask__c tl2_lbnTask_alt " href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl2:l bnTask_alt','') } ">medicate
                            > patient</a></TD></TR>
                            > <TR>
                            > <TD><a id="olstTask__c tl3_lbnStart" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl3:l bnStart','')} ">10/24 9:30</a></TD>
                            > <TD><a id="olstTask__c tl3_lbnPatient" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl3:l bnPatient','')} ">Sahu, Subakanta</a></TD>
                            > <TD><a id="olstTask__c tl3_lbnTask" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl3:l bnTask','')} ">medicate patient</a></TD></TR>
                            > <TR bgcolor="#ccffc c">
                            > <TD><a id="olstTask__c tl4_lbnStart_al t" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl4:l bnStart_alt','' )} ">10/24 10:00</a></TD>
                            > <TD><a id="olstTask__c tl4_lbnPatient_ alt" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl4:l bnPatient_alt', '')} ">Bar, Dale</a></TD>
                            > <TD><a id="olstTask__c tl4_lbnTask_alt " href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl4:l bnTask_alt','') } ">medicate
                            > patient</a></TD></TR>
                            > <TR>
                            > <TD><a id="olstTask__c tl5_lbnStart" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl5:l bnStart','')} ">10/24 10:10</a></TD>
                            > <TD><a id="olstTask__c tl5_lbnPatient" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl5:l bnPatient','')} ">Bar, Dale</a></TD>
                            > <TD><a id="olstTask__c tl5_lbnTask" href="javascrip t:{if
                            > (typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
                            > __doPostBack('o lstTask:_ctl5:l bnTask','')} ">medicate patient</a></TD></TR>
                            > </TABLE>
                            > <font size="+0"><a href="javascrip t:__doPostBack( 'frmTasks','2') "[color=green]
                            > >Next</a></font></font></form></body></html>[/color]
                            >
                            > -----end file-----
                            >
                            > "Josh Twist" wrote:
                            >[color=green]
                            > > Hmmm, not sure...
                            > >
                            > > Let's make sure it is something to do with your WebResource.axd file.
                            > > Have a look in your src, you should have a line that looks something
                            > > like this (the random characters will be different)
                            > >
                            > > <script
                            > > src="/WebResource.axd ?d=3v2Q4FZSi09Z wjYwg-vpMg2&t=6326741 54005468750"
                            > > type="text/javascript"></script>
                            > >
                            > > Grab the src path and try and view the file in your browser, i.e. goto
                            > > http://localhoast/MyApplication/WebR...74154005468750
                            > >
                            > >
                            > > (again your random chars will be different)
                            > >
                            > > You will probably need to save the file and view it notepad. If
                            > > everything goes OK you should see a file full of lovely javascript...
                            > > if not then something is wrong... let me know how you get on.
                            > >
                            > > You could also use ieHTTPHeaders to make sure the file is being
                            > > requested and sent back with a normal 200 response code. I wrote an
                            > > article about how to use ieHTTPHeaders here:
                            > > http://www.thejoyofcode.com/Better_u...TPHeaders.aspx
                            > >
                            > > Hope that helps
                            > >
                            > > Josh
                            > >
                            > >[/color][/color]

                            Comment

                            • Josh Twist

                              #15
                              Re: 2.0 runtime javascript error - WebForm_PostBac kOptions is unde

                              Hi Rich,

                              You are a putz! Happens to the best of us :)

                              There is clearly a problem with your 2.0 source. I just checked the
                              contents of the JS file ASP.NET generates from WebResource.axd and sure
                              enough it contains a WebForm_PostBac kOptions and a
                              WebForm_DoPostB ackWithOptions function.

                              The really strange thing is that ASP.NET for some reason I don't
                              understand, is not inserting the link to the WebResource file in your
                              source. It just isn't there. Is there anything that you're doing in
                              your code that you think might affect this?

                              Otherwise I'm not sure - if any MSFT guys are listening in on this, now
                              might be a good time to step in! I have to go now but I will have a
                              quick dig around for you tomorrow. I'm not that hopeful that I'll be
                              able to get to the bottom of this for you remotely though.

                              Josh


                              Comment

                              Working...