TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kavita Pharde
NA
44
79.4k
2 Modal Popup Extender controls are not working on same page
Aug 14 2013 2:23 AM
hi,
i have two modal popup extender control of ajax on same page.
one is showing registration for student and another for institutes.
when i run webpage only first modal popup gets open
when i remove all validation controls from send modal popup extender it works but i want validation control on my page
can anyone help me?
thanks in advance
here is my .aspx code
<div id="div1" class="div1">
<asp:ImageButton runat="server" ImageUrl="Images/sef111.png" Style="margin-top: 10px;
margin-left: 5px" ID="OpenPopUp1" OnClick="OpenPopUp1_Click" />
<asp:Button ID="btnPopUp1" runat="server" Style="display: none" />
</div>
<div id="div2" class="div2">
<asp:ImageButton ID="OpenPopUp2" runat="server" ImageUrl="Images/scef1.png" Style="margin-top: 2px;"
OnClick="OpenPopUp2_Click1" />
<asp:Button ID="btnPopUp2" runat="server" Style="display: none" />
</div>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="modalBackground"
PopupControlID="Panel1" TargetControlID="btnPopUp1" CancelControlID="btnClose1">
</asp:ModalPopupExtender>
<asp:Panel runat="server" ID="Panel1" CssClass="modalPopup" align="center" Style="display: none">
<center>
<div>
<asp:Label ID="Label2" runat="server" Text="Fileds marked with * are mandatory"></asp:Label><br />
<br />
<table>
<tr>
<td>
<asp:DropDownList ID="drpCourses" runat="server">
</asp:DropDownList>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Field cannot be left blank"
SetFocusOnError="true" ControlToValidate="drpCourses" Text="*" ValidationGroup="grp1"
CssClass="ErrorMsg"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtName"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender2" runat="server" TargetControlID="txtName" WatermarkText="* Full Name ">
</asp:TextBoxWatermarkExtender>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Field cannot be left blank"
SetFocusOnError="true" ControlToValidate="txtName" Text="*" ValidationGroup="grp1"
CssClass="ErrorMsg"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtEmail"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender3" runat="server" TargetControlID="txtEmail" WatermarkText="* E-mail ID ">
</asp:TextBoxWatermarkExtender>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Field cannot be left blank"
SetFocusOnError="true" ControlToValidate="txtEmail" Text="*" ValidationGroup="grp1"
CssClass="ErrorMsg"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="txtEmail"
Text="*" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
runat="server" ValidationGroup="grp1" CssClass="ErrorMsg" SetFocusOnError="true"
ErrorMessage="Invalid Email" />
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" Text="+91" ReadOnly="true" Width="30px"></asp:TextBox>
<asp:TextBox runat="server" ID="txtMobile"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender4" runat="server" TargetControlID="txtMobile" WatermarkText="* Mobile number ">
</asp:TextBoxWatermarkExtender>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Field cannot be left blank"
SetFocusOnError="true" ControlToValidate="txtMobile" Text="*" ValidationGroup="grp1"
CssClass="ErrorMsg"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtCity"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender6" runat="server" TargetControlID="txtCity" WatermarkText="City ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtState"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender5" runat="server" TargetControlID="txtState" WatermarkText="State ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtComments" TextMode="MultiLine"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender7" runat="server" TargetControlID="txtComments" WatermarkText="Comments ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td colspan="2">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="grp1"
DisplayMode="BulletList" CssClass="ErrorMsg" />
</td>
</tr>
</table>
</div>
</center>
<asp:Button runat="server" ID="btnClose1" Text="Back" CssClass="btn_control" />
</asp:Panel>
<asp:ModalPopupExtender ID="ModalPopupExtender_2" runat="server" BackgroundCssClass="modalBackground"
PopupControlID="Panel2" TargetControlID="btnPopUp2" CancelControlID="btnClose2">
</asp:ModalPopupExtender>
<asp:Panel runat="server" ID="Panel2" CssClass="modalPopup" align="center" Style="display: none">
<center>
<div>
<asp:Label ID="Label1" runat="server" Text="Fileds marked with * are mandatory"></asp:Label><br />
<br />
<table>
<tr>
<td>
<asp:TextBox runat="server" ID="txtFullName"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender8" runat="server" TargetControlID="txtFullName" WatermarkText="* Full Name ">
</asp:TextBoxWatermarkExtender>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Field cannot be left blank"
SetFocusOnError="true" ControlToValidate="txtFullName" Text="*" ValidationGroup="grp2"
CssClass="ErrorMsg"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtEmailId"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender9" runat="server" TargetControlID="txtEmailId" WatermarkText="* E-mail ID ">
</asp:TextBoxWatermarkExtender>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Field cannot be left blank"
SetFocusOnError="true" ControlToValidate="txtEmailId" Text="*" ValidationGroup="grp2"
CssClass="ErrorMsg"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="regEmail" ControlToValidate="txtEmailId" Text="*"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" runat="server"
ValidationGroup="grp2" CssClass="ErrorMsg" SetFocusOnError="true" ErrorMessage="Invalid Email" />
</td>
</tr>
<tr>
<td>
<asp:TextBox ID="TextBox3" runat="server" Text="+91" ReadOnly="true" Width="30px"></asp:TextBox>
<asp:TextBox runat="server" ID="txtMobileNum"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender10" runat="server" TargetControlID="txtMobileNum"
WatermarkText="* Mobile number ">
</asp:TextBoxWatermarkExtender>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="Field cannot be left blank"
SetFocusOnError="true" ControlToValidate="txtMobileNum" Text="*" ValidationGroup="grp2"
CssClass="ErrorMsg"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtCityName"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender11" runat="server" TargetControlID="txtCityName"
WatermarkText="City ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtStateName"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender12" runat="server" TargetControlID="txtStateName"
WatermarkText="State ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtPin"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender14" runat="server" TargetControlID="txtPin" WatermarkText="Pin Code ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td>
<asp:TextBox runat="server" ID="txtComment" TextMode="MultiLine"></asp:TextBox><asp:TextBoxWatermarkExtender
ID="TextBoxWatermarkExtender13" runat="server" TargetControlID="txtComment" WatermarkText="Comments ">
</asp:TextBoxWatermarkExtender>
</td>
</tr>
<tr>
<td colspan="2">
<asp:ValidationSummary ID="ValidationSummary2" runat="server" ValidationGroup="grp2"
DisplayMode="BulletList" CssClass="ErrorMsg" />
</td>
</tr>
</table>
</div>
</center>
<asp:Button runat="server" ID="btnClose2" Text="Back" CssClass="btn_control" />
</asp:Panel>
aspx.cs code:
protected void OpenPopUp1_Click(object sender, ImageClickEventArgs e)
{
ModalPopupExtender1.Show();
}
protected void OpenPopUp2_Click1(object sender, ImageClickEventArgs e)
{
ModalPopupExtender_2.Show();
}
Reply
Answers (
11
)
How to get the selected row values in asp.net mvc apllicatio
Master Page