Jump to content

how to make link on retrieved data from database


vadder85

Recommended Posts

we'll need to see some code and be more specific....what pages are you talking about and what is the data?
Here's the code:<%@ Page Language="vb" AutoEventWireup="false" Codebehind="store_directory.aspx.vb" Inherits="FYP2007.store_directory" %><%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %><HEAD> <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"> <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE"> <meta content="http://schemas.microsoft.com/Mobile/Page" name="vs_targetSchema"></HEAD><body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm"> <mobile:form id="Form1" BackColor="#80FFFF" runat="server"><mobile:Label id="Label1" runat="server" Font-Name="Arial" ForeColor="Black" Font-Size="Large" Font-Bold="True" Alignment="Center">Store Directory</mobile:Label> <mobile:Image id="Image1" runat="server" Alignment="Center" ImageUrl="/FYP2007\images\Paper_Shopping_Bags.gif"></mobile:Image> <mobile:List id=List1 runat="server" DataSource="<%# DataSet11 %>" DataTextField="category_name" DataMember="store_directory" Decoration="Bulleted" DataValueField="category_id"> </mobile:List> <mobile:Link id="Link1" runat="server" Alignment="Center" NavigateUrl="default.aspx">Home</mobile:Link><mobile:Link id="Link3" runat="server" Alignment="Center" NavigateUrl="search_store.aspx">Search Store</mobile:Link><mobile:Link id="Link4" runat="server" Alignment="Center" NavigateUrl="search_item.aspx">Search Item</mobile:Link></mobile:form></body>and here is my print screenstore_directorynew.jpgdid you see the links below the image..that one I got the data from Access Database..ok,now how can I make each of the link connected to it own page that will be created later...i hope u got my explanation
Link to comment
Share on other sites

you could store the url in the databse as well you would just have ot make sure you created the pages withte h exact names.
Ok,I would like to show you somethingdo_postback.jpgdid you see the javascript on bottom of the page?now,that link appear when I put my mouse on top of Books,Gifts,Toys,and Hobbies link? How can I change the link into my desired page? can you explain more regarding on your previous answer.quite blur..sorry..hehe
Link to comment
Share on other sites

It looks like you might have used a LinkButton control in .NET to generate your links on the page. LinkButtons post back to the server just like regular Buttons will - using client-side javascript to run a function like __doPostBack();. If you would rather have a hyperlink, you might try using a HyperLink control instead.

<asp:HyperLink id="FashionLink" runat="server" />

Then, in the code behind, you can set the URL for that link using the NavigateUrl property:

FashionLink.NavigateUrl = "http://www.mysite.com/fashion.html";  // you can get this value from the database...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...