Results 1 to 6 of 6

Thread: [2005] [vb] AJAX modalpopup dynamic button

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271

    Red face [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,
    §tudz

    Studzworld.com - Portfolio

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271

    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?
    §tudz

    Studzworld.com - Portfolio

  4. #4
    Hyperactive Member kayos's Avatar
    Join Date
    Apr 2004
    Location
    Largo, Florida
    Posts
    306

    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

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2001
    Location
    UK
    Posts
    271

    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.
    §tudz

    Studzworld.com - Portfolio

  6. #6
    Hyperactive Member kayos's Avatar
    Join Date
    Apr 2004
    Location
    Largo, Florida
    Posts
    306

    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
  •  



Click Here to Expand Forum to Full Width