473,379 Members | 1,270 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,379 software developers and data experts.

hyperlinkcolumn and DataNavigateUrlFormatString in DataGrid

hello!

It would seem trivial that you might want to pass more than just one
variable to the next page with a hyperlink. This would be:
'nextpage.aspx?var1=1&var2=2'.

However, I cannot see how I can get the grid to do this via the
hyperlinkcolumn.

I am probably missing something very obvious. Thank you for your help!

-Bahman
Dec 27 '05 #1
2 1891
Hello Bahman,

The HyperLinkColumn.DataNavigateUrlField property takes only one datafield
name. You cannot compose the link from 2 different data fields. In your
scenario you might consider the normal Hyperlink object instead, e.g.

<a href='page.aspx?var1=<%# DataBinder.Eval(Container.DataItem,
"Var1Field")%>&var2=<%# DataBinder.Eval(Container.DataItem, "Var2Field")%>'
<%# DataBinder.Eval(Container.DataItem, "DataTextFieldName")%></a>
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Bahman" wrote:
hello!

It would seem trivial that you might want to pass more than just one
variable to the next page with a hyperlink. This would be:
'nextpage.aspx?var1=1&var2=2'.

However, I cannot see how I can get the grid to do this via the
hyperlinkcolumn.

I am probably missing something very obvious. Thank you for your help!

-Bahman

Dec 27 '05 #2
Phillip,

This worked great. Thank you very much.

-Bahman

"Phillip Williams" wrote:
Hello Bahman,

The HyperLinkColumn.DataNavigateUrlField property takes only one datafield
name. You cannot compose the link from 2 different data fields. In your
scenario you might consider the normal Hyperlink object instead, e.g.

<a href='page.aspx?var1=<%# DataBinder.Eval(Container.DataItem,
"Var1Field")%>&var2=<%# DataBinder.Eval(Container.DataItem, "Var2Field")%>'
<%# DataBinder.Eval(Container.DataItem, "DataTextFieldName")%></a>


--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Bahman" wrote:
hello!

It would seem trivial that you might want to pass more than just one
variable to the next page with a hyperlink. This would be:
'nextpage.aspx?var1=1&var2=2'.

However, I cannot see how I can get the grid to do this via the
hyperlinkcolumn.

I am probably missing something very obvious. Thank you for your help!

-Bahman

Dec 27 '05 #3

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: Maziar Aflatoun | last post by:
Hi everyone, Does anyone know how I can apply the css 'linksmall' to my hyperlink in my datagrid? I have the following and it doesn't work <asp:HyperLinkColumn Text="Edit"...
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: Roy | last post by:
I'm assuming this is amazingly simple and I'm just missing the boat. On the html side of an asp.net page I have a datagrid, a "search" button, and 8 text boxes for search criteria. A user enters...
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...
0
by: josepm | last post by:
Hello. I am programming a bounded DataGrid in C# (VS 2003) for ASP.Net 1.1 environment. My trouble is an HyperLinkColumn inside this DataGrid becaus I do not know how to change the...
3
by: Jl_G_0 | last post by:
Hey all, I need to add a hyperlinkcolumn to a datagrid, but the path (DataNavigateUrlFormatString) is dynamic, since the page lists files in directories. The folder name to list is stored in a...
4
by: rcoco | last post by:
Hi all, I have this big problem with hyperlinks I would appriciate any help please. My web site has two datagrids on the same page. And one has a list of names of the users which are in a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel

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.