Strange Update Panel Error in Resource File

Discussion in 'ASP .Net' started by John Kotuby, Feb 28, 2008.

  1. John Kotuby

    John Kotuby Guest

    Hi all,

    I have successfully created a well functioning stand-alone ASPX page written
    in VB using VS 2008 and the 3.5 framework. It uses an UpdatePanel with 5
    controls inside the ContentTemplate and works as expected.

    However. when I place essentailly the same code in the Content area of a
    Master Page I have problems with it. There is no ScriptManager on the Master
    Page and therefore I should not require a ScriptManagerProxy.


    <asp:ScriptManager ID="ScriptManager1" runat="server" >
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"
    ChildrenAsTriggers="false" >
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="btnPostUpd" />
    </Triggers>
    <ContentTemplate>...

    The defined Trigger is an ASP Button outside of the UpdatePanel region whose
    Click event is called by various JavaScript functions that I created to do
    some setup work before submitting the Callback, such as populating the
    values of hidden fields which I use during the Callback processing to
    determine the proper serverside functions to run, etc. These Javascript
    functions are the same ones used in the stand-alone version of the page...
    which works just fine.


    Running in the debugger I get ...

    htmlfile:Unknown runtime error

    The callstack is pointing to Sys$WebForms$PageRequestManager$_updatePanel.

    The line of code highlighted is:

    // Update the region with the new UpdatePanel content
    updatePanelElement.innerHTML = rendering;

    Which is in a ScriptResource.axd with a long querystring
    (?d=C7zdOE..........)

    When I Break and place my cursor over the highlighted code I see what looks
    like valid InnerHtml as below.

    rendering = "
    <table id="tblListLocator" align="center" width="98%"
    cellpadding="0px" cellspacing="0"
    border="1" bordercolor="silver">
    <tr>
    <td align="center" colspan="2">
    <div style="position:absolut...

    Has anyone seen anything like this before or have some idea why it might be
    occurring?
    So far I am stumped by this one.

    Thanks for any input.
    John Kotuby, Feb 28, 2008
    #1
    1. Advertising

  2. John Kotuby

    John Kotuby Guest

    Hi all,
    Well thankfully I discovered the nature of the problem. I will recount the
    error cause and fix here, in case anybody else has a similar problem.

    It was indeed related to my porting code from a stand-alone page to a
    content page. I was replacing an exisitng set of controls within the Content
    area with the ones contained in the UpdatePanel. I wanted to leave some
    controls at the very top of the content area and replace others below them.
    The controls that were to remain resided in a table structure used for
    layout.

    I mistakenly placed the script manager and update panel and its content
    template after a </TR> and before the closing </TABLE> element resulting in
    something like what I will display below.

    <TABLE>
    <TR><TD>
    .... exisitng controls ...
    </TD></TR>

    <asp:ScriptManager ID="ScriptManager1" runat="server" >
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"
    ChildrenAsTriggers="false" >
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="btnPostUpd" />
    </Triggers>
    <ContentTemplate>
    .... new controls within a table layout ...
    </ContentTemplate>

    </TABLE>

    For some reason Intellisense did not balk at this mistake, even though I had
    another Table layout within the ContentTemplate area. So I missed the error.
    Apparently Intellisense does not consider placing an UpdatePanel between the
    last </TR> and the closing </TABLE> a problem.

    However, as soon as I moved the closing </TABLE> tag above the ScriptManager
    everything started working correctly.

    Thanks to anyone who looked at this post and gave it some thought.
    Hopefully my solution will be helpful to the community.


    "John Kotuby" <> wrote in message
    news:uNyy$...
    > Hi all,
    >
    > I have successfully created a well functioning stand-alone ASPX page
    > written in VB using VS 2008 and the 3.5 framework. It uses an UpdatePanel
    > with 5 controls inside the ContentTemplate and works as expected.
    >
    > However. when I place essentailly the same code in the Content area of a
    > Master Page I have problems with it. There is no ScriptManager on the
    > Master Page and therefore I should not require a ScriptManagerProxy.
    >
    >
    > <asp:ScriptManager ID="ScriptManager1" runat="server" >
    > </asp:ScriptManager>
    > <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"
    > ChildrenAsTriggers="false" >
    > <Triggers>
    > <asp:AsyncPostBackTrigger ControlID="btnPostUpd" />
    > </Triggers>
    > <ContentTemplate>...
    >
    > The defined Trigger is an ASP Button outside of the UpdatePanel region
    > whose Click event is called by various JavaScript functions that I created
    > to do some setup work before submitting the Callback, such as populating
    > the values of hidden fields which I use during the Callback processing to
    > determine the proper serverside functions to run, etc. These Javascript
    > functions are the same ones used in the stand-alone version of the page...
    > which works just fine.
    >
    >
    > Running in the debugger I get ...
    >
    > htmlfile:Unknown runtime error
    >
    > The callstack is pointing to Sys$WebForms$PageRequestManager$_updatePanel.
    >
    > The line of code highlighted is:
    >
    > // Update the region with the new UpdatePanel content
    > updatePanelElement.innerHTML = rendering;
    >
    > Which is in a ScriptResource.axd with a long querystring
    > (?d=C7zdOE..........)
    >
    > When I Break and place my cursor over the highlighted code I see what
    > looks like valid InnerHtml as below.
    >
    > rendering = "
    > <table id="tblListLocator" align="center" width="98%"
    > cellpadding="0px" cellspacing="0"
    > border="1" bordercolor="silver">
    > <tr>
    > <td align="center" colspan="2">
    > <div style="position:absolut...
    >
    > Has anyone seen anything like this before or have some idea why it might
    > be occurring?
    > So far I am stumped by this one.
    >
    > Thanks for any input.
    >
    John Kotuby, Feb 28, 2008
    #2
    1. Advertising

  3. htmlfile: Unknown runtime error

    Hi all,
    Me too I thought I could give out my solution to a similar problem ; hopefully it will help.
    Long story made short :
    On a VB.NET 3.5 + AJAX web site, I wanted my visitors to be able to navigate inside one page unsing anchors.
    Anchors inside content rendered by a listview inside an update panel are ok, but....believe it or not, the "top" anchor, referring to the top of page was causing the "unknown error" !
    Anchor was <a name="top" /> and was located outside the update panel, under the opening form tag and before the scriptmanager tag.
    Got rid of it and all worked fine again. Don't ask why...
    Happy programming.
    JH
    Julien Hoffmann, Jun 5, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry
    Replies:
    3
    Views:
    539
    Harry Singh
    Nov 10, 2003
  2. Dirc Khan-Evans
    Replies:
    1
    Views:
    891
    Karl Seguin
    Oct 17, 2005
  3. avishosh
    Replies:
    2
    Views:
    10,564
    avishosh
    Aug 8, 2004
  4. Heinrich Moser
    Replies:
    1
    Views:
    455
    Heinrich Moser
    Mar 27, 2008
  5. Sven Fischer
    Replies:
    0
    Views:
    465
    Sven Fischer
    Oct 22, 2012
Loading...

Share This Page