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

File hyperlink ???

Dear all,

I am building an ASP 1.1 applciation collecting data from an SQL server
database.
In one table field, users will have possibility to introduced a file path
(attached document)

What I would like to do is to display in a datagrid column, a picture
visible when the File path column is not empty and that path is valid, and
then create an hyperlink on that picture pointing to the file.

I have try to use Template column but coucl not geit it work.
In fact my datgrid column should be bound to the "FILEPATH" field of my
database table but instead of displaying the content of the column, it should
display a pictture linked to the content of the field

thnaks for your help
regards
serge
Apr 5 '06 #1
1 1363
I don't know if this is the "Proper" way to implemenet this but i
usally write a function in the code behind that is passed the FILEPATH
field as a parameter. The function checks the filepath field and if not
NULL (nothing) it returns a string that builds the image.

Public Function CheckForImage(ByVal s as string)
if s isnot nothing then
return "<img src='/images/image2display.gif'> <a href='" & s & "'>
DOWNLOAD </a>"
else
return ""
End if

Assuming s is the path to the file which is stored in the database.
Good luck.

If you wanted to right the code inside the script you could write a
fairly simple IIF statement.

http://msdn.microsoft.com/library/de...l/vafctIIF.asp

Apr 5 '06 #2

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

Similar topics

3
by: Ajay | last post by:
hi! How do i create and stream a file? On a webpage i have a link to a file. Next to it i would like link, which, when pressed, runs a script that calculates the signature of the file, pickles...
1
by: Benson Cheng | last post by:
Hi All, This is what I want to do, in a aspx page, the user enters some search criteria, and when the user click on the search button, the page lists all the matching files (on the server) as a...
5
by: JerryK | last post by:
Hi, I am trying to put a hyperlink to a .cer (certificate) file on a form. Normally (on a ,htm page) when the user clicks on the hyperlink, the file is not recognized and the user is given the...
2
by: Bala | last post by:
Hi I am trying to download the PDF files from my webserver using ASP.Net. All my files are stored at F Drive on webserver. Like this F:\Main Folder\Sub Folder\Files\File1.pdf I am...
2
by: Shehab Kamal | last post by:
I'm using ASP.NET 1.1. I have a DataGrid in which I have a hyperlink column. The NavigateUrl of the hyperlink is an ftp file on the form "ftp://IP Address/fileName". When I click the hyperlink the...
3
by: sohan | last post by:
hi I have hyperlink column in a datagrid. The column contains the name of a text file. I am able to appendthe full path of the file. The file is on D drive on the server. But on clicking on...
9
by: Morris Neuman | last post by:
Im working with VS 2005 and trying to use a Hyperlink field in a datagrid to play a wave file that is not located in the website folders but is in a plain folder on the same machine, windows 2003...
3
tdw
by: tdw | last post by:
I have a working hyperlink field in a table, and it's form. I also have a working File Picker Dialog: FileDialog(msoFileDialogFilePicker), being used to create the hyperlink. What I need to do, and...
6
by: Briansmi1116 | last post by:
Hello all, I have a button that opens a browse for window, to allow you to find a file and create a hyperlink to that file. This is then placed in a text box. The code I use is: Private Sub...
1
by: CreativeMind | last post by:
hi, I am facing problem in download hyperlink..plz give me the solution. in codebehind, private void repDocuments_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)...
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
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...

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.