473,769 Members | 1,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make dynamic links?

Hi

I need to make a list of "download file links" on a webpage. All the data
is dynamic - it depends on the user's actions how many files, and which
files, I need to present in the list. The files are identified by an id in
a database.

How do I do this? I was thinking I could somehow make a list of <a href...>
tags which could call a method in my c# code-behind. Is this possible? Or
is there a better way?

The links need to pass a "file id" to my code-behind so I can find the
correct file in a database and supply the file to the user (I assume I use
the Response stream to send the file).

Thanks,
Peter
May 7 '07 #1
3 2767
"Peter K" <xd****@hotmail .comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
How do I do this?
Sounds like you need a Repeater:
http://www.google.co.uk/search?sourc...%3aRepeater%22
--
http://www.markrae.net

May 7 '07 #2
On May 7, 1:22 pm, Peter K <xdz...@hotmail .comwrote:
Hi

I need to make a list of "download file links" on a webpage. All the data
is dynamic - it depends on the user's actions how many files, and which
files, I need to present in the list. The files are identified by an id in
a database.

How do I do this? I was thinking I could somehow make a list of <a href...>
tags which could call a method in my c# code-behind. Is this possible? Or
is there a better way?

The links need to pass a "file id" to my code-behind so I can find the
correct file in a database and supply the file to the user (I assume I use
the Response stream to send the file).

Thanks,
Peter
there are a lot of ways to do it

as an example (using a DataList Control)

<asp:DataList id="UrlList" runat="server">
<ItemTemplate >
<a href='mypage.as px?id=<%# DataBinder.Eval (Container.Data Item,
"StringValu e") %>'>Click here</a>
</ItemTemplate>
</asp:DataList>

in the code-behind:

UrlList.DataSou rce = CreateDataSourc eOfURLs()
UrlList.DataBin d()

May 7 '07 #3
It sounds like you are storing the file information in some form of data
store (database, XML file, search of file system that can be stored in
objects or files). If so, get the information into a DataSet or object
collection that can be bound. As far as how to do the links themselves, a
Repeater is a very good choice, with a Hyperlink in the item template.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************** *************** ***************
Think outside the box!
*************** *************** ***************
"Peter K" <xd****@hotmail .comwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Hi

I need to make a list of "download file links" on a webpage. All the data
is dynamic - it depends on the user's actions how many files, and which
files, I need to present in the list. The files are identified by an id in
a database.

How do I do this? I was thinking I could somehow make a list of <a
href...>
tags which could call a method in my c# code-behind. Is this possible? Or
is there a better way?

The links need to pass a "file id" to my code-behind so I can find the
correct file in a database and supply the file to the user (I assume I use
the Response stream to send the file).

Thanks,
Peter
May 7 '07 #4

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

Similar topics

2
2159
by: Acorn Tutors | last post by:
Hi folks, what I would like to do is to store the name of a link, such as link1.php in a field, lets say the field is called Favoritelinks, in a database as a bit of text. Then, on a logged in page, pull the value from the field and put in right in the <a href><a> tag so that the link now points to a file, and is dynamic. And, depending on the username and password, the value taken from Favoritelinks changes. What Im after is to...
3
1733
by: Danny | last post by:
How do you guys make listings such as product listings and their detail pages more crawler friendly, if they are genrated using dynamic asp pages. If your ASP uses a format like this: www.mysite.com/products.asp?idnum=3444 to display detail pages, how can I apply SEO to this format?? I know unix hosts use the mod rewrite, but I do not have access to the server settings etc. BUt I can access a database etc. What are your thoughts?
2
1871
by: Glenn | last post by:
Dynamic help topic links show properly and search brings up links, but when any link is clicked I receive a "Page Cannot be displayed message in the Explorer window and the title bar of Visual Studio reports that it cannot find server. What server is this? The start page works fine going to the internet and my normal Internet Explorer is working fine. VS 2003 v. 7.1.3044 Framework v. 1.1.4322 -- Thanks for any help, suggestions before...
7
6542
by: Larry R Harrison Jr | last post by:
I am looking for javascript and a basic tutorial on how to make mouse-over drop-down menus--the type that when you "hover" over a subject links relevant to that subject "emerge" which you can then "hover" over and click. (see the links left on http://www.dpreview.com to see what I mean) I have code from smartwebby.com (DHTML) but I'm not sure if it's the best, and I'm not sure how to integrate any menus of my own into it. The code...
1
1033
by: Rob | last post by:
Hi, I am new to this, but starting to get a handle on datagrids, repeaters, etc. Now I want to start formatting my pages so they look nice. My background is with database programming, not web design, but I still want to make things pretty. Looking at the top of some pages (such as asp.net) page, there is the ASP.NET logo and all the tabs running across the top and then the Search box. How is this done? My assumption is that it is done...
3
1314
by: Steve | last post by:
Hi- I am interested in creating links within my pages dynamically as they are requested. For example, someone requests a page, my web app. would parse the generated *.aspx HTML and add links to words or phrases that my app deems appropriate. I have tried to think of the best way to do this, the most efficient way. It doesn't have to be done each time it's requested, I would actually prefer if it were cached one it is done. I am trying...
17
3160
by: Rob R. Ainscough | last post by:
Again another simple concept that appears NOT to be intuitive or I'm just stupid. I've read the WROX book and the example doesn't actually show how the .master page links in the other content pages? Kinda sorta a critical point no? Am I missing something? Rob. P.S. the day I find a book that actually is useful rather than just a
2
3358
by: thetechturf.com | last post by:
I have some simple dynamic content pages (included below). I need to know how to add specific meta tags (ie. description, keywords, ect.), as well as extra specific header coding to a page. I would like to have these on the Links page. Is this possible? and how? ------------------------------------------------------------------------------------------------------------------------------ index.php --------------- <?php // Assign the...
38
5078
by: ted | last post by:
I have an old link that was widely distributed. I would now like to put a link on that old page that will go to a new page without displaying anything.
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9994
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7408
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.