DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 2 Aug 2007 17:09:40 -0400,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Max2006 am
          2    Alexey Smirnov
          3    (Walter Wang [MSFT])
          4    Mark Rae [MVP]
          5    (Walter Wang [MSFT])


How to apply master pages to ascx files.   
Hi,

Is there any technique that allows me to have a usercontrols based on 
MasterPages?
I know that MasterPages are designed for aspx pages. I wonder that I can 
apply them to ascx files.

Thank you,
Max
Date:Thu, 2 Aug 2007 17:09:40 -0400   Author:  

Re: How to apply master pages to ascx files.   
On Aug 2, 11:09 pm, "Max2006" <alanal...@newsgroup.nospam> wrote:

> Hi,
>
> Is there any technique that allows me to have a usercontrols based on
> MasterPages?
> I know that MasterPages are designed for aspx pages. I wonder that I can
> apply them to ascx files.
>
> Thank you,
> Max


Max, I think you can create a base class which can be inherited by all
your user controls

here's a small tip how it can be implemented (it's about aspx, but
it's the same)
http://www.codeguru.com/csharp/.net/net_asp/webforms/article.php/c11939/
Date:Thu, 02 Aug 2007 14:30:25 -0700   Author:  

RE: How to apply master pages to ascx files.   
Hi Max,

I'm afraid MasterPages cannot be used on UserControl.

However, I'm not sure your objective here. Based on my understanding, 
UserControl is designed to be re-used. For example: if you need to use the 
controls layout in a UserControl, simply put an instance of it on your new 
UserControl.

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Fri, 03 Aug 2007 06:50:37 GMT   Author:  

Re: How to apply master pages to ascx files.   
"Max2006" <alanalan1@newsgroup.nospam> wrote in message 
news:Og6gklU1HHA.3536@TK2MSFTNGP06.phx.gbl...


> Is there any technique that allows me to have a usercontrols based on 
> MasterPages?


No - in fact, MasterPages are UserControls too...


> I know that MasterPages are designed for aspx pages. I wonder that I can 
> apply them to ascx files.


Generally speaking, a UserControl is designed for re-use, so you shouldn't 
need to worry about this - just drop it onto the page where required, and 
let its controls assume their styles from whichever CSS is in use for the 
main page...


-- 
Mark Rae
ASP.NET MVP
http://www.markrae.net
Date:Fri, 3 Aug 2007 08:52:17 +0100   Author:  

RE: How to apply master pages to ascx files.   
Hi Max,

I'm writing to check the status of this post. Please feel free to let me 
know if there's anything else I can help. Thanks.

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Tue, 07 Aug 2007 08:52:14 GMT   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us