Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > embedding <a href > tag in DataGrid

Reply
Thread Tools

embedding <a href > tag in DataGrid

 
 
=?Utf-8?B?T3V0bG9va05ld2JpZURldg==?=
Guest
Posts: n/a
 
      08-23-2005
Hello,

I'm new to ASP.NET but have done quite a bit of classic ASP. I need to
drill down to another page from the DataGrid using a record's ID. In classic
ASP, this was quite easy but I can't find anything equivalent in ASP.NET.

For example, I need to go from a page that lists Customers to a page for
CustomerDetails by allowing the user to click anywhere on the row of the
DataGrid.

I've read about using a TemplateColumn and a lable but it doesn't look like
the same functionality. Any help is very much appreciated.

Regards,

ASP.NET Newbie
 
Reply With Quote
 
 
 
 
tom pester
Guest
Posts: n/a
 
      08-23-2005
Hi newbie

<aspataGrid ID="dg" runat="server" DataSourceID="SqlDataSource1">
<Columns>
<asp:HyperLinkColumn DataNavigateUrlField="ProductID"
DataNavigateUrlFormatString="details.aspx?id={0}"
Text="More Details"></asp:HyperLinkColumn>
</Columns>
</aspataGrid><asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString1 %>"
SelectCommand="SELECT [ProductID], [ProductName], [SupplierID],
[CategoryID], [QuantityPerUnit] FROM [Alphabetical list of products]">
</asp:SqlDataSource>

That code uses the version 2 datasource control but its the hyperlinkColumn
that you are intrested in.


Let me know if it helped you or not...

Cheers,
Tom Pester

> Hello,
>
> I'm new to ASP.NET but have done quite a bit of classic ASP. I need
> to drill down to another page from the DataGrid using a record's ID.
> In classic ASP, this was quite easy but I can't find anything
> equivalent in ASP.NET.
>
> For example, I need to go from a page that lists Customers to a page
> for CustomerDetails by allowing the user to click anywhere on the row
> of the DataGrid.
>
> I've read about using a TemplateColumn and a lable but it doesn't look
> like the same functionality. Any help is very much appreciated.
>
> Regards,
>
> ASP.NET Newbie
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?T3V0bG9va05ld2JpZURldg==?=
Guest
Posts: n/a
 
      08-24-2005
Tom,

Thank you very much for the example. The HyperLinkColumn tag worked out
perfectly!

Regards,

The Newbie


"tom pester" wrote:

> Hi newbie
>
> <aspataGrid ID="dg" runat="server" DataSourceID="SqlDataSource1">
> <Columns>
> <asp:HyperLinkColumn DataNavigateUrlField="ProductID"
> DataNavigateUrlFormatString="details.aspx?id={0}"
> Text="More Details"></asp:HyperLinkColumn>
> </Columns>
> </aspataGrid><asp:SqlDataSource ID="SqlDataSource1" runat="server"
> ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString1 %>"
> SelectCommand="SELECT [ProductID], [ProductName], [SupplierID],
> [CategoryID], [QuantityPerUnit] FROM [Alphabetical list of products]">
> </asp:SqlDataSource>
>
> That code uses the version 2 datasource control but its the hyperlinkColumn
> that you are intrested in.
>
>
> Let me know if it helped you or not...
>
> Cheers,
> Tom Pester
>
> > Hello,
> >
> > I'm new to ASP.NET but have done quite a bit of classic ASP. I need
> > to drill down to another page from the DataGrid using a record's ID.
> > In classic ASP, this was quite easy but I can't find anything
> > equivalent in ASP.NET.
> >
> > For example, I need to go from a page that lists Customers to a page
> > for CustomerDetails by allowing the user to click anywhere on the row
> > of the DataGrid.
> >
> > I've read about using a TemplateColumn and a lable but it doesn't look
> > like the same functionality. Any help is very much appreciated.
> >
> > Regards,
> >
> > ASP.NET Newbie
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
href="javascript:func()" vs href="#" onclick="javascript:func()" CRON HTML 24 06-20-2006 08:05 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
embedding <a href > tag in DataGrid OutlookNewbieDev ASP .Net Web Controls 2 08-24-2005 03:16 PM
difference between location.href and window.location.href? saiho.yuen Javascript 3 09-14-2004 06:51 PM
Problem: Setting MSIE iframe innerHTML change relative href/src to absolute href/src Soren Vejrum Javascript 4 07-05-2003 01:47 PM



Advertisments