Dear all...
I have two update pannel in my page. And both have some controlls and its update progress controll. I have given the updatemode property to conditional for both update pannels. Al also i have assigned the triggers properly. The problem i am facing now is..
We can refer as follows
First update pannel as - [A] and Seccond update pannel as - [B]
I want to update the [B] when i am clicking on a button which resides in [A] , But when i am clicking on the button its refreshing both. And also its showing both updateprogress ..
Thank you very much
hi,
I think both progress bar will be showing because you might not assign associateupdatepanelid in updateprogress.
If u assign this could it will possible for you share your code.
hello.
well, take a look at the childrenastriggers property of the updatepanel control. if you set it to false, your button won't refresh that panel. the problem is that if you have other controls that need to refresh their "parent" panel, then you'll need to register those controls as async postback controls (scriptmanager.registerasyncpostbakcontrol) and refresh the panel during a partial postback started by one of those controls (by calling the update method).
I have asisgned associateupdatepanelid in both updateprogress and also I marked childrenastriggers = false. Still its happening.
hello again.
can you build a really simple page that reproduces this problem and post it here?
I have made almost a same sample... In this sample app also i am facing the same problem...
-----The HTML Part
=================================================================================
<body>
<formid="form1"runat="server">
<asp:ScriptManagerID="ScriptManager1"runat="server"/>
<divstyle="width: 359px; height: 274px">
<asp:UpdatePanelID="UpdatePanel1"runat="server"ChildrenAsTriggers="False"UpdateMode="Conditional">
<ContentTemplate>
<divstyle="width: 315px; height: 185px; background-color: inactivecaptiontext">
<br/>
<asp:ButtonID="butRefresh1"runat="server"Height="36px"Text="To Refresh the update panel 1"Width="203px"OnClick="butRefresh1_Click"/>
<br/>
<br/>
<asp:TextBoxID="text1"runat="server"></asp:TextBox><br/>
<br/>
<asp:ButtonID="Button2"runat="server"Height="31px"Text="To refresh the update panel 2"
Width="200px"OnClick="Button2_Click"/> <br/>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTriggerControlID="butRefresh1"EventName="Click"/>
</Triggers>
</asp:UpdatePanel>
<asp:UpdateProgressID="UpdateProgress1"runat="server"AssociatedUpdatePanelID="UpdatePanel1"DisplayAfter="10">
<ProgressTemplate>
Loading ....
</ProgressTemplate>
</asp:UpdateProgress>
</div><br/><br/><div>
<divstyle="width: 582px; height: 229px">
<asp:UpdatePanelID="UpdatePanel2"runat="server"ChildrenAsTriggers="False"UpdateMode="Conditional">
<ContentTemplate>
<divstyle="width: 521px; height: 115px; background-color: lightgoldenrodyellow">
<br/>
<asp:TextBoxID="text2"runat="server"Height="23px"Width="313px"></asp:TextBox>
<br/>
<br/>
<asp:UpdateProgressID="UpdateProgress2"runat="server"DisplayAfter="10">
<ProgressTemplate>
<divstyle="width: 368px; height: 100px; background-color: #ffccff">
<asp:LabelID="Label1"runat="server"Font-Bold="True"Font-Italic="False"Font-Size="X-Large"
Font-Underline="True"Height="75px"Text="Loading ...."Width="325px"></asp:Label></div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTriggerControlID="Button2"EventName="Click"/>
</Triggers>
</asp:UpdatePanel></div></div></form></body>
=================================================================================
VB.NET Source code...
=================================================================================
ProtectedSub butRefresh1_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)Dim iAs Int32
For i = 1To 10000000text1.Text ="Pannel1 refreshed ..."
Next
EndSub
ProtectedSub Button2_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)Dim iAs Int32
For i = 1To 10000000text2.Text ="Pannel2 refreshed ..."
Next
EndSub
=================================================================================
I hope youi will try your level best for me to getrid of from this problem...
Thank you
hello.
well, you're getting refresh because you've also set up the buttons as triggers. this will force a postback. I'm putting here a very simple example of how you can refresh the panel through code:
<%@. Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void c(object sender, EventArgs e)
{
panel.Update();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:scriptmanager runat="server" id="manager" />
<asp:Updatepanel runat="server" id="panel" UpdateMode="conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<asp:Button runat="server" ID="bt" Text="refresh" OnClick="c" /><br />
<asp:Button runat="server" ID="Button1" Text="don't refresh" /><br />
<%=DateTime.Now.ToString() %>
</ContentTemplate>
</asp:Updatepanel>
<%=DateTime.Now.ToString() %>
</form>
</body>
</html>
No comments:
Post a Comment