Trigger's updatepanel in a another updatepanel - asp.net

I've two updatePanel :
the first :
<asp:Panel ID="pnlConso" runat="server" Height="500px" ScrollBars="Auto">
<asp:UpdatePanel ID="upConsommateur" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="tbLogin" EventName="TextChanged" />
<asp:AsyncPostBackTrigger ControlID="btnValiderAjout" EventName="Click" />
</Triggers>
<ContentTemplate>
...
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
and the second :
<asp:UpdatePanel ID="upAjoutConso" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="pnlAjoutConsommateur" runat="server" CssClass="invisible">
<table>
...
<tr>
<td>
<asp:Button ID="btnValiderAjout" runat="server" Text="Valider" CssClass="invisible" />
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
then my problem is when I click on the btnValiderAjout the first panel don't update.
I make this button such as a trigger for the first but it don't update ... What I'm doing wrong ?

Related

Update Panel and Script Manager not working in Cascading Dropdownlist in ASP.NET

I tried to populate dropdown city and area without page refresing. So i used in Updatepanel and Script Manager.The code is below
<asp:ScriptManager ID="script1" runat="server" EnablePartialRendering="true"></asp:ScriptManager>
<div class="form-list wow fadeInRight" data-wow-delay="0.5s">
<ul class="navmain">
<li>
<asp:UpdatePanel ID="upd1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<!--<asp:DropDownList ID="drp_city" runat="server" CssClass="drp" OnSelectedIndexChanged="drp_city_SelectedIndexChanged" AutoPostBack="true" ></asp:DropDownList>-->
<asp:DropDownList ID="drp_city1" runat="server" CssClass="drp" OnSelectedIndexChanged="drp_city_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
<asp:HiddenField ID="hfCustomerId" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</li>
<li>
<asp:UpdatePanel ID="upd2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="drp_area" runat="server" CssClass="drp" AutoPostBack="true"></asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="drp_city1" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
</li>
<li>
<asp:UpdatePanel ID="upd3" runat="server">
<ContentTemplate>
<asp:DropDownList ID="drp_cuisine" runat="server" CssClass="drp"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
</li>
</ul>
<asp:Button OnClick="btn_search1" runat="server" CssClass="btn_search" />
</div>
I can't find the error. Page is not refreshing but area dropdown is not populating.

modal popup extender not showing panel on button click

I'm trying to use a modal popup extender on my page so when I click a button, it must show a panel. Here is what I have:
<asp:UpdatePanel runat="server" ID="updPanel">
<ContentTemplate>
<ajaxToolkit:ModalPopupExtender ID="mpeEmailComplete" runat="server" TargetControlID="btnTesting"
PopupControlID="pnl" OkControlID="btnOk"
BackgroundCssClass="modalBackground">
</ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="pnl" runat="server" style="display:none;">
<asp:UpdatePanel ID="udp" runat="server">
<ContentTemplate>
<asp:Panel runat="server" ID="pnlEmailComplete" Visible="false">
<asp:Label runat="server" ID="lblTest" Text="Testing testing testing"></asp:Label>
<asp:Button runat="server" ID="btnOk" Text="OK" />
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<asp:Button runat="server" ID="btnTesting" Text="Testing"/>
</ContentTemplate>
</asp:UpdatePanel>
but i can't get the panel to popup when the button is clicked. Anybody know why?
Your innermost panel has Visible=false.
<asp:Panel runat="server" ID="pnlEmailComplete" Visible="false"> *(change here)*
So, when you press the TESTING button, the ModalPopupExtender correctly causes the outer panel to display, but it's displaying an invisible inner panel, hence you see nothing on screen.
<asp:Panel ID="pnl" runat="server" style="display:none;"> *(this is ok)*
To fix, just yank the Visible=false from the outer panel (pnlEmailComplete)
Hope that helps!
Do you have any JavaScript errors and is pnl.Visible=False; set on the server-side anywhere?
Make sure you have the AjaxControlToolkit referenced properly, NuGet is the easiest way to add the reference.
http://nuget.org/packages/ajaxcontroltoolkit
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Btnshow" runat="server" Text="Show" OnClick="Btnshow_Click" />
<asp:Button ID="BtnTarget" runat="server" Text="Target" Style="display: none" />
<asp:TextBox ID="TextBox1" runat="server">
</asp:TextBox>
<input type="button" value="Get" onclick="abc()" />
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="BtnTarget"
PopupControlID="Panel1">
</asp:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server" BackColor="Black" Width="300px" Height="300px">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="BtnHide" runat="server" Text="Hide Button" OnClick="BtnHide_Click" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="BtnHide" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Btnshow" EventName="Click" />
</Triggers>
</asp:UpdatePanel>

Trigger asp:UpdatePanel from button

I've got a table which i want to update with a button, the table is within a "li" tag, and the button is in another. Here's my code:
<li runat="server">
<asp:DropDownList ID="cYear" runat="server" Width="100%" Font-Size="Large">
<asp:ListItem>2011</asp:ListItem>
...
</asp:DropDownList>
<asp:DropDownList ID="cMonth" runat="server" Width="100%" Font-Size="Large">
<asp:ListItem>1</asp:ListItem>
...
</asp:DropDownList>
<asp:DropDownList ID="cDay" runat="server" Width="100%" Font-Size="Large">
<asp:ListItem>1</asp:ListItem>
...
</asp:DropDownList>
<asp:TextBox ID="cNum" runat="server"></asp:TextBox>
<asp:Button ID="cEvent" onclick="cEvent_Click" CausesValidation="false"/>
</li>
<li runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel id = "updatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cEvent"/>
</Triggers>
<ContentTemplate>
...
</ContentTemplate>
</asp:UpdatePanel>
</li>
The Site is in Hebew so just ignore the wired string, the button Id is cEvent, and i want it to update the updatePanel, but instead it just doing nothing....

2 asp:updatepanel and 2 asp:updateprogress controls

I'm using two asp:updatepanel and 2 asp:updateprogress for them. Update progress shows correctly when I never use AssociatedUpdatePanelID with them, but if I use AssociatedUpdatePanelID the Progress bar never shows.
<asp:UpdateProgress AssociatedUpdatePanelID="upMainPracticeCountry" runat="server" ID="UpdateProgress1">
<ProgressTemplate>
<img src="images/loading.gif" alt="loading..." /></ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="upMainPracticeCountry" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlMainPracticeCountry" EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<asp:DropDownList ID="ddlMainPracticeState" runat="server">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
and the other update panel is
<asp:UpdateProgress runat="server" ID="up2" AssociatedUpdatePanelID="upPostalCountry">
<ProgressTemplate>
<img src="images/loading.gif" alt="loading..." /></ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="upPostalCountry" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlPostalCountry" EventName="SelectedIndexChanged" />
</Triggers>
<ContentTemplate>
<asp:DropDownList ID="ddlPostalState" runat="server">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
Not exactly sure what's going in but can you try setting AutoPostback="true" for the dropdown lists in the update panels?
http://www.codeproject.com/KB/ajax/UpdateProgress.aspx

linkbutton doesn't work for updatepanel

I have set of link buttons outside update panel but when click any one of them they donot work at all , when i set the postbackUrl they make full postback
my source code:
<asp:Panel ID="pnl_viewImages" runat="server">
<asp:Label ID="lbl_viewImages" runat="server" style="texalign: left"
Text="view images :"></asp:Label>
<br />
<br />
<br />
<table cellpadding="0" cellspacing="0" style="width: 100%" class ="Alternating">
<tr>
<td colspan="5">
<asp:UpdatePanel ID="updatePnl_image" runat="server">
<ContentTemplate>
<asp:ListView ID="lv_showImages" runat="server">
<ItemTemplate>
<asp:Image ID="img_showNewsImage0" runat="server" Height="300px"
ImageUrl='<%# "RetreiveImage.ashx" %>' Width="413px" />
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="lbtn_first" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="lbtn_last" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="lbtn_next" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="lbtn_previous" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="lbtn_delete" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td>
<asp:LinkButton ID="lbtn_first" runat="server" onclick="lbtn_first_Click">first</asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="lbtn_previous" runat="server" onclick="lbtn_first_Click"><<</asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="lbtn_next" runat="server" onclick="lbtn_first_Click"
>>></asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="lbtn_last" runat="server" onclick="lbtn_first_Click">last</asp:LinkButton>
</td>
<td>
<asp:LinkButton ID="lbtn_delete" runat="server" onclick="lbtn_first_Click">delete</asp:LinkButton>
</td>
</tr>
</table>
<br />
i tried to remove the table but in vain it does not work also.
You need to put the LinkButtons in the UpdatePanel or put them in their own UpdatePanel.
You appear to be missing a ScriptManger defined before your update panel such as
<asp:ScriptManager ID="ScriptManager1" runat ="server"></asp:ScriptManager>
I think that is probably causing your problem.
Controls outside of the panel can invoke a partial postback.
Paul

Resources