.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 7th, 2003, 02:02 PM
wsyeager wsyeager is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Weston, FL
Posts: 32 wsyeager User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to wsyeager
assigning an event to a command button

I have the following HTML in a webform within a datagrid (among other columns):

<asp:ButtonColumn Text="Coverage" ButtonType="PushButton" CommandName="btnCoverage"></asp:ButtonColumn>

I would like to somehow associate a "click" event with this button. However, there is no "Onclick" event associated with it. I also went to the code-behind page to see if I can somehow associate an event with this and none showed up in any of the dropdown lists from within the code-behind page.

This command button was built using the property builder of the asp.net datagrid.

How can I associate a click event with this button???
__________________
Thanks,

Bill Yeager BCIP, MCP
BrainBench Certified Internet Professional
Microsoft Certified Professional

Reply With Quote
  #2  
Old August 7th, 2003, 05:44 PM
wsyeager wsyeager is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Weston, FL
Posts: 32 wsyeager User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to wsyeager
I placed the following on the aspx code-behind page that took care of the problem:

Private Sub DataGrid1_ItemCommand(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles DataGrid1.ItemCommand

If e.CommandName = "btnCoverage" Then 'Retrieve the row where the button was pressed
bytSelectedRow = e.Item.ItemIndex
End If

End Sub

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > assigning an event to a command button


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT