I am getting strange error with update panel. Basically I use a lot of usercontrols so please be paitient with me. I am using a script manager in the Masterpage, then I added a usercontrol(usercontrol 1) to Master page which has couple of usercontrols*(
2 and 3) embedded inside usercontrol 1. Usercontrol 2 has a datagrid which displays some data and usercontrol 3 has a repeater which displays data. Now, here I am using update panel for usercontrol 2 and 3 and it works fine for me. I mean when I click the
retrieve button in usercontrol 2 it updates the usercontrol2 and displays the data. Same thing happens with usercontrol 3. Now If I use update panel in any of the pages, I am getting a problem. When I click retrieve button in any pages it works fine, but when
I click the retrieve button in any of the user control which is on the Master Page, then I am getting Processing... Image on the page also, where as It should display the processing Image only on usercontrol. If you need the code please tell me, I will post
the code.
PLease correct me if I am wrong but as far as I can preceive from what you have mentioned in your post is that you actually want to confine update progress image inside the user control only not on the complete page . If this is the case then you have to
do some hard work in client side :-
1.) First of all handle the beginRequest() and endRequest() events which are fired during asynchronous postback.
2.) get the id of the postback element , so that you can check which control actually caused the postback .
3.) And then based on control decide where you want to display update progress control .
4.) For displaying update progress control specifically on a given control you should know the position of that control on page and based on that position your update progress image over that control .
correct me if i am wrong.. You have a master page and in which you have a update panel with usercontrol 2 and 3 it works fine. But when u add other controls to the same update panel it fails to work?
The problem is with the pages that are inherited from master page. Masterpage usercontrols are different, I am using another new usercontrol in the page that is inherited from masterpage. Now, if I click the Retrieve button on the master page, I am getting
the loading Image for the page also, where as the image should be displayed only in the Master page updatepanel.
This is the code that I am using. I am posting just the partial code.
Master Page Code:
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
---I am registering the usercontrol here
<div id="leftNavdiv" style="DISPLAY: none">
<asp:UpdatePanel ID="upLeftNav" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<uc1:uc ID="LeftNavigation" runat="server"></uc1:uc>
</ContentTemplate>
</asp:UpdatePanel>
</div>
Code in LeftNavigation Usercontrol:
---Here I am registering these two user controls
<p>
<uc1:safety id="Safety_" runat="server"></uc1:safety>
<uc1:quality id="Quality_" runat="server"></uc1:quality><BR>
</p>
Code in user_control safety:
<div>
<uc:caldr ID="dtCal" runat="server" /> </div>
<asp:UpdatePanel ID="updtPnl" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:ImageButton ID="btnRtrvSafety" runat="server" CssClass="font" OnClick="btnRtrvSafety_Click" ImageUrl="~/images/arrowimg.gif" /></div>
<asp:repeater id="Repeater1" Runat="server">
<ItemTemplate>
----- Binding the data here
</ItemTemplate>
</asp:repeater>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div>
<asp:UpdateProgress ID="updtPrgs" AssociatedUpdatePanelID="updtPnl" runat="server" DisplayAfter="300">
<ProgressTemplate>
<span style="color: navy"><img alt="RetrievingData" class="content1Main" style="background-color:Navy" src="images/ajax-loader.gif"/></span>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
Code in user_control Quality:
<uc:caldr ID="dateCal" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:ImageButton ID="btnRrvQulty" runat="server" CssClass="font" ImageUrl="~/images/arrowimg.gif" />
<br/>
<asp:Label id="Label1" Font-Size="10px" Font-Names="verdana" runat="server" ForeColor="Navy"
Font-Bold="True">Testing</asp:Label>
<asp:DataGrid BORDER="0" id="dgd" runat="server" AutoGenerateColumns="False" Font-Names="verdana"
Font-Size="10px" Width="100%">
</asp:DataGrid>
</ContentTemplate>
</asp:UpdatePanel>
<div>
<asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server" DisplayAfter="300">
<ProgressTemplate>
<span style="color: navy"><img alt="RetrievingData" class="content1Main" style="background-color:Navy" src="images/ajax-loader.gif"/></span>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
Now the above code goes in to the left side of the Master page.
This is the code for the page that I am using Test.aspx
<asp:UpdatePanel ID="updtPnlQuality" runat="server">
<ContentTemplate>
<uc1:User_controlQua id="QuaDetails1" runat="server"></uc1:User_controlQua>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnRetrieve"/>
</Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="updtPnlQuality" runat="server" DisplayAfter="300">
<ProgressTemplate>
<div id="divImage" style="display:none">
<asp:Image ID="img1" runat="server" ImageUrl="~/images/progress.gif" />
Processing...
</div>
</ProgressTemplate>
</asp:UpdateProgress>
Ok, Now I am getting error with the page.
As I mentioned, when I clicke the retrieve button on the left side of the master page, I am getting loading image even on the aspx page. where as when i click the retrieve button on the page, it works fine there, I mean I am getting the image just on the
page and not on the user control which is on the masterpage.
The problem is with the pages that are inherited from master page.
I am little confused with the word inherited.. Are you deriving the other pages from the Master page or you are incorporating the master page..
My understanding is this. You have a page that includes a master page and master page has usercontrol with update progress. and the content page has update panel with update progress so when you click on the user control on the master page you get the loadin
image on conternt page too? but when you click on the content page it works fine.
kk18_b
Member
33 Points
25 Posts
Update Panel Bug..
Nov 18, 2008 08:11 PM|LINK
I am getting strange error with update panel. Basically I use a lot of usercontrols so please be paitient with me. I am using a script manager in the Masterpage, then I added a usercontrol(usercontrol 1) to Master page which has couple of usercontrols*( 2 and 3) embedded inside usercontrol 1. Usercontrol 2 has a datagrid which displays some data and usercontrol 3 has a repeater which displays data. Now, here I am using update panel for usercontrol 2 and 3 and it works fine for me. I mean when I click the retrieve button in usercontrol 2 it updates the usercontrol2 and displays the data. Same thing happens with usercontrol 3. Now If I use update panel in any of the pages, I am getting a problem. When I click retrieve button in any pages it works fine, but when I click the retrieve button in any of the user control which is on the Master Page, then I am getting Processing... Image on the page also, where as It should display the processing Image only on usercontrol. If you need the code please tell me, I will post the code.
vadambaibala
Member
192 Points
91 Posts
Re: Update Panel Bug..
Nov 18, 2008 09:28 PM|LINK
Please check u have given this
UpdateMode
="Conditional"on the updatepanel tag.. Sometimes this will screw things up..
Thanks
kk18_b
Member
33 Points
25 Posts
Re: Update Panel Bug..
Nov 19, 2008 02:45 AM|LINK
Hello vadambaibala
I tried that.. That doesnt work here
Pawan_Mishra
Star
8869 Points
1293 Posts
Re: Update Panel Bug..
Nov 19, 2008 03:24 AM|LINK
Hello
PLease correct me if I am wrong but as far as I can preceive from what you have mentioned in your post is that you actually want to confine update progress image inside the user control only not on the complete page . If this is the case then you have to do some hard work in client side :-
1.) First of all handle the beginRequest() and endRequest() events which are fired during asynchronous postback.
2.) get the id of the postback element , so that you can check which control actually caused the postback .
3.) And then based on control decide where you want to display update progress control .
4.) For displaying update progress control specifically on a given control you should know the position of that control on page and based on that position your update progress image over that control .
For a more detailed look on positioning of update progress control check out this blog:- http://davidhayden.com/blog/dave/archive/2007/11/30/ASPNETAJAXPageRequestManagerbeginRequestendRequestEventsUpdateProgress.aspx
Pawan Mishra
Moving from Asp.Net to WPF and SilverLight .....
.Net 360°
kk18_b
Member
33 Points
25 Posts
Re: Update Panel Bug..
Nov 19, 2008 06:59 PM|LINK
Hello Pawan,
That looks like totally different way without update panel, I have to do it with the update panel. If you have any other way can you please post it?
Thanks
kk
vadambaibala
Member
192 Points
91 Posts
Re: Update Panel Bug..
Nov 19, 2008 07:45 PM|LINK
correct me if i am wrong.. You have a master page and in which you have a update panel with usercontrol 2 and 3 it works fine. But when u add other controls to the same update panel it fails to work?
kk18_b
Member
33 Points
25 Posts
Re: Update Panel Bug..
Nov 19, 2008 08:20 PM|LINK
Hello vadambaibala,
The problem is with the pages that are inherited from master page. Masterpage usercontrols are different, I am using another new usercontrol in the page that is inherited from masterpage. Now, if I click the Retrieve button on the master page, I am getting the loading Image for the page also, where as the image should be displayed only in the Master page updatepanel.
This is the code that I am using. I am posting just the partial code.
Master Page Code: <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %> ---I am registering the usercontrol here <div id="leftNavdiv" style="DISPLAY: none"> <asp:UpdatePanel ID="upLeftNav" runat="server" UpdateMode="Conditional"> <ContentTemplate> <uc1:uc ID="LeftNavigation" runat="server"></uc1:uc> </ContentTemplate> </asp:UpdatePanel> </div> Code in LeftNavigation Usercontrol: ---Here I am registering these two user controls <p> <uc1:safety id="Safety_" runat="server"></uc1:safety> <uc1:quality id="Quality_" runat="server"></uc1:quality><BR> </p> Code in user_control safety: <div> <uc:caldr ID="dtCal" runat="server" /> </div> <asp:UpdatePanel ID="updtPnl" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:ImageButton ID="btnRtrvSafety" runat="server" CssClass="font" OnClick="btnRtrvSafety_Click" ImageUrl="~/images/arrowimg.gif" /></div> <asp:repeater id="Repeater1" Runat="server"> <ItemTemplate> ----- Binding the data here </ItemTemplate> </asp:repeater> </ContentTemplate> </asp:UpdatePanel> </div> <div> <asp:UpdateProgress ID="updtPrgs" AssociatedUpdatePanelID="updtPnl" runat="server" DisplayAfter="300"> <ProgressTemplate> <span style="color: navy"><img alt="RetrievingData" class="content1Main" style="background-color:Navy" src="images/ajax-loader.gif"/></span> </ProgressTemplate> </asp:UpdateProgress> </div> Code in user_control Quality: <uc:caldr ID="dateCal" runat="server" /> <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:ImageButton ID="btnRrvQulty" runat="server" CssClass="font" ImageUrl="~/images/arrowimg.gif" /> <br/> <asp:Label id="Label1" Font-Size="10px" Font-Names="verdana" runat="server" ForeColor="Navy" Font-Bold="True">Testing</asp:Label> <asp:DataGrid BORDER="0" id="dgd" runat="server" AutoGenerateColumns="False" Font-Names="verdana" Font-Size="10px" Width="100%"> </asp:DataGrid> </ContentTemplate> </asp:UpdatePanel> <div> <asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="UpdatePanel1" runat="server" DisplayAfter="300"> <ProgressTemplate> <span style="color: navy"><img alt="RetrievingData" class="content1Main" style="background-color:Navy" src="images/ajax-loader.gif"/></span> </ProgressTemplate> </asp:UpdateProgress> </div> Now the above code goes in to the left side of the Master page. This is the code for the page that I am using Test.aspx <asp:UpdatePanel ID="updtPnlQuality" runat="server"> <ContentTemplate> <uc1:User_controlQua id="QuaDetails1" runat="server"></uc1:User_controlQua> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnRetrieve"/> </Triggers> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" AssociatedUpdatePanelID="updtPnlQuality" runat="server" DisplayAfter="300"> <ProgressTemplate> <div id="divImage" style="display:none"> <asp:Image ID="img1" runat="server" ImageUrl="~/images/progress.gif" /> Processing... </div> </ProgressTemplate> </asp:UpdateProgress>
Ok, Now I am getting error with the page.As I mentioned, when I clicke the retrieve button on the left side of the master page, I am getting loading image even on the aspx page. where as when i click the retrieve button on the page, it works fine there, I mean I am getting the image just on the page and not on the user control which is on the masterpage.
If you need more explanation please contact me.
Thanks
kk
kk18_b
Member
33 Points
25 Posts
Re: Update Panel Bug..
Nov 24, 2008 12:34 PM|LINK
I am still having problem with the update panel which is posted above. Can some one help?
kk18_b
Member
33 Points
25 Posts
Re: Update Panel Error
Nov 25, 2008 12:33 PM|LINK
Can some one help with Update Panel Error?
vadambaibala
Member
192 Points
91 Posts
Re: Update Panel Bug..
Nov 25, 2008 02:47 PM|LINK
I am little confused with the word inherited.. Are you deriving the other pages from the Master page or you are incorporating the master page..
My understanding is this. You have a page that includes a master page and master page has usercontrol with update progress. and the content page has update panel with update progress so when you click on the user control on the master page you get the loadin image on conternt page too? but when you click on the content page it works fine.
Am i right?