0
votes

I have created a user control in asp.net which contains a form and a button which saves the data. So when the popup loads the user control is inside. I click on the button to save the form data and the click event is not fired?

this is a jquery popup below with the user control inside.

<div id="dialog_form"  title="Create new user">
   <uc1:SettingsPopUp runat="server"  />
</div>

here is the user control

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SettingsPopUp.ascx.cs" Inherits="FRDashboard.Content.Dashboards.SettingsPopUp" %>
<link href="../../Styles/styles.css" rel="stylesheet" />
<link rel="Stylesheet" href="../../Styles/bootstrap.css" type="text/css"/>



<div id="divChartSettings" runat="server">
 <asp:UpdatePanel ID="upd_chart_settings" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
//FORM ELEMENTS GO HERE
     <asp:Button ID="applySettings" runat="server" OnCommand="applyChartSettings_Click" EnableViewState="true" Text="Save" CssClass="button" />
      <asp:Label ID="lbl_message" runat="server"></asp:Label>
      </ContentTemplate>
 </asp:UpdatePanel>
</div>
2
where is the code for the user control? - Rufus L
Added user control code - Chris

2 Answers

0
votes

Change your aspx page,

<uc1:SettingsPopUp runat="server" /> to

<uc1:SettingsPopUp runat="server"  ClientIDMode="AutoID"/>

Because you are using the button control inside an asp:UpdatePanel.

0
votes

Fixed the problem. The user control was in a JQuery UI popup which was stopping the postback. The following fixed the problem:

 dialog.parent().appendTo(jQuery("form:first"));