Hi. I have a problem.
I want to dynamically alter the contents of a modal popup before it is displayed. This is what I have so far:
*I have set the targetcontrolID of the popup extender to a hidden button
*I have a different button that when the user presses, alters the values of fields within the modalpopup panel. This all works
*This is the wierd bit- as soon as i put modalpopupextender1.show() into the sub that handles the button click then EVERY button on the page does not fire.
I have put breakpoints in and this has confirmed that the button.click events are not firing! I have been on at this for over 2 days now. Please help! I have included the sub that handles the button click
Protected Sub btnnewtask_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNewTask.Click
ddlConsortia.Enabled = True
ddlPractice.Enabled =
True
hdnTaskID.Value =
"0"
txtPracticeLead.Text =
"Practice User"
ModalPopupExtender1.Show()
End Sub
.aspx:
<asp:UpdatePanel ID="UpdatePanel5" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="pnlAssign"
TargetControlID="btndummy" BackgroundCssClass="modalBackground" DropShadow="true"
CancelControlID="btnCancelTask" />
<asp:Button ID="btnDummy" runat="server" Text="Button" style="display:none" />
<asp:Panel ID="pnlAssign" runat="server" Visible="true" CssClass="modalPopup">
Assign Objective
<br />
<br />
<table>
<tr>
<td align="right">
Consortia
</td>
<td align="left">
<asp:UpdatePanel ID="UpdatePanel8" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlConsortia" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2"
DataTextField="consortia" DataValueField="consortia" Enabled="False">
</asp:DropDownList><asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:INFONET_DATAConnectionString %>"
SelectCommand="select consortia from dbo.InfoNet_LookUpConsortia where purchpct='5kg' and priority = 2 ">
</asp:SqlDataSource>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnNewTask" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td align="right">
Practice
</td>
<td align="left">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="ddlPractice" runat="server" DataSourceID="SqlDataSource3" DataTextField="practicename"
DataValueField="practicecode">
</asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:INFONET_DATAConnectionString %>"
SelectCommand="select practicename, practicecode from InfoNet_LookUpPractice where consortia= @consortia">
<SelectParameters>
<asp:ControlParameter ControlID="ddlConsortia" Name="consortia" PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>
</td>
</tr>
<tr>
<td align="right">
Practice lead
</td>
<td align="left">
<asp:UpdatePanel ID="UpdatePanel9" runat="server">
<ContentTemplate>
<asp:TextBox ID="txtPracticeLead" runat="server"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
<span style="color: Red;">
<asp:RequiredFieldValidator ID="vldpracticelead" runat="server" ControlToValidate="txtpracticelead"
ErrorMessage="Practice lead is a required field" ForeColor="#6E90BD" Display="dynamic"></asp:RequiredFieldValidator>
<cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" TargetControlID="vldpracticelead"
HighlightCssClass="invalidControl">
</cc1:ValidatorCalloutExtender>
</span>
</td>
</tr>
....quite a large form.....
</
table>
<br />
<asp:Button ID="btnOKTask" runat="server" Text="OK" />
<asp:Button ID="btnCancelTask" runat="server" Text="Cancel" />
<asp:UpdatePanel ID="UpdatePanel7" runat="server">
<ContentTemplate>
<asp:HiddenField ID="hdnTaskID" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<br />
<br />
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnnewtask" />
<asp:AsyncPostBackTrigger ControlID="btnoktask" />
<asp:AsyncPostBackTrigger ControlID="btncanceltask" />
</Triggers>
</asp:UpdatePanel>
any help would be great!