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 September 28th, 2006, 11:40 PM
Authorized User
 
Join Date: Jun 2006
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default HyperLink Problem

Hi

I have runtime asp:hyperlink that I need to have some code fire when the link is clicked. The link is in a datagrid and the link is working properly. I need the code to fire only when the users clicks on one of the links in the datagrid.Which event is fired when user click on Hyperlink?

Any help would be appreciated,

Thanks
monika


 
Old September 29th, 2006, 06:44 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Monika

In place of hyperlink, use asp:lnikbutton as below:

<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton Runat=server CommandName="lnk">Add New</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>

Now the event that is fired when you click the linkbutton is the ItemCreated event of DataGrid which is as follows, we gave the commandName to uniquely identify this link button.

protected void dgGrid_OnItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
if (e.CommandName == "lnk")
{

}

}


Regards
Mike
 
Old September 30th, 2006, 05:17 AM
Authorized User
 
Join Date: Jun 2006
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HI

Thanx for yr ans.

Thanx
monika








Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Hyperlink JaffAJob Word VBA 3 August 28th, 2007 11:50 AM
hyperlink problem hastikeyvan Classic ASP Professional 5 January 22nd, 2007 07:03 PM
Hyperlink Problem Lalit Pradhan ASP.NET 2.0 Professional 2 June 14th, 2006 09:36 AM
hyperlink problem Abhinav_jain_mca General .NET 3 August 27th, 2004 07:54 AM
hyperlink problem Abhinav_jain_mca SQL Server 2000 1 August 25th, 2004 01:43 PM





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