Print Page | Close Window

Linking to Another Web Site in ASP.Net

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=12158
Printed Date: 29 March 2026 at 4:24pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Linking to Another Web Site in ASP.Net
Posted By: Misty
Subject: Linking to Another Web Site in ASP.Net
Date Posted: 13 October 2004 at 12:25pm

I've been trying to figure out how you can put a link to another web site that is in a field from a database. But I am not sure how to do this. I am not sure if hyperlink control is the solution.

Here's my code for a datalist:

<b><a href='<%# DataBinder.Eval (Container.DataItem, "WebSite", "WebSite") %>'>
             Go To Web Site &nbsp;<%# Databinder.Eval(Container.DataItem, "WebSite") %></b></a>

I've solved the problem. See the next posting for more information about how I got it working.




Replies:
Posted By: Misty
Date Posted: 13 October 2004 at 4:22pm

I finally got it to work after changing my code to:   <p> <a href='<%# DataBinder.Eval (Container.DataItem, "WebSite")  %>'><b>
                     Go To Web Site
                     </b></a>

I also figured out how to display an email address from a database. The code is something like: <a href='mailto:<%# DataBinder.Eval (Container.DataItem, "Email") %>'><b>
                     Email
                     </b></a>




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net