I am building a site that uses Web Parts and Ajax. In each Web Part I have a user control that uses Ajax to update itself. All the user controls use Ajax. Everything works well until, I close one of the web parts.When I do this and click on any of the controls to do an update, I get an error Sys.InvalidOperationException: Could not find UpdatePanel with ID <name of the panel that contained the web part that I closed>. If it is being updated dynamically then it must be inside another update panel.
Since all the controls use Ajax, how can i overcome the fact that the script is looking for the controls found in another Web Part.
1.Try to take a look at this useful blog about Dragging and dropping ASP.NET 2.0 Web Parts in Firefox and Safari with ASP.NET AJAX -http://blogs.neudesic.com/blogs/david_barkol/archive/2006/11/07/631.aspx2.Try to read this thread - http://forums.asp.net/thread/1486784.aspx to get some ideas.
Here are some sample codes about using webParts in Ajax for your reference.
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="upPortal" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:WebPartManager ID="wpmPortal" runat="server">
</asp:WebPartManager>
<div class="wrapper">
<asp:CatalogZone ID="czPortal" runat="server">
</asp:CatalogZone>
</div>
<div class="wrapper">
<div id="wz1">
<asp:WebPartZone ID="WebPartZone2" runat="server" HeaderText="Column 1">
<ZoneTemplate>
<asp:Wizard ID="Wizard1" runat="server">
<WizardSteps>
<asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
</asp:WizardStep>
<asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
<%--<uc1:ThemeSelector ID="ThemeSelector1" runat="server" EnableTheming="True" />--%>
</ZoneTemplate>
</asp:WebPartZone>
</div>
<div id="wz2">
<asp:WebPartZone ID="WebPartZone3" runat="server" HeaderText="Column 2">
<ZoneTemplate>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="Black"
DayNameFormat="Shortest" Font-Names="Times New Roman" Font-Size="10pt" ForeColor="Black"
Height="220px" NextPrevFormat="FullMonth" TitleFormat="Month" Width="312px">
<SelectedDayStyle BackColor="#CC3333" ForeColor="White" />
<TodayDayStyle BackColor="#CCCC99" />
<SelectorStyle BackColor="#CCCCCC" Font-Bold="True" Font-Names="Verdana" Font-Size="8pt"
ForeColor="#333333" Width="1%" />
<DayStyle Width="14%" />
<OtherMonthDayStyle ForeColor="#999999" />
<NextPrevStyle Font-Size="8pt" ForeColor="White" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" ForeColor="#333333"
Height="10pt" />
<TitleStyle BackColor="Black" Font-Bold="True" Font-Size="13pt" ForeColor="White"
Height="14pt" Font-Names="Arial" />
</asp:Calendar>
</ZoneTemplate>
</asp:WebPartZone>
</div>
<div id="wz3">
<asp:WebPartZone ID="WebPartZone4" runat="server">
<ZoneTemplate>
<asp:Login ID="Login1" runat="server">
</asp:Login>
<asp:Login ID="Login2" runat="server">
</asp:Login>
</ZoneTemplate>
</asp:WebPartZone>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div
Can you send your website to my email:v-jicwan@.microsoft.com? I'd?like?to?test?it.
Hi Jasson,
Thanks for the information. I found the problem. Each of my user controls are inside an UpdatePanel tag. I had missed adding the attribute UpdateMode="Conditional". Once I added this attribute everything worked fine.
Thanks once again
Hi vinod,
I have the same problem. i have try your solution ...its working but it will referesh the page..
i want to work it without refereshing the page. is it possible.
waiting for your reply.
thanks in advance
vishnu
Hi vinod,
I have the same problem. i have try your solution ...its working but it will referesh the page..
i want to work it without refereshing the page. is it possible?.
please try to send sample code.
waiting for your reply.
thanks in advance
vishnu
No comments:
Post a Comment