473,410 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

how to send two parameters in HyperLinkColumn?

Hi, in the following example:
-----------
<asp:HyperLinkColum
HeaderText="Select an Item"
DataNavigateUrlField="IntegerValue"
DataNavigateUrlFormatString="detailspage.aspx?id={ 0}"
DataTextField="PriceValue"
DataTextFormatString="{0:c}"
Target="_blank"/>
-----------
there is only one parameter "id" to transmit,
how do I send two parameters using HyperLinkColumn?
Nov 18 '05 #1
5 4129
Hi sincethe2003:

You could add script to actually perform the String.Format in ASPX:

DataNavigateUrlFormatString=
<%= String.Format("detailspage.aspx?id={0}", id); %>

--
Scott
http://www.OdeToCode.com/
--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sun, 17 Oct 2004 04:49:32 +0800, "sincethe2003" <sc*****@yahoo.com>
wrote:
Hi, in the following example:
-----------
<asp:HyperLinkColum
HeaderText="Select an Item"
DataNavigateUrlField="IntegerValue"
DataNavigateUrlFormatString="detailspage.aspx?id={ 0}"
DataTextField="PriceValue"
DataTextFormatString="{0:c}"
Target="_blank"/>
-----------
there is only one parameter "id" to transmit,
how do I send two parameters using HyperLinkColumn?


Nov 18 '05 #2
how to send the second parameter?
for example:
<%= String.Format("detailspage.aspx?id={0}&name={1}", id, name);
but this is not work....

"Scott Allen" <bitmask@[nospam].fred.net> ¦b¶l¥ó
news:cn********************************@4ax.com ¤¤¼¶¼g...
Hi sincethe2003:

You could add script to actually perform the String.Format in ASPX:

DataNavigateUrlFormatString=
<%= String.Format("detailspage.aspx?id={0}", id); %>

--
Scott
http://www.OdeToCode.com/
--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sun, 17 Oct 2004 04:49:32 +0800, "sincethe2003" <sc*****@yahoo.com>
wrote:
Hi, in the following example:
-----------
<asp:HyperLinkColum
HeaderText="Select an Item"
DataNavigateUrlField="IntegerValue"
DataNavigateUrlFormatString="detailspage.aspx?id={ 0}"
DataTextField="PriceValue"
DataTextFormatString="{0:c}"
Target="_blank"/>
-----------
there is only one parameter "id" to transmit,
how do I send two parameters using HyperLinkColumn?

Nov 18 '05 #3
Are you getting an exception or???

--
Scott
http://www.OdeToCode.com/

On Sun, 17 Oct 2004 18:47:42 +0800, "sincethe2003" <sc*****@yahoo.com>
wrote:
how to send the second parameter?
for example:
<%= String.Format("detailspage.aspx?id={0}&name={1}", id, name);
but this is not work....

"Scott Allen" <bitmask@[nospam].fred.net> ¦b¶l¥ó
news:cn********************************@4ax.com ¤¤¼¶¼g...
Hi sincethe2003:

You could add script to actually perform the String.Format in ASPX:

DataNavigateUrlFormatString=
<%= String.Format("detailspage.aspx?id={0}", id); %>

--
Scott
http://www.OdeToCode.com/
--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sun, 17 Oct 2004 04:49:32 +0800, "sincethe2003" <sc*****@yahoo.com>
wrote:
>Hi, in the following example:
>-----------
><asp:HyperLinkColum
> HeaderText="Select an Item"
> DataNavigateUrlField="IntegerValue"
> DataNavigateUrlFormatString="detailspage.aspx?id={ 0}"
> DataTextField="PriceValue"
> DataTextFormatString="{0:c}"
> Target="_blank"/>
>-----------
>there is only one parameter "id" to transmit,
>how do I send two parameters using HyperLinkColumn?
>


Nov 18 '05 #4
yes, it will cause error,
because it seems only {0} is accepted, the second parameter using {1} will
cause error .....

"Scott Allen" <bitmask@[nospam].fred.net> ¦b¶l¥ó
news:e7********************************@4ax.com ¤¤¼¶¼g...
Are you getting an exception or???

--
Scott
http://www.OdeToCode.com/

On Sun, 17 Oct 2004 18:47:42 +0800, "sincethe2003" <sc*****@yahoo.com>
wrote:
how to send the second parameter?
for example:
<%= String.Format("detailspage.aspx?id={0}&name={1}", id, name);
but this is not work....

"Scott Allen" <bitmask@[nospam].fred.net> ¦b¶l¥ó
news:cn********************************@4ax.com ¤¤¼¶¼g...
Hi sincethe2003:

You could add script to actually perform the String.Format in ASPX:

DataNavigateUrlFormatString=
<%= String.Format("detailspage.aspx?id={0}", id); %>

--
Scott
http://www.OdeToCode.com/
--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sun, 17 Oct 2004 04:49:32 +0800, "sincethe2003" <sc*****@yahoo.com>
wrote:

>Hi, in the following example:
>-----------
><asp:HyperLinkColum
> HeaderText="Select an Item"
> DataNavigateUrlField="IntegerValue"
> DataNavigateUrlFormatString="detailspage.aspx?id={ 0}"
> DataTextField="PriceValue"
> DataTextFormatString="{0:c}"
> Target="_blank"/>
>-----------
>there is only one parameter "id" to transmit,
>how do I send two parameters using HyperLinkColumn?
>

Nov 18 '05 #5
This is a known limitation of the hyperlink column.
It will only take 1 parameter.

Try using a template column instead:
================================================== ==========
<asp:TemplateColumn SortExpression="mynumber" HeaderText="My Number">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:Hyperlink id="hylMyNumber" runat="server"></asp:Hyperlink>
</ItemTemplate>
</asp:TemplateColumn>
================================================== ==========

Then in code behind you can use: (mColl is custom collection object.)
================================================== ==========

Private Sub dg1_ItemDataBound(ByVal sender As Object, ByVal e As
DataGridItemEventArgs) Handles dg1.ItemDataBound

If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
ListItemType.AlternatingItem Then

'need to take paging into account.
Dim mIndex As Integer = CType(sender, DataGrid).PageSize *
CType(sender, DataGrid).CurrentPageIndex + e.Item.ItemIndex

Dim obj As HyperLink = CType(e.Item.FindControl("hylMyNumber"),
HyperLink)
obj .NavigateUrl = "javascript:LeftSideWin('ViewNum.aspx?Key=" &
mColl(mIndex).key & "&KeyType=" & mColl(mIndex).type & "','MyWin');"
obj .Text = mColl.(mIndex).mynumber

End If

End Sub
================================================== ==========
--
Joe Fallon


"sincethe2003" <sc*****@yahoo.com> wrote in message
news:eT*************@TK2MSFTNGP09.phx.gbl...
Hi, in the following example:
-----------
<asp:HyperLinkColum
HeaderText="Select an Item"
DataNavigateUrlField="IntegerValue"
DataNavigateUrlFormatString="detailspage.aspx?id={ 0}"
DataTextField="PriceValue"
DataTextFormatString="{0:c}"
Target="_blank"/>
-----------
there is only one parameter "id" to transmit,
how do I send two parameters using HyperLinkColumn?

Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jongmin | last post by:
Hi! I am making HyperLinkColumn in datagrid. It is simple to make the hyerlinkcolumn with one datafield. <asp:HyperLinkColumn Text="NAME" DataNavigateUrlField="NAME"...
1
by: Dmitri Manushin | last post by:
Hi all, i have HyperLinkColumn in DataGrid <asp:HyperLinkColumn DataNavigateUrlField="PostID" DataNavigateUrlFormatString="http://localhost/forum/posts.aspx?id={0}" DataTextField="Subject"...
3
by: SStory | last post by:
I have a style sheet for my site. It has various classes in it. It has <A: styles defined for all anchor tags. I have a datagrid in ASP.NET with a stylesheet linked to the page. It defines...
3
by: Morten | last post by:
Hi. After a while I finaly discovered how to use HyperLinkColumns. What I can't find is how to send mote than one "value" like page.aspx?id1&id2!!! <asp:HyperLinkColumn...
3
by: TJS | last post by:
how can I encrypt the querystring values for a HyperLinkColumn ? in example below I would like to encrypt value for field1 ======================================================...
0
by: Atif Jalal | last post by:
I am using a Datagrid control and one of its column is a 'HyperLinkColumn'. The link text for this HyperLinkColumn is sometimes beyond 100 characters. I would like to display the link on multi-line...
10
by: tshad | last post by:
I have a Datagrid with a column: <asp:HyperLinkColumn DataTextField="JobTitle" DataNavigateUrlField="PositionID" DataNavigateUrlFormatString="AddNewPositions.aspx?PositionID={0}"...
1
by: Craig | last post by:
I have a datagrid with a couple of columns. Right now, I'm setting assigning the dataview to the datasource. For the HyperLinkColumn.... <asp:HyperLinkColumn...
8
by: preeti13 | last post by:
I have a datagrid with a hyperlink field. It passes a parameter but I need it to pass two. I need two of the parameters to be querystrings but I have no idea how to add them the hyperlink column if...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.