CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 5/25/2006 6:50:04 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 42 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
Plucky
Asp.Net User
Can a UserControl use a Masterpage? Why not?5/25/2006 6:50:04 PM

0/0

   I need to create a control that puts a box around any content i desire.  I've done this with 2 usercontrols in the past (1 to open a table, 2nd to close the table around the content). 

I thought masterpages would be a better solution...but i can't use masterpagefile=Box.master within a control directive...

This: <%@ Control MasterPageFile="~/MasterPages/Box1.master" %>
produces: Error parsing attribute 'masterpagefile': Type 'System.Web.UI.UserControl' does not have a public property named 'masterpagefile'.

Any ideas on what approach i should be taking?  Or if there is another way to impliment masterpages in a usercontrol?

  
bmains
Asp.Net User
Re: Can a UserControl use a Masterpage? Why not?5/25/2006 7:10:41 PM

0/0

Hey,

No, masterpages are for the page only; user controls compile as part of the page as a control, and that is by design.  Why not create a custom panel control, that renders whatever around the content in the panel?


Brian

"Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4).
MorningZ
Asp.Net User
Re: Can a UserControl use a Masterpage? Why not?5/25/2006 7:22:38 PM

0/0

To back up what's posted right above this one, maybe this post will help

http://forums.asp.net/thread/1274884.aspx

This is the perfect time for making your own WebControl (not Usercontrol)


"If you make it idiot proof, they'll build a better idiot"
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
Pro ASP.NET 2.0 Website Programming Authors: Damon Armstrong, Pages: 641, Published: 2005
Visual Web Developer 2005 Express Edition For Dummies Authors: Alan Simpson, Pages: 358, Published: 2005
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
Microsoft Visual C# 2005 Unleashed Authors: Kevin Hoffman, Pages: 692, Published: 2006
Professional C# 2005 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Allen Jones, Pages: 1540, Published: 2006
ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007
Professional C# 2005 with .NET 3.0 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1748, Published: 2007
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005
Core Internet Application Development with ASP.NET 2.0 Authors: Randy Connolly, Pages: 1049, Published: 2007

Web:
Can a UserControl use a Masterpage? Why not? - ASP.NET Forums Re: Can a UserControl use a Masterpage? Why not? 05-25-2006, 3:10 PM. Contact ... Re: Can a UserControl use a Masterpage? Why not? 05-25-2006, 3:22 PM ...
MasterPage Class (System.Web.UI) When you use a master page and its related content pages, ... those that are available on a UserControl object. They can include the following attributes: ...
Can I create a masterpage template in asp.net for usercontrols as ... Jul 19, 2007 ... No Sorry, you can't use masterpages. Two things come to my mind: First, you coul ddo this using inheritance. Create a master usercontrol and ...
User control with javascript events and masterpage - .NET Forum I also have a master page and when I use Page.RegisterClientScriptBlock(... I get an IE error 'null' is null or not a null object. ...
Basics: Master Page FAQ - Eric Wise Can I dynamically set a master page at runtime? Certainly! Use the page_preinit ... I have added one usercontrol on the masterpage, but i want to access the ...
MasterPage vs User Control - ASP.NET Forums I would use both. I mainly use masterpages for doing layout changes. ... In fact , I can't think of any reason not to use both! Big Smile ...
Do you prefer Master Page or User Controls? Page can be funky. ... Master pages are not really user control. .... userControls (they are). I use MasterPages quite frequently as they ...
ASP.NET web user control on masterpage not maintaining state - Dev ... Jan 3, 2008 ... NET web user control on masterpage not maintaining state- . ... with a textbox where they can type keywords and click on the search button, ...
Outputcache - How to not cache Master Page - SitePoint Forums Ok I found an interesting article --I can use the substitution technique ... I'm not sure how can you prevent the user control to be cached, ...
patterns & practices: Web Client Software Factory Contrib ... If I use a usercontrol with a ServiceDependency and add it to a page that does not use a masterpage it works great. However, if the control is contained in ...




Search This Site:










hiding sitemapnodes in menu from sitemapprovider

how to set nodeindex of treeview at page_load ?

where is the "media" attribute in a request?

accessing controls from the master page's code behind

theme woes (a tale of two servers)

treeview state when using populateondemand

scroll content of master page such as <frame>

treeview customization with web.sitemap vs. programmatic setup

best way to completely change a whole site....

automatic <title> with sitemap

content disapears??? css

master page is not working properly with the page set in the loginurl of authentication element.

vs.net - master pages

how to add serverside code dynamically from db

manipulating treeview nodes

dynamic stylesheet loads and server.transfer

scrolling to a treeview node

frames & master pages

dynamically create sitemap for each user - help please

masterpage & crosspagepostback woes...

treeview, direct link to a node: how to?

viewstate not saved on master page

how to set hide the asp:menuitem?

pass an id from a querystring to a formview textbox

how can i add a checkmark to a menu item

menu control and the popoutimage

page not displayed correctly in web browser

passing values from popup to webform using master pages

page last updated date

sitemappath - using a non-default xml in a user control

  Privacy | Contact Us
All Times Are GMT