Link to home
Create AccountLog in
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
ASKER CERTIFIED SOLUTION
Avatar of amar31282
amar31282
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
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()
@prairiedog i think i have implemented the same thing
@amar31282, yes, you are right. My bad. Please scratch out my comment.
(*_*)
hey akulavi
 i think i deserved points as i have given my reply earlier and with example


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
FYI, in the future, you can click "Request Attention" button at the bottom of the original request to send your disagreement.
thanks prairiedog
Thanks @modus_opera& and @prairiedog