|
-
Mar 21st, 2007, 05:04 PM
#1
Thread Starter
Hyperactive Member
[2005] [vb] AJAX modalpopup dynamic button
Hi,
I have created a datalist, which contains buttons.
When one of these buttons is click I want to show the modal popup.
The button has code which is fired when it is Onclick, but as far as I am aware the ajax modalpopup has to be assigned to a control, I tried assigning it to the generic ID for the buttons that are in the list, but it doesnt like that.
any ideas on how i can make an ajax modalpopup appear when the button is clicked.
I should alsp mention that the datalist is in an update panel too, but thats only so the whole page doesnt refresh when the user clicks one of the buttons.
Cheers,
-
Mar 23rd, 2007, 09:05 AM
#2
Re: [2005] [vb] AJAX modalpopup dynamic button
The datalist has an ItemDataBound control which you must handle. It gets thrown once for each 'row' in your datalist. Each time it is hit, do a FindControl for your button, and then attach the onlick event to that button.
-
Mar 23rd, 2007, 09:19 AM
#3
Thread Starter
Hyperactive Member
Re: [2005] [vb] AJAX modalpopup dynamic button
its not an onlick event, is it?
You have to specifiy the control ID for the modalpopup, or are you saying I should create a dynamicly created modalpopup for each button?
-
Mar 23rd, 2007, 10:39 PM
#4
Hyperactive Member
Re: [2005] [vb] AJAX modalpopup dynamic button
the way i had to do it (in a gridview) was put a modalpopup extender in the itemtemplate and set the TargetControlID to my link button (or any other button) and the PopUpControlID to the popup panel. Then when it scrolls out it binds the same popup control to every link in the databound control.
If this post helps, please RATE MY POST!
Using Visual Studio 2005 SE
-
Mar 24th, 2007, 07:29 AM
#5
Thread Starter
Hyperactive Member
Re: [2005] [vb] AJAX modalpopup dynamic button
ah! now theres an idea!!
Cheers, I didnt think of that, lol.
I'll give it a whirl in a bit, and let you know if it worked.
-
Mar 27th, 2007, 08:39 AM
#6
Hyperactive Member
Re: [2005] [vb] AJAX modalpopup dynamic button
did it end up working for you?
If this post helps, please RATE MY POST!
Using Visual Studio 2005 SE
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|