Search:
Namespaces
Discussions
.NET v1.1
Feedback
Bound columns
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngdatagridrepeaterdatalist' list
.
Anthony Merante
-- Moved from [aspngfreeforall] to [aspngdatagridrepeaterdatalist] by Alex Lowe <
Click here to reveal e-mail address
> --
Hello all,
Anyone know how to accomplish this:
<asp:hyperlinkcolumn
DataNavigateUrlField="Category_ID"
DataNavigateUrlFormatString="/XrayDirect/Products/Category.aspx?CatID={0}&Level1={1}"
DataTextField="Name"
runat="server"
/>
I need to add another attribute to the querystring. I have CatID working fine but how do I add Level1=...
Reply to this message...
Alex Dresko
You have to convert your hyperlinkcolumn to a template column and work
with it that way. I ran into the same problem last week and found an
article about it somewhere on the internet.
Alex Dresko
Three Point Oh!
-- Moved from [aspngfreeforall] to [aspngdatagridrepeaterdatalist] by
Alex Lowe <
Click here to reveal e-mail address
> --
Hello all,
Anyone know how to accomplish this:
<asp:hyperlinkcolumn
DataNavigateUrlField="Category_ID"
DataNavigateUrlFormatString="/XrayDirect/Products/Category.aspx?CatID={0
}&Level1={1}"
DataTextField="Name"
runat="server"
/>
I need to add another attribute to the querystring. I have CatID working
fine but how do I add Level1=...
| [aspngdatagridrepeaterdatalist] member
Click here to reveal e-mail address
= YOUR ID
|
http://www.aspfriends.com/aspfriends/aspngdatagridrepeaterdatalist.asp
| = JOIN/QUIT
Reply to this message...
Alex Lowe
One technique is to use a
TemplateColumn
instead of a
HyperLinkColumn
. A =
TemplateColumn
containing a
HyperLink
control and a helper function =
makes this quite easy. Something like this (the function could go in =
your code behind or a <script> tag) :
=20
Function BuildURL(DeptID As String, CompID As String) As String=20
Dim strURL As String =3D "DeptDetails.aspx?DEPT ID=3D" & DeptID & =
"&COMP ID=3D" & CompID=20
Return strURL=20
End Function=20
And in your datagrid have a
TemplateColumn
that looks something like =
this:=20
<asp:TemplateColumn>=20
<HeaderTemplate>DEPARTMENT</HeaderTemplate>=20
<ItemTemplate>=20
<asp:HyperLink=20
NavigateURL=3D'<%# BuildURL(
Container
.DataItem("DeptID"), =
Container
.DataItem("CompID")) %>'
Text=3D'<%#
Container
.DataItem("DEPARTMENT") %>'=20
Runat=3D"server" />=20
</ItemTemplate>=20
</asp:TemplateColumn>=20
Or, you could use something like the technique described in =
(
http://www.fawcette.com/vsm/2002
_08/online/hottips/esposito/page2.asp).
hth,
Alex Lowe
AspFriends.com Moderation Team
----- Original Message -----
From: "Alex Dresko" <
Click here to reveal e-mail address
>
To:
Click here to reveal e-mail address
Sent: Mon, 5 Aug 2002 16:39:22 -0400
Subject: RE: [aspngdatagridrepeaterdatalist] Bound columns
[Original message clipped]
Reply to this message...
System.ComponentModel.Container
System.Web.UI.WebControls.HyperLink
System.Web.UI.WebControls.HyperLinkColumn
System.Web.UI.WebControls.TemplateColumn
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com