Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Post
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Reply
How to open a popup div in Codebehind c#
Manoj Maharana
7 years ago
543
Reply
Open Popup on Item Template c#. My problem is that when i click the popup it will open the popup but it will not hit the RowCommand argument(i.e. e.commandname). Here is the code:
<ItemTemplate><asp:LinkButton ID=
"imgAppointment"
Text=
"Appointment"
runat=
"server"
Style=
"float: left; margin-right: 5px;"
CommandName=
"App"
CommandArgument=
'<%#Eval("ID") %>'
CssClass=
"label label-sm label-success"
data-backdrop=
"static"
data-toggle=
"modal"
data-target=
"#AddTask"
></asp:LinkButton></ItemTemplate>
This is the code on :
protected
void
gvTaskDetails_RowCommand(
object
sender, GridViewCommandEventArgs e)
{
if
(e.CommandName ==
"App"
)
{
DataTable retval = obj.FetchAppointmentByMalmrktId(Convert.ToInt32(e.CommandArgument));
if
(retval.Rows.Count > 0)
{
Repeater rptCustomers = (Repeater)Page.FindControl(
"rptCustomers"
);
rptCustomers.DataSource = retval;
rptCustomers.DataBind();
}
}
}
This is the popup div:
<div
class
=
"modal fade "
id=
"AddTask"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
style=
"margin-right: -15px !important;"
>
<div
class
=
"modal-dialog"
style=
"margin-right: 0; width: 50%; margin-top: 0; margin-bottom: 0px; background: #fff; height: 100vh; overflow-y: auto;"
>
<div
class
=
"modal-header"
>
<div
class
=
"row"
>
<div
class
=
"col-sm-6"
>
<h3
class
=
"text-primary text-big"
style=
"margin-top: 0px; margin-bottom: 0px;"
><b>Appointment </b></h3>
</div>
<div
class
=
"col-sm-6"
>
<button type=
"button"
class
=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
><i
class
=
"fa fa-chevron-circle-right"
id=
"btnAddTaskclose"
></i></button>
</div>
</div>
lt;asp:Repeater ID=
"rptCustomers"
runat=
"server"
>
<HeaderTemplate>
<div
class
=
"box-model"
>
<table
class
=
"table"
>
<tr>
<th style=
"width: 140px;"
>Appointment Date :
</th>
</tr>
<tr>
<th style=
"width: 140px;"
>Details :
</th>
</tr>
</table>
</div>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td style=
"width: 400px;"
>
<asp:Label ID=
"lbAppointmentdt"
runat=
"server"
Text=
'<%# Eval("Appointmentdate") %>'
/>
</td>
<td style=
"width: 400px;"
>
<asp:Label ID=
"lblDetails"
runat=
"server"
Text=
'<%# Eval("Details") %>'
/>
</td>
<td>Status
<br />
<button type=
"button"
class
=
"btn btn-xs btn-danger"
>Cancel Appointment</button>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
I want to bind the repeater on popup div..but if i delete
data-backdrop=
"static"
data-toggle=
"modal"
data-target=
"#AddTask" in item template of grid then the e.argument works..but popup is not opening..any suggestion???
How to open the popup and bind the repeater using c#??
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Angular with asp.net
Popup messaage when flag=1 thru database