How to add client script to a pushbutton in datagrid

V

VancouverMike

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
 
B

Bob Barrows [MVP]

VancouverMike said:
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
 
S

Steven Cheng[MSFT]

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top