?
Solved

How can I create hyperlink in a datalist control in asp.net   ?

Posted on 2008-06-16
1
Medium Priority
?
1,477 Views
Last Modified: 2013-11-07
How can i create a hyperlink to the image in the following datalist   ? thanks


<body>
    <form id="form1" runat="server">
    <div>
       <asp:AccessDataSource ID="AccessDataSource1" runat="server"  DataFile="~/images.mdb"
            SelectCommand="SELECT [ID], [Name], [L] FROM [images]"></asp:AccessDataSource>
        <asp:DataList ID="DataList1" runat="server"   RepeatColumns="5"  DataKeyField="ID" DataSourceID="AccessDataSource1">
            <ItemTemplate>
             
               <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>'></asp:Label><br />
               <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>'></asp:Label><br />
               <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("L") %>' /><br />
               <asp:Button ID="Button1" runat="server" Text="Button" />
                <br />                                
            </ItemTemplate>
        </asp:DataList></div>
       
    </form>
</body>
0
Comment
Question by:ernartey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 14

Accepted Solution

by:
ajitha75 earned 2000 total points
ID: 21799326
Instead of Image control use Hyperlink control as below

<asp:Hyperlink id="linkToPage" ImageUrl='<%# Eval("L") %>' runat="server" NavigateUrl="Default.aspx"></asp:Hyperlink>
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question