PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

Change MasterPage.File HyperLink in Content Page

 
 
Greg
Guest
Posts: n/a
 
      29th Oct 2008
I have an <asp:HyperLink> control on my master page shown as "Return" I want
this control to always return to a specific page I set in code. How can I
change the "NavigateUrl" value for a MasterPage.File's <asp:Hyperlink>
control?

Thanks,
 
Reply With Quote
 
 
 
 
Joern Schou-Rode
Guest
Posts: n/a
 
      29th Oct 2008
On Wed, 29 Oct 2008 22:58:36 +0100, Mark Rae [MVP]
<(E-Mail Removed)> wrote:

> Master.FindControl("MyMasterHyperLink").NavigateUrl =
> http://www.mysite.com;


An explicit cast will probably help the compiler get it right :-)

((HyperLink)Master.FindControl("MyMasterHyperLink")).NavigateUrl =
"http://www.mysite.com";

--
Joern Schou-Rode
http://malamute.dk/
 
Reply With Quote
 
 
 
 
Greg
Guest
Posts: n/a
 
      30th Oct 2008
This worked great. Much thanks.

"Joern Schou-Rode" wrote:

> On Wed, 29 Oct 2008 22:58:36 +0100, Mark Rae [MVP]
> <(E-Mail Removed)> wrote:
>
> > Master.FindControl("MyMasterHyperLink").NavigateUrl =
> > http://www.mysite.com;

>
> An explicit cast will probably help the compiler get it right :-)
>
> ((HyperLink)Master.FindControl("MyMasterHyperLink")).NavigateUrl =
> "http://www.mysite.com";
>
> --
> Joern Schou-Rode
> http://malamute.dk/
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
document.getElementById(), error in content page content page Dave L Microsoft ASP .NET 3 4th Mar 2010 09:50 AM
Master-Content in Asp.net - How to set individual Head for each content page Rolf Welskes Microsoft ASP .NET 7 22nd Aug 2006 03:47 PM
limit on number of content placeholders(which are editable in content pages) in master page nemesis.saurabh@gmail.com Microsoft ASP .NET 0 25th May 2006 05:44 AM
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz Microsoft ASP .NET 2 27th Apr 2006 06:32 PM
Error: "Content controls can only be used in a content page" J.Edwards Microsoft ASP .NET 0 20th Jan 2006 12:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:32 AM.