Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

web user control in a master page?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stimp - 11 Mar 2008 18:43 GMT
I have a few master page files on a large site.

I want them all the share the same footer, but I don't want to re-enter
the footer text on all of them.

So I logically thought I could add a web user control to the master page
which would contain the footer text.

so I add:

<%@ Register TagPrefix="gn" TagName="gnfooter" Src="/gnfooter.ascx"
%>

<gn:gnfooter id="ctlFooter" runat="server" />

but I keep getting an error saying "gnfooter is not a known element".

Are user controls not allowed in master pages?

What would the alternative be to this problem?

Thanks.
Signature


fiddlewidawiddum

Peter Bucher [MVP] - 11 Mar 2008 19:48 GMT
Hello Stim

>I have a few master page files on a large site.
>
[quoted text clipped - 3 lines]
> So I logically thought I could add a web user control to the master page
> which would contain the footer text.
Keyword: Nested masterpages
UserControls are surely allowed on masterpages,
check your src-attribute.

Signature

Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET

Stimp - 11 Mar 2008 20:44 GMT
> Hello Stim
>
[quoted text clipped - 8 lines]
> UserControls are surely allowed on masterpages,
> check your src-attribute.

ah yes... "~/gnfooter.ascx" was the solution!

cheers!

Signature

fiddlewidawiddum

Peter Bucher [MVP] - 11 Mar 2008 21:56 GMT
Hello Stimp

> ah yes... "~/gnfooter.ascx" was the solution!
Fine

But, the other solution with nested masterpages is also a one to think about
:-)

Signature

Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.