Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 August 6th, 2004, 09:37 AM
Authorized User
 
Join Date: Jun 2004
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Raif
Default Simple question Desperate for help!!

Hi, I know this is easy but I can't for the life of me work it out. I have a datagrid with a template column populated by dataset. I want to get the value of that cell as a string and play with it in my vb page behind code. Thats all! Not that much to ask is it?
The html code is
<asp:linkbutton id="linkemail" Font-Size="10" OnClick = "email" text='<%#databinder.eval(container.dataitem, "email")%>' Runat="server" width="100"></asp:linkbutton>

I'm calling a sub on the onclick event and I (obviously) need the bloody email address!!!!!!
Pleas help!
thank you
raif

 
Old August 6th, 2004, 09:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

How are you calling the OnClick event handler?

 
Old August 6th, 2004, 09:54 AM
Authorized User
 
Join Date: Jun 2004
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Raif
Default

with the "onclick = 'email'" part of my <asp:linbutton>

 
Old August 6th, 2004, 10:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You should have an event handler in the code behind that says email(sender as object, e as system.eventargs) Handles linkemail.click

 
Old August 7th, 2004, 11:55 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Actually, you can't do what stu9820 is suggesting. Because your linkbutton is in a template, there won't be a "linkable" instance of that button in the code-behind class. So you can't use the "Handles" keyword. However, the presence of the handler should be enough.

Something that might work: The handler will handle the call from the linkbutton, and because the handler accepts "sender" as an argument, you can convert "sender" to a linkbutton and retrieve its text.

strEmail = CType(sender, LinkButton).Text





Similar Threads
Thread Thread Starter Forum Replies Last Post
simple question petergoodman XSLT 8 July 18th, 2008 07:57 AM
Simple Question ironchef Spring 2 April 30th, 2007 09:32 AM
Simple Question ironchef Java GUI 0 September 14th, 2006 04:56 PM
Simple Question dpkbahuguna Java Basics 2 May 19th, 2006 12:05 AM





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