Avatar of akulavi
akulavi
 asked on

How Do I set TargetControlID of AjaxControl:ModalPopupExtender if the Button belongs to each row of a gridview

In my page i need to build one gridview with some data and at the last column there will be a button. Now in that Button Click I need to have a modal popup window from where I need to take some more data from user. after providing the data if user clicks on submit button then only records belongs to gridview and the modal popup window will move to database.

1. How can I do this ?
2. Before opening Modal popup window I need check certain cell's value of the parent gridview. How to achieve this functionality
ASP.NETVisual Basic.NET

Avatar of undefined
Last Comment
amar31282

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
amar31282

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
prairiedog

There is a trick when using AJAX ModalPopup with GridView and here it is:
1. Create a Label or any other server control that can extend the ModalPopup
2. Use CSS to hide the control: add style="display:none;" to the control's definition markup code (don't use Visible=False to hide it)
3. Set ModalPopup's TargetControlID to the control you added in step 1
How to show the popup?
In your code-behind, after you check the cell's value, just call YourModalPopupID.Show()
amar31282

@prairiedog i think i have implemented the same thing
prairiedog

@amar31282, yes, you are right. My bad. Please scratch out my comment.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
amar31282

(*_*)
amar31282

hey akulavi
 i think i deserved points as i have given my reply earlier and with example


prairiedog

Hi amar31282, I have submitted a request for moderator to take a look at this question. Let's wait and see. Here is the request: https://www.experts-exchange.com/questions/24245175/Automated-Request-for-Attention-Q-24241515.html
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
prairiedog

FYI, in the future, you can click "Request Attention" button at the bottom of the original request to send your disagreement.
amar31282

thanks prairiedog
amar31282

Thanks @modus_opera& and @prairiedog
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck