<a href> dynamically in ASP.NET

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Aug 2009
Posts: 31
Reputation: sakhi kul is an unknown quantity at this point 
Solved Threads: 0
sakhi kul sakhi kul is offline Offline
Light Poster

<a href> dynamically in ASP.NET

 
0
  #1
Aug 31st, 2009
hi to all,
I want to give user facility to download files from my website.
so, user first view it. I saved file path in data table, but I don't know how to change href value dynamically..?

or any other solution exist?
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 136
Reputation: cVz is an unknown quantity at this point 
Solved Threads: 7
cVz's Avatar
cVz cVz is offline Offline
Junior Poster

Re: <a href> dynamically in ASP.NET

 
0
  #2
Aug 31st, 2009
If you have the path + name of the file . maybe try the following.

add the path and name to a datatable.

From there you need to get the selected index of the grid row.

Then you get the datarow and the clumns of the row [file path] [file name] and assign it to the item you need ... then on click , response.redirect .
Delphi & C# programmer deluxe...
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 433
Reputation: Ramesh S will become famous soon enough Ramesh S will become famous soon enough 
Solved Threads: 82
Ramesh S Ramesh S is online now Online
Posting Pro in Training

Re: <a href> dynamically in ASP.NET

 
0
  #3
Sep 1st, 2009
Declare an <a> object in the HTML markup as below. See the runat="server" property. So that you can set/get the properties of <a> object from the C# code behind class file.

  1. <a id="anchDownloadFile" runat="server">Download</a>

You can assign href in the C# class file as below

  1. anchDownloadFile.HRef = "http://localhost/yoursitename/fileName";
Last edited by Ramesh S; Sep 1st, 2009 at 8:20 am.
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC