Enrique Bravo Enrique Bravo - 1 month ago 19
Ajax Question

ASP Panel not showing after click

So, I have a list on the side and each of those supposedly are showing and displaying a panel when clicked on. But the last module I programmed just kinda refresh the page but does nothing, doesnt show the panel but all of the others are showing the panel without issues.

Heres a little bit of the section of the code.

<tr id="trShare">
<td>
<asp:Image ID="imgShare" runat="server" ImageUrl ="Images/share.png" width="22px" height="22px" />
</td>
<td align="left" valign="middle">
<asp:LinkButton ID="lnkShare" runat="server" Text="Share..." ></asp:LinkButton>
</td>
</tr>

<tr id="trEmail">
<td>
<asp:Image ID="Image1" runat="server" ImageUrl ="Images/share.png" width="22px" height="22px" />
</td>
<td align="left" valign="middle">
<asp:LinkButton ID="lnkEmail" runat="server" Text="Email Contact" ></asp:LinkButton>
</td>
</tr>
<asp:Panel ID="panelShare" runat="server" CssClass="modalPopUp">
<h2>Share this applicant</h2>
<hr />
<blockquote>
<p>An email will be sent with a link to this page. Please add a valid username. Only @asf.edu.mx are allowed.</p>
<p> <asp:TextBox ID="txtShareWith" runat="server" Width="120px"></asp:TextBox>@asf.edu.mx </p>
<br /><br /><br /><br />
<div style="text-align:right;">
<asp:Button ID="btnCancelShare" runat="server" Text="Cancel" CausesValidation="false" />
&nbsp;&nbsp;&nbsp;
<asp:Button ID="btnShare" runat="server" Text="Share" CausesValidation="false" OnClick="btnShare_Click" />
</div>
</blockquote>
</asp:Panel>
<asp:Panel ID="panelEmail" runat="server" CssClass="modalPopUp">
<h2>Share this applicant</h2>
<hr />
<blockquote>
<p>An email will be sent with a link to this page. Please add a valid username. Only @asf.edu.mx are allowed.</p>
<p> <asp:TextBox ID="TextBox1" runat="server" Width="120px"></asp:TextBox>@asf.edu.mx </p>
<br /><br /><br /><br />
<div style="text-align:right;">
<asp:Button ID="Button1" runat="server" Text="Cancel" CausesValidation="false" />
&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button2" runat="server" Text="Share" CausesValidation="false" />
</div>
</blockquote>
</asp:Panel>

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender4" runat="server"
PopupControlID="panelEmail"
TargetControlID="lnkEmail"
CancelControlID="btnCancelEmail"
BackgroundCssClass="modalBackGround"
DropShadow="true" ></ajaxToolkit:ModalPopupExtender>

<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
PopupControlID="panelShare"
TargetControlID="lnkShare"
CancelControlID="btnCancelShare"
BackgroundCssClass="modalBackGround"
DropShadow="true" ></ajaxToolkit:ModalPopupExtender>


The Email section is the one that is not showing....at all.

Answer

I think I found the problem. The button btnCancelEmail does not exist inside Panel panelEmail.

Change

<asp:Button  ID="Button1" runat="server" Text="Cancel" CausesValidation="false" />

Into

<asp:Button  ID="btnCancelEmail" runat="server" Text="Cancel" />
Comments