Strange Problem with UpdatePanel...

12 views
Skip to first unread message

Ana

unread,
Nov 4, 2009, 1:59:31 PM11/4/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi,

In the page I'm developing I have the following structure:

<div id="myDiv" runat="server">
<asp:UpdatePanel>
<ContentTemplate>
<asp:GridView Id=myGridView ...>
<Columns>
<TemplateField HeaderText="Header">
<ItemTemplate>
...
</ItemTemplate>
<InsertItemTemplate>
...
</InsertItemTemplate>
<EditItemTemplate>
...
</EditItemTemplate>
<FooterTemplate>
...
</FooterTemplate>
</TemplateField>
</Columns>
</asp:GridView>
</ContentTempate>
</asp:UpdatePanel>
</div>

Inside the GridView, in one of the <EditTemplate> and in one of the
<InsertItemTemplate>, I have the following line:
OnClientClick="javascript:setTimeout('__doPostBack(\'<
%=someButton.ClientID%>',\'\')', 0)" associated to a LinkButton
(UpdateButton and InsertButton).

This GridView is being shown when the user clicks on a linkButton
(DetailsLinkButton) in another GridView (the second GridView show the
details for the record chosen in the first one).

I'm having this error message when I click on the DetailsLinkButton:
Could not find UpdatePanel with ID 'ctl00 main Copy UpdatePanel'. If
it is being updated dynamically then it must be inside another
UpdatePanel.

I tried run the page after removing this two callings to the
javascript __postBack method but I still have the same problem (after
removing this two callings to the __postBack method, the only call to
a javascript in my Page is to confirm the deletion of a record).

Have anyone ever had this problem? What is happening? All help is
welcome!

Thanks,

Ana

Ana

unread,
Nov 4, 2009, 2:19:25 PM11/4/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
One more coment about the problem: my previous version didn't have the
<div> (Only the UpdatePanel and evrything inside it) and was working
ok. When I included the UpdatePanel inside the <div> was when I
started having this problem.

Processor Devil

unread,
Nov 5, 2009, 3:30:54 AM11/5/09
to dotnetde...@googlegroups.com
Your div has an ID, maybe try to look for your fields though that.

2009/11/4 Ana <drumond.a...@gmail.com>

Paulo Roberto Pellucci

unread,
Nov 5, 2009, 6:20:30 AM11/5/09
to dotnetde...@googlegroups.com
Ana, is that div really necessary then? I can't see no point on still having it if its causing the problem.
 
If you really have to use it, well then, we will try to fix the problem.
--
Atenciosamente,
Paulo Roberto S. Pellucci

Ana

unread,
Nov 5, 2009, 11:15:05 AM11/5/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I was originally using the div because inside it I had a lot of
controls that would be shown/hidden in the same circumstances, so
having everything inside a div tag would make it easier to set the
visibility of the group. But because it was causing more problems than
giving me solutions, I just removed the div tag. Thanks Paulo and
Processor :)

On Nov 5, 4:20 am, Paulo Roberto Pellucci <paulo.pellu...@gmail.com>
wrote:
> Ana, is that div really necessary then? I can't see no point on still having
> it if its causing the problem.
>
> If you really have to use it, well then, we will try to fix the problem.
> On Thu, Nov 5, 2009 at 6:30 AM, Processor Devil
> <processor.de...@gmail.com>wrote:
>
>
>
> > Your div has an ID, maybe try to look for your fields though that.
>
> > 2009/11/4 Ana <drumond.anaclau...@gmail.com>

Processor Devil

unread,
Nov 5, 2009, 11:36:39 AM11/5/09
to dotnetde...@googlegroups.com
strange, I just got a crazy idea...
What about to try <div id="myDiv"> instead of <div id="myDiv" runat="server"> ?
It would me that the whole div wasn't posted back on server and then it could work as you were used to :)

2009/11/5 Ana <drumond.a...@gmail.com>

Felipe Teixeira

unread,
Nov 5, 2009, 9:44:25 AM11/5/09
to dotnetde...@googlegroups.com
Whenever you use a control that is visible to the code behind (by setting runat=server), the IDs of its child server controls will change. to keep track of it you should refer to a control by its ClientID.

http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientid.aspx
http://msdn.microsoft.com/en-us/library/3hc29e2a.aspx

Hope it helps.


Felipe Teixeira
Microsoft Certified Technology Specialist - MCTS - Microsoft .Net Framework 2.0
Application Development Foundation MS
Web -based Client Development
Mobile: +55 (11) 8021-6457
txdo...@googlewave.com
http://iguessimnotcrazy.wordpress.com/


2009/11/5 Paulo Roberto Pellucci <paulo.p...@gmail.com>

Sandeep

unread,
Dec 10, 2009, 10:38:19 PM12/10/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Check if you using multiple UpdatePanels on your page and control of
one UpdatePanel is trying access control of another UpdatePanel.

I could fix same issue after reading following article:

http://dotnetspidor.blogspot.com/2009/02/sysinvalidoperationexceptio-in.html?showComment=1260502310856_AIe9_BE1nWk7xsQRMFukkVtzruOWSf8SHFdwxS_ofZCp49qBgbvNCAkSOG5lUjdgqpTXX2-i0gK183oSKHRRZjyK38vr6RyaoX8AMWSMm6emgCbGSLPymFeoMO6fsRfywBEuF5pRRVXeEpvB-DicKrvQybiyFRKCVkfgE6TTVgJuTfpZIAUu-DJO8jYk9YPoO2G2AooUdUu_sfvtDKqZqcGy7Md0pHeOLM1axXddxEfEb-N9O09U9F5RGGbjp9MN70KssypbBJqg#c320158172864907914


On Nov 5, 6:44 am, Felipe Teixeira <txdot...@gmail.com> wrote:
> Whenever you use a control that is visible to the code behind (by setting *
> runat=server*), the IDs of its child server controls will change. to keep
> track of it you should refer to a control by its ClientID.
>
> http://msdn.microsoft.com/en-us/library/system.web.ui.control.clienti...http://msdn.microsoft.com/en-us/library/3hc29e2a.aspx
>
> Hope it helps.
>
> Felipe Teixeira
> Microsoft Certified Technology Specialist - MCTS - Microsoft .Net Framework
> 2.0
> Application Development Foundation MS
> Web -based Client Development
> Mobile: +55 (11) 8021-6457
> txdot...@googlewave.comhttp://iguessimnotcrazy.wordpress.com/
>
> 2009/11/5 Paulo Roberto Pellucci <paulo.pellu...@gmail.com>
>
>
>
> > Ana, is that div really necessary then? I can't see no point on still
> > having it if its causing the problem.
>
> > If you really have to use it, well then, we will try to fix the problem.
> > On Thu, Nov 5, 2009 at 6:30 AM, Processor Devil <processor.de...@gmail.com
> > > wrote:
>
> >> Your div has an ID, maybe try to look for your fields though that.
>
> >> 2009/11/4 Ana <drumond.anaclau...@gmail.com>
> > Paulo Roberto S. Pellucci- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages