IIS ASP - How to add client script to a pushbutton in datagrid

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > March 2006 > How to add client script to a pushbutton in datagrid





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to add client script to a pushbutton in datagrid
VancouverMike

2006-03-21, 5:56 pm

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

Bob Barrows [MVP]

2006-03-21, 5:56 pm

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.


Steven Cheng[MSFT]

2006-03-22, 2:48 am

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.




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com