473,395 Members | 2,222 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,395 software developers and data experts.

<newbie> HyperLinkField

Hi

asp.net 2.0

I'm trying to implement a HyperLinkField into my GridView.. The
SqlDataSource returns a field which is paths to files (each row in the
GridView should have link to a file).

I've specified DataTextFields and DataNavigationUrlFields with the column
name which holds the path to the document. But the GridView doesn't create a
link, it just displays it as text...

what I do wrong here?
Nov 20 '08 #1
4 2407
On Nov 20, 8:31*am, "Jeff" <it_consulta...@hotmail.com.NOSPAMwrote:
Hi

asp.net 2.0

I'm trying to implement a HyperLinkField into my GridView.. The
SqlDataSource returns a field which is paths to files (each row in the
GridView should have link to a file).

I've specified DataTextFields and DataNavigationUrlFields with the column
name which holds the path to the document. But the GridView doesn't create a
link, it just displays it as text...

what I do wrong here?
Hi Jeff,

what is the code of hyperlinkfield?

Check the following links, maybe you will see the difference
http://authors.aspalliance.com/aspxt...ogridview.aspx
http://msdn.microsoft.com/en-us/libr...linkfield.aspx

Hope this helps
Nov 20 '08 #2
what is the code of hyperlinkfield?
- it is like this: c:\website1\Documents\test.txt

could it be that I'm missing http... in the beginning of the code?
Nov 20 '08 #3
On Nov 20, 10:24*am, "Jeff" <it_consulta...@hotmail.com.NOSPAMwrote:
"sti" have the value "c:\website1\Documents\test.txt"
This path is local. To make the document available for all your
visitors you should change the path to "/Documents/test.txt" if "c:
\website1" is the root directory of your website.
Nov 20 '08 #4
"sti" have the value "c:\website1\Documents\test.txt"
>
This path is local. To make the document available for all your visitors
you should change the path to "/Documents/test.txt" if "c:\website1" is the
root directory of
your website.
Did you consider turning the HyperLinkField into a TemplateField? This gives
better flexability in the control of what happens with your link. I almost
never use HyperLinkFields for that reason. It also lets me do custom code
behind the link clicks and stuff (if you need to do that). By chance you
want to use a TemplateField and put a HyperLink control there instead, then
the HyperLinks should look like this:

<asp:HyperLink id="link" NavigateUrl='<%# Eval("ski") %>' ...
</asp:HyperLink>
Nov 20 '08 #5

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

Similar topics

129
by: Torbjørn Pettersen | last post by:
I've started cleaning up my HTML and implementing CSS. So far I've used FrontPage, but am switching over to DreamWeaver. Reading a bit on W3Schools.com and W3.org I see there are a lot of HTML...
5
by: Grahammer | last post by:
Sorry for the whining, but I'm getty VERY frustrated trying to do some very simple jobs with DotNet and finding out that they are just impossible or involve a LOT of work. - Print a RichTextBox...
3
by: | last post by:
I have been researching articles on google on how to create a simple RSS feed that sucks <title><blurb><link><date> out of a sql server 2000 database via an aspx page. I know it has to be pushed...
2
by: Jeff | last post by:
hi asp.net 2.0 In a webpage I have a GridView displaying a collection of data. This collection of data is a collection of objects based on a custom class. where each object represent a record...
1
by: jobsjournal | last post by:
hi, i'm a newbie here. need help on how to make &lt; appear as &lt; and a&gt; appear as a&gt; without turning to the < and > sign, respectively. just for knowledge thanks jobs
1
by: Jeff | last post by:
hi asp.net 3.5 (project upgraded from asp.net 2.0). are using vwd2008 express now This is my first ajax attempt. The code below shows a TextBox and a ListBox. The idea I was trying to...
3
by: Jeff | last post by:
hi asp.net 2.0 i've used connectionstrings like this one for my webproject: connectionString="Server=Pdc1;Database=Testing;Integrated Security=false;User ID=tester;Pwd=hardtoguesspwd;" /> ...
0
by: Jeff | last post by:
Hi I'm following this tutorial: http://dev.live.com/gadgets/sdk/docs/default.htm And downloaded that sample file. Now I've created a simple web gadget project on my own:. I just made a copy...
3
by: Jeff | last post by:
hi I'm wondering how to open a web browser window in VS2008. I've created a simple windows Live Agent and just want to test it in the VS2008 before I deploy it... any ideas how to open a...
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: 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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.