codetoad.com
��ASP Shopping Cart,�Forum�&�BBS
��- all for $20 from CodeToad Plus!
��Home�||�ASP�|�ASP.Net�|�C++/C#�|�DHTML�|�HTML�|�Java�|�Javascript�|�Perl�|�VB�|�XML�||�CodeToad�Plus!�||�Forums�||�RAM
Search Site:
Search Forums:
How to associate a button in DataGrid button column with a javascript function (ASP.NET)??? �ipsoftware at 07:45 on Sunday, January 16, 2005

Hi, for a normal button, I may associate it with a javascript funtion to execute in the code file behind (.aspx.cs) like Button1.Attributes.Add("onclick","myJavascriptFunction();" upon being clicked. what if the button is in a DataGrid button column, how can I do that? code is like: <asp:ButtonColumn Text="Restart" ButtonType="PushButton" CommandName="....">. is it possible to do the same thing like a normal button?

Thank u!!!

Re: How to associate a button in DataGrid button column with a javascript function (ASP.NET)??? �ipsoftware at 09:11 on Sunday, January 16, 2005

just to restate my question to make it clearer;;;


for a normal button, I may associate it with a javascript funtion to execute first before the backend time-consuming function is called. In the code file behind (.aspx.cs) the code will be like Button1.Attributes.Add("onclick","myJavascriptFunction();" upon being clicked. what if the button is in a DataGrid button column, how can I do that?
is it possible to do the same thing like a normal button?

Thank u!!!

Re: How to associate a button in DataGrid button column with a javascript function (ASP.NET)??? �ipsoftware at 14:54 on Sunday, January 16, 2005

I solved the problem, thank u

Re: How to associate a button in DataGrid button column with a javascript function (ASP.NET)??? �tgreer at 04:07 on Monday, January 17, 2005

I assume you used the ItemDataBound event? If not, I'd like to know the technique you did use. Call me a collector.



Re: How to associate a button in DataGrid button column with a javascript function (ASP.NET)??? �ipsoftware at 07:09 on Monday, January 17, 2005

exactly, I used ItemDataBound event

Re: How to associate a button in DataGrid button column with a javascript function (ASP.NET)??? �seeyem at 17:17 on Monday, February 07, 2005

Can you send me the exact sample please?

to "seeyem@gmail.com"








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
�� variable scope problem
�� dynamic crystal report generation
�� execute an Excel macro when the sheet is changed from ASP.NET
�� Re: form
�� form
�� Re: Client-Side Progress Window
�� Re: Help: Trouble with z-Index and SELECT lists
�� Here ur answer ........Check it baby
�� MS Access connection in JSP


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

� Copyright codetoad.com 2001-2005