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
Vikas Singh
1.3k
410
14.7k
I wan to open popup on click button
Jan 2 2021 10:05 AM
Hello sir i want to open popup on click button first check condition and then open popup
here are code for it.
This is button where i want to open popup
<asp:Button runat=
"server"
ID=
"btnForwardforvalidation"
Text=
"Forward for Validation"
CssClass=
"btn btn-primary"
OnClick=
"btnForwardforvalidation_Click"
/>
This is model popup
<!-- Modal Popup -->
<div id=
"MyPopup"
class
=
"modal fade"
role=
"dialog"
>
<div
class
=
"modal-dialog"
>
<!-- Modal content-->
<div
class
=
"modal-content"
>
<div
class
=
"modal-header"
>
<div
class
=
"col-md-8"
>
<h3 style=
"color: green"
>Send Request For Approval</h3>
</div>
<div
class
=
"col-md-4"
>
<button type=
"button"
class
=
"close"
data-dismiss=
"modal"
>
×</button>
</div>
<h4
class
=
"modal-title"
></h4>
</div>
<div
class
=
"modal-body"
>
<div
class
=
"row"
>
<div
class
=
"col-md-2"
>
<asp:Label runat=
"server"
>Select Employee : <span style=
"color:red"
>*</span> </asp:Label>
</div>
<div
class
=
"col-md-4"
>
<asp:DropDownList runat=
"server"
ID=
"ddlemplist"
CssClass=
"form-control select2"
Width=
"100%"
></asp:DropDownList>
<asp:HiddenField runat=
"server"
ID=
"hidchkemplist"
/>
<asp:CustomValidator runat=
"server"
ID=
"cvmodulelist"
ClientValidationFunction=
"ValidateModuleList"
ErrorMessage=
"Please Select Atleast one Module"
ValidationGroup=
"ab"
ForeColor=
"#cc0000"
Display=
"none"
></asp:CustomValidator>
</div>
<div
class
=
"col-md-2"
>
<asp:Label runat=
"server"
>Meeting Date : <span style=
"color:red"
>*</span> </asp:Label>
</div>
<div
class
=
"col-md-4"
>
<asp:TextBox runat=
"server"
ID=
"txtmeetingdate"
type=
"Date"
CssClass=
"form-control"
></asp:TextBox>
<asp:RequiredFieldValidator runat=
"server"
ControlToValidate=
"txtmeetingdate"
ErrorMessage=
"Meeting Date is Required !"
Display=
"Dynamic"
ValidationGroup=
"ab"
>
</asp:RequiredFieldValidator>
</div>
<div
class
=
"clearfix"
></div>
<div
class
=
"col-md-12"
>
<asp:Label runat=
"server"
ID=
"lblmsg"
Visible=
"false"
ForeColor=
"Red"
></asp:Label>
</div>
</div>
<div
class
=
"clearfix"
></div>
<br />
<div
class
=
"row"
>
<div
class
=
"col-md-12"
align=
"center"
>
<asp:Button runat=
"server"
ID=
"btnSendRequest"
Text=
"Send Request For Approval"
CssClass=
"btn btn-primary"
OnClick=
"btnSendRequest_Click"
ValidationGroup=
"ab"
></asp:Button>
<asp:ValidationSummary runat=
"server"
ShowMessageBox=
"false"
ShowSummary=
"true"
ValidationGroup=
"ab"
/>
</div>
</div>
</div>
<div
class
=
"modal-footer"
>
<button type=
"button"
class
=
"btn btn-danger"
data-dismiss=
"modal"
>
Close
</button>
</div>
</div>
</div>
</div>
<!-- Modal Popup -->
and this is my onclick event
protected
void
btnForwardforvalidation_Click(
object
sender, EventArgs e)
{
string
check =
"false"
;
foreach
(GridViewRow grd
in
GRDPanelMeet.Rows)
{
CheckBox chkselect = (CheckBox)grd.FindControl(
"chkselect"
);
if
(chkselect.Checked)
{
check =
"true"
;
}
}
if
(check ==
"false"
)
{
ScriptManager.RegisterStartupScript(
this
,
this
.GetType(),
"popup"
,
"alert('Msg|Please select atleast one checkbox !');"
,
true
);
}
else
{
//Here I want to open popup
}
}
Reply
Answers (
1
)
asp.net core search parameter int not working
Asp.net TRY CATCH not working when surrounding stored procedure