PC Review


Reply
Thread Tools Rate Thread

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
MasterPage changing Content Page pvong Microsoft ASP .NET 18 8th Dec 2008 09:17 PM
changing the metatags of masterpage from content page Sinan Alkan Microsoft ASP .NET 1 17th Sep 2008 03:37 AM
changing the metatags of masterpage from content page Sinan Alkan Microsoft C# .NET 1 17th Sep 2008 03:37 AM
How to change content in MasterPage by clicking a button? Bon Microsoft ASP .NET 7 26th Dec 2006 09:52 AM
open pdf or othe page link into content page in masterpage Shailesh Patel Microsoft ASP .NET 2 15th Nov 2006 08:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:41 PM.