Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
.NET
.NET Core
.NET MAUI
.NET Standard
Active Directory
ADO.NET
Agile Development
AI
AJAX
AlbertAGPT
Alchemy
Alexa Skills
Algorand
Algorithms in C#
Android
Angular
ArcObject
ASP.NET
ASP.NET Core
Augmented Reality
Avalanche
AWS
Azure
Backbonejs
Big Data
BizTalk Server
Blazor
Blockchain
Bootstrap
Bot Framework
Business
Business Intelligence(BI)
C#
C# Corner
C# Strings
C, C++, MFC
Career Advice
Careers and Jobs
Chapters
ChatGPT
Cloud
Coding Best Practices
Cognitive Services
COM Interop
Compact Framework
Copilot
Cortana Development
Cosmos DB
Cryptocurrency
Cryptography
Crystal Reports
CSS
Current Affairs
Custom Controls
Cyber Security
Data Mining
Data Science
Databases & DBA
Databricks
Design Patterns & Practices
DevExpress
DevOps
DirectX
Dynamics CRM
Enterprise Development
Entity Framework
Error Zone
Exception Handling
F#
Files, Directory, IO
Flutter
Games Programming
GDI+
General
Generative AI
GO
Google Cloud
Google Development
Graphics Design
Graphite Studio
Hardware
Hiring and Recruitment
HoloLens
How do I
HTML 5
Infragistics
Internet & Web
Internet of Things
Ionic
Java
Java and .NET
JavaScript
JQuery
JSON
JSP
Knockout
Kotlin
Langchain
Leadership
Learn .NET
Learn iOS Programming
LINQ
Machine Learning
Metaverse
Microsoft 365
Microsoft Fabric
Microsoft Office
Microsoft Phone
Microsoft Teams
Mobile Development
MongoDB
MuleSoft
MySQL
NEAR
NetBeans
Networking
NFT
NoCode LowCode
Node.js
Office Development
OOP/OOD
Open Source
Operating Systems
Oracle
Outsourcing
Philosophy
PHP
Polygon
PostgreSQL
Power Apps
Power Automate
Power BI
Power Pages
Printing in C#
Products
Progress
Progressive Web Apps
Project Management
Public Speaking
Python
Q#
QlikView
Quantum Computing
R
React
React Native
Reports using C#
Robotics & Hardware
RPA
Ruby on Rails
RUST
Salesforce
Security
Servers
ServiceNow
SharePoint
Sharp Economy
SignalR
Smart Devices
Snowflake
Software Architecture/Engineering
Software Testing
Solana
Solidity
Sports
SQL
SQL Server
Startups
Stratis Blockchain
Swift
SyncFusion
Threading
Tools
TypeScript
Unity
UWP
Visual Basic .NET
Visual Studio
Vue.js
WCF
Wearables
Web API
Web Design
Web Development
Web3
Windows
Windows Controls
Windows Forms
Windows PowerShell
Windows Services
Workflow Foundation
WPF
Xamarin
XAML
XML
XNA
XSharp
Register
Login
2
Answers
How to open a popup div in Codebehind c#
Manoj Maharana
8y
3k
1
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