Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Strange Update Panel Error in Resource File

Reply
Thread Tools

Strange Update Panel Error in Resource File

 
 
John Kotuby
Guest
Posts: n/a
 
      02-28-2008
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.


 
Reply With Quote
 
 
 
 
John Kotuby
Guest
Posts: n/a
 
      02-28-2008
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" <(E-Mail Removed)> wrote in message
news:uNyy$(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
 
 
 
Julien Hoffmann
Guest
Posts: n/a
 
      06-05-2008
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to really disable Java Update check when there is NO "Update" tab in Control Panel? Sven Fischer Java 0 10-22-2012 07:54 AM
Resource expression to access resource located in library Heinrich Moser ASP .Net 1 03-27-2008 04:25 PM
Very annoying error: Access to the path is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity Jay ASP .Net 2 08-20-2007 07:38 PM
Resource manager problem: naming for embedded resource. Dirc Khan-Evans ASP .Net 1 10-17-2005 12:52 PM
The system cannot locate the resource specified. Error processing resource avishosh XML 2 08-08-2004 06:28 AM



Advertisments