Reputation: 949
I am hari krishna. I am developing an application in asp.net. In this I have to add customer details in one div and adding their address and contacts by using the popups. So while adding the address pop up my save button click event is firing and it is working fine. But when I am clicking on Save in Contact Pop up then the popup is closing and no action is performing just my pop up is closing. When I observe the URL the link is added with the control id's in my popup control like this
The following is my code. Could you please check the code and let me know where I am missing and I am struck here from 1 week.
<!--Popup Start for Address-->
<asp:HiddenField ID="hdn_Address" runat="server" />
<ajaxToolkit:ModalPopupExtender ID="mdl_pop_Address" runat="server" TargetControlID="hdn_Address"
PopupControlID="pnl_Address" Drag="false" BackgroundCssClass="modalBackground">
</ajaxToolkit:ModalPopupExtender>
<asp:UpdatePanel ID="uppnl_Pop_Address" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="pnl_Address" runat="server" Style="display: none;">
<%--<div class="modal fade" id="addresstable" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">--%>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h3 class="modal-title" id="lineModalLabel">Address</h3>
</div>
<div class="modal-body">
<!-- content goes here -->
<div class="row">
<div class="col-md-12">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Address Number :</label>
<div class="col-sm-9">
<asp:TextBox ID="txtAddressNum" runat="server" CssClass="form-control" placeholder="Customer Name"></asp:TextBox>
<%--<input type="text" placeholder="Customer Name" class="form-control" />--%>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Address type:</label>
<div class="col-sm-9">
<asp:DropDownList runat="server" ID="ddlAddressType" CssClass="form-control">
<asp:ListItem Value="Billing">Billing</asp:ListItem>
<asp:ListItem Value="Service">Service</asp:ListItem>
<asp:ListItem Value="Contact">Contact</asp:ListItem>
</asp:DropDownList>
<%--<select name="address" id="address" class="form-control">
<option value="">Billing</option>
<option value="" selected="">Service</option>
</select>--%>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Address Line 1:</label>
<div class="col-sm-9">
<asp:TextBox ID="txtAddressLine1" runat="server" CssClass="form-control" placeholder="Address Line 1"></asp:TextBox>
<%--<input type="text" placeholder="Address Line 1" class="form-control" />--%>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Address Line 2:</label>
<div class="col-sm-9">
<asp:TextBox ID="txtAddressLine2" runat="server" CssClass="form-control" placeholder="Address Line 2"></asp:TextBox>
<%--<input type="text" placeholder="Address Line 2" class="form-control" />--%>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">City:</label>
<div class="col-sm-9">
<asp:TextBox ID="txtCity" runat="server" CssClass="form-control" placeholder="City"></asp:TextBox>
<%--<input type="text" placeholder="City" class="form-control" />--%>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">State:</label>
<div class="col-sm-5">
<select name="bill_state" runat="server" id="bill_state" onchange="bill_state_changed(this);" class="form-control">
<option value="AN">Andaman and Nicobar Islands (AN)</option>
<option value="AP" selected="">Andhra Pradesh (AP)</option>
<option value="AR">Arunachal Pradesh (AR)</option>
<option value="UL">Uttaranchal (UL)</option>
<option value="WB">West Bengal (WB)</option>
</select>
</div>
<label class="col-sm-2 control-label" for="textinput">Zip code :</label>
<div class="col-sm-2">
<asp:TextBox ID="txt_Zip" runat="server" CssClass="form-control" placeholder="Zip"></asp:TextBox>
<%--<input type="text" placeholder="Post Code" class="form-control">--%>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Country</label>
<div class="col-sm-9">
<select name="bill_country" id="bill_country" runat="server" onchange="bill_country_changed(this); " class="form-control">
<option value="IN" selected="">India (IN) </option>
<option value="AN">(AN) </option>
<option value="FX">(FX) </option>
<option value="CS">(CS) </option>
<option value="ZW">Zimbabwe (ZW) </option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Is Primary:</label>
<div class="col-sm-9">
<asp:CheckBox ID="chk_Is_Primary_Address" runat="server" />
<%--<input type="checkbox" style="margin-top: 12px;" checked="">--%>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="pull-right">
<asp:Button ID="btn_Save_Address" runat="server" OnClick="btn_Save_Address_Click" CssClass="btn btn-primary" Text="Save" />
<asp:Button ID="btn_Cancel_Save_Address" runat="server" OnClick="btn_Cancel_Save_Address_Click" CssClass="btn btn-default" Text="Cancel" />
<%--<button type="submit" class="btn btn-default">Cancel</button>
<button type="submit" class="btn btn-primary">Save</button>--%>
</div>
</div>
</div>
</form>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
</div>
</div>
</div>
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btn_Save_Address" />
</Triggers>
</asp:UpdatePanel>
<!--Popup End for Address-->
<!--Popup Start for Contacts-->
<asp:HiddenField ID="hdn_Contact" runat="server" />
<ajaxToolkit:ModalPopupExtender ID="mdl_pop_Save_Contact" runat="server" TargetControlID="hdn_Contact"
PopupControlID="pnl_Contact" Drag="false" BackgroundCssClass="modalBackground">
</ajaxToolkit:ModalPopupExtender>
<asp:UpdatePanel ID="uppnl_Save_Contact" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="pnl_Contact" runat="server" Style="display: none;">
<%--<div class="modal fade" id="addresstable" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true">--%>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h3 class="modal-title" id="H1">Contacts</h3>
</div>
<div class="modal-body">
<!-- content goes here -->
<div class="row">
<div class="col-md-12">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Customer Name:</label>
<div class="col-sm-9">
<input type="text" placeholder="Customer Name" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Contact type:</label>
<div class="col-sm-9">
<select name="" id="" class="form-control">
<option value="">Billing</option>
<option value="" selected="">Service</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Mobile:</label>
<div class="col-sm-9">
<input type="text" placeholder="Mobile Number" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Landline:</label>
<div class="col-sm-9">
<input type="text" placeholder="Landline Number" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Email:</label>
<div class="col-sm-9">
<input type="email" placeholder="Email" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label" for="textinput">Is Primary:</label>
<div class="col-sm-9">
<input type="checkbox" style="margin-top: 12px;" checked="">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="pull-right">
<asp:Button ID="btn_SaveContact" runat="server" OnClick="btn_SaveContact_Click" CssClass="btn btn-primary" Text="Save" />
<asp:Button ID="btn_Cancel_Save_Contact" runat="server" OnClick="btn_Cancel_Save_Contact_Click" CssClass="btn btn-default" Text="Cancel" />
<%-- <button type="submit" class="btn btn-default">Cancel</button>
<button type="submit" class="btn btn-primary">Save</button>--%>
</div>
</div>
</div>
</form>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
</div>
</div>
</div>
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btn_SaveContact" />
</Triggers>
</asp:UpdatePanel>
<!--Popup End for Contacts-->
Upvotes: 0
Views: 469
Reputation: 564
You can start by making sure you have wired up an event in your code for the "btn_SaveContact_Click" and "btn_Cancel_Save_Contact_Click" by dropping some breakpoints in the code and running in debug mode. Hope it helps.
Upvotes: 2