How to add client script to a pushbutton in datagrid

Discussion in 'ASP General' started by VancouverMike, Mar 21, 2006.

  1. Hi there,

    I am using a datagrid in my asp.net web app to show a user list. I put a
    pushbutton (could be linkbutton as well) for each row in the grid. I would
    like to have a javascript function linked to each button, so when user clicks
    the button, another pupup window shows up to show an image of the selected
    user in the list. I am looking for a way to add client side javascript
    function to each button and passing the each user's key to the function.

    Thanks in advance.
    Mike
    VancouverMike, Mar 21, 2006
    #1
    1. Advertising

  2. VancouverMike wrote:
    > Hi there,
    >
    > I am using a datagrid in my asp.net web app


    There was no way for you to know it, but this is a classic asp newsgroup.
    While you may be lucky enough to find a dotnet-savvy person here who can
    answer your question, you can eliminate the luck factor by posting your
    question to a newsgroup where the dotnet-savvy people hang out. I suggest
    microsoft.public.dotnet.framework.aspnet.

    > to show a user list. I
    > put a pushbutton (could be linkbutton as well) for each row in the
    > grid. I would like to have a javascript function linked to each
    > button, so when user clicks the button, another pupup window shows up
    > to show an image of the selected user in the list. I am looking for a
    > way to add client side javascript function to each button and passing
    > the each user's key to the function.
    >

    Use Attributes.Add to add clientside properties to server-side controls.
    You would probably need to do this in the grid's ItemCreated event.See the
    dotnet group for more details.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Mar 21, 2006
    #2
    1. Advertising

  3. Hi Mike,

    Thank you for posting. I have seen your new thread posted in the ASP.NET
    specific newsgroup.

    Subject: How to add client script to a pushbutton in datagrid
    Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols

    I have also posted my suggestion in that thread. If you feel it convenient
    that we continue to discuss in that thread(since this is a pure ASP.NET
    issue), please feel free to followup there.

    Thanks for your understanding.

    Regards,

    Steven Cheng
    Microsoft Online Community Support


    ==================================================

    When responding to posts, please "Reply to Group" via your newsreader so
    that others may

    learn and benefit from your issue.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], Mar 22, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    1
    Views:
    462
  2. Curtis Hatter

    Solving DataGrid's PushButton Problem

    Curtis Hatter, Oct 14, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,845
  3. Nick Gilbert
    Replies:
    2
    Views:
    877
    Jeffrey Tan[MSFT]
    Dec 15, 2003
  4. Tim Meagher
    Replies:
    6
    Views:
    2,028
    naija naija
    Oct 28, 2004
  5. VancouverMike

    How to add client script to a pushbutton in datagrid

    VancouverMike, Mar 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    148
    Steven Cheng[MSFT]
    Mar 24, 2006
Loading...

Share This Page