Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 30th, 2006, 08:54 AM
Authorized User
 
Join Date: Jun 2006
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default Function

Hi

I have datagrid which is created at runtime.

I add checkboxes in datagrid also at runtime.

now i want event when i click on checkbox.

i have code like

protected void OnChangeHandler(object sender,EventArgs e)
 {
  // Handle the event...
 }

dim chk as new checkbox
chk.Id="chk"
chk.CheckedChanged += new EventHandler(OnChangeHandler);

but this code is not working in asp.net with vb.net.I think this code is in c#.

How can i write this code in asp.net with vb.net?

I hope now u got my question.

Thanks
monika

 
Old November 30th, 2006, 09:12 AM
Authorized User
 
Join Date: Sep 2006
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi , u cannot use the events of controls inside the datagrid directly.Every event inside the datagrid conrol is bubbled up to datagrid. So u must write a itemcommand event handler of datagrid and find which conrol was clicked then respond to that.

Good Luck

 
Old December 5th, 2006, 02:13 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this.....
<asp:CheckBox id="cb1" OnCheckChanged="OnChangeHandler" ..... />

Bijgupt
 
Old December 5th, 2006, 03:11 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hey

Guys, please do not cross post or post the same issue again, creates a lot of confusion, this issue has been handled in the following topic:

http://p2p.wrox.com/topic.asp?TOPIC_ID=53050

Regards
Mike

Fortune favours the brave, so don't regret on missed oppurtunities.





Similar Threads
Thread Thread Starter Forum Replies Last Post
function keyvanjan ASP.NET 2.0 Professional 1 September 19th, 2007 10:22 AM
How to use Function akumarp2p SQL Server 2000 1 May 28th, 2007 05:04 AM
send variable in function to another function schoolBoy Javascript How-To 6 March 3rd, 2007 09:16 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
retreive function/Line from macro or function? MikoMax J2EE 0 April 1st, 2004 04:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.