Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2016, 02:38 PM
Authorized User
 
Join Date: Dec 2015
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
Default Open an url that's contianed in a variable

I thought that this would be a very simple issue but have been Googling it for the last three days without any success.

In my modified “PlanetWrox.com” web site (TRTDevelopment.com) I would like to add an additional column to the “Reviews” table (in my case “Songs” table). This column would contain a hyperlink to the review (in my case song). Then I would like to display this hyperlink in the “ViewDetails” window. So far so good, I’ve had no trouble accomplishing this task.

Now, I would like to be able to click on the displayed hyperlink and navigate to that page on the Web. Please note that the hyperlink I display in the DetailsView window was obtained from a query to the “Reviews Table” and is contained in a variable (right now I have it stored in a label.text). It seemed all I would have to do was use something like the following:

<asp:Label ID="ClipLabel" runat="server"><a href= "ClipLabel.Text" /></asp:Label>

admittedly this is in it’s very simplest form.

I’ve also tried using a HyperLink control but again the “NavagateUrl” does not accept a variable as an attribute.

I don’t know why I’m having so much trouble with this issue as you see this kind of thing done on all kinds of web sites. Any help in pointing me toward a solution would be greatly appreciated
 
Old September 17th, 2016, 05:39 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Why do you have the URL in a variable and not in a data binding expression? In the latter case, you could simply bind the HyperLink control to a column in the data source.

Can you provide a more detailed description and your code?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to open the url using java program. GuyKenton Java Basics 1 April 10th, 2014 12:13 PM
url as a variable Joe-Mama Beginning PHP 2 April 10th, 2011 08:53 PM
How to Open Url AccessAasif@aol.com C# 2005 3 November 21st, 2007 05:14 PM
I am not able to open my reports in with URL sha_shivani Reporting Services 2 June 12th, 2007 01:49 AM
I am notable to open my reports through URL sha_shivani BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 1 May 10th, 2007 04:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.