how to diplay multiple file in repeater control

Posted by Falak under ASP.NET on 9/13/2009 | Views : 2473 | Status : [Member] | Replies : 2
my question is
how to display many file in repeater control
for example we upload many file
file store in folder i want to see file name file path
and i aslo want open and save the file
file name file path hyperlink
Ali.doc app_data\ali.doc openfile
when we click on openfile file then ask me open save or cancel
same as if different file then what procedure use
i think u understand my questiion
i w8 4 ur reply


Posted by: Lakhangarg on: 9/13/2009 [Member] [Moderator] Silver

Hi Falak-

(1) Use a anchor (<a>) tag in the repeater.
(2) Get your file name with path in Tabular form.
(3) Bind the Data with repeater.

user anchor tag like this:

<a href='<%# Eval("FilePath").ToString()+Eval("FileName").ToString() %>'><%# Eval("FileName").ToString() %></a>

Thanks & Regards
Lakhan Pal Garg

Falak, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rtpharry on: 9/16/2009 [Member] [MVP] Bronze

You need to use a file handler to serve up the files.

This would be a good starting point:

If you put the files in the app_data folder then it is impossible to access them via the url so they will be protected.

You can still access them via the code in your httphandler though.

To enhance it further you could use url rewriting to hide the httphandler and make it look like the url is a real filename.

Falak, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response