CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 1/16/2006 9:48:36 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 26 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
NET Developer
Asp.Net User
Hierarchy of Master Pages and User Controls1/16/2006 9:48:36 PM

0/0

I was attempting to componentize my web project with the use of master pages and user controls.  It isn't working the way I thought it would.  What is the proper way of doing this?

Master Page
<body>
   <form id="form1" runat="server">
      <div class="container">
         <asp:ContentPlaceHolder ID="contentplaceholderContent" runat="server">
         </asp:ContentPlaceHolder>
      </div>
   
</form>
</
body>

Content Page
<asp:Content ID="Content1" ContentPlaceHolderID="contentplaceholderContent" runat="Server">
   <FormElement:FormElement ID="FormElement1" runat="Server" />

</asp:Content>

User Control
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

I figure that ASP.NET would compile and render this so all the pieces fit together, but it seems that FormElement1 is inserted after the body tag, floating in space outside the ContentPlaceHolder.  Obviously, something's not right.  Was this not how Master Pages/User Controls were intended to be used?


 

SimonCal
Asp.Net User
Re: Hierarchy of Master Pages and User Controls1/17/2006 7:07:55 PM

0/0

Can you post the exact files you are using here? Ordinarily, the content control in the contentpage will 'replace' that content in the contentplaceholder in the referenced master-page. I don't see how your user-control is being used in your example.


Simon
This posting is provided "AS IS" with no warranties, and confers no rights.
NET Developer
Asp.Net User
Re: Hierarchy of Master Pages and User Controls1/17/2006 7:26:01 PM

0/0

Oh, whoops.  FormElement.ascx is the User Control.  I'm using @Register on the Content Page.  But the issue is that FormElement doesn't replace the <FormElement:FormElement section where it should, but rather places it outside the contentplaceholder right after the body tag.

FormElement.ascx (user control)
<%
@ Control Language="C#" AutoEventWireup="true" CodeFile="FormElement.ascx.cs" Inherits="FormElement" %>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Visual Web Developer 2005 Express Edition For Dummies Authors: Alan Simpson, Pages: 358, Published: 2005
Essential ASP.Net 2.0 Authors: Fritz Onion, Keith Brown, Pages: 345, Published: 2006
Microsoft Visual C# 2005 Unleashed Authors: Kevin Hoffman, Pages: 692, Published: 2006
ASP.NET 2.0 MVP Hacks and Tips Authors: David Yack, Joe Mayo, Scott Hanselman, Fredrik Normén, Dan Wahlin, J. Ambrose Little, Jonathan Goodyear, Pages: 400, Published: 2006
Beginning ASP.NET 2.0 in VB 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1063, Published: 2006
Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional Authors: Matthew MacDonald, Pages: 954, Published: 2007
Beginning ASP.NET 3.5 in VB 9.0: From Novice to Professional Authors: Matthew MacDonald, Pages: 1149, Published: 2007
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005
ASP.NET 3.5 For Dummies Authors: Ken Cox, Pages: 404, Published: 2008
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008

Web:
Hierarchy of Master Pages and User Controls - ASP.NET Forums Hierarchy of Master Pages and User Controls. Last post 01-17-2006 2:26 PM by NET Developer. 2 replies. Sort Posts: ...
ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps Apr 11, 2006 ... Master pages help us build consistent and maintainable user ...... are in the same control hierarchy – the master page is essentially a user ...
Master Pages: Master Your Site Design with Visual Inheritance and ... I have user controls for defining reusable portions of pages. .... The actual merging of the Master Page's control hierarchy and the page's control ...
ASP.NET 2.0 Master Pages changes the Page's control hierarchy ... NET 2.0 Master Pages changes the Page's control hierarchy - level 300 ... In version 2.0 (as it stands in Beta 1), if you user a Master Page along with your ...
Nested Master Pages and Page controls - ng.asp-net-forum ... Master Pages and user controls are nothing new. ... master page and ... some controls have ... control scanning through the hierarchy of master pages above ...
patterns & practices: Web Client Software Factory Contrib ... Traversing the code hierarchy passing the module container so that the control ... Among other things, this enables building user controls and master pages ...
Master Pages Great! But what about Master User Controls? Master pages are coded like user controls and inherit from the control hierarchy in the BCL. That is what Clinton was talking about. ...
Master pages and server control ID - asp.net 2.0 - .NET ASP I use master pages for ensuring a consistent layout on my app. ... ASPX, you could have two user controls with a textbox named "name". ASP. ...
Master Pages and Navigation Notice that you can inherit from any level of the hierarchy—you aren't .... the master and content pages, the event order follows that of User Controls. ...
Web Site Consistency Made Easy with ASP.NET 2.0 Master Pages This control hierarchy is generated at runtime when ASP. ... Notice that Master Pages, along with user controls, are among resource requests that are ...

Videos:
A New Way to look at Networking Google Tech Talks August 30, 2006 Van Jacobson is a Research Fellow at PARC. Prior to that he was Chief Scientist and co-founder of Packet Design. P...
Using ROSE to Mitigate Performance Trade-offs Google TechTalks April 03, 2006 Daniel Quinlan ROSE is a tool for building source-to-source transformation tools for the optimization of C and C++ ...




Search This Site:










wdp for vs2008 still doesn't allow web.config file section replacement of 'system.net'

i can't see the xml comments out of a page?

search engine and asp.net

architecture [gcn 1.2] - a discussion

this application was precompiled with personalization turned off, but it appears to have been turned on after the precompilation, which is not supported.

open-source pdf converter available!!

get mailid of a user when he click on a link of my website that is i sent it as newsletter on his mailid

can't figure out "getfilepathtranslated"

requesting permissions

database encryption

setting up portalname.hostingportalname.com

integration with reports starter kit

is there a way to allow hyperlinks in <pre> tags?

how can i collapse treeview?

why is this so difficult to install on my desktop?

navigateurl

some questions

:( impersonate problem.. plz help...

why i can not use asp page debug?

ok im stumped been trying to figure ou thow i can do this for a couple hours

what does the first line in the page mean?

deleting users and module data

accessdataprovider.updateuser sub not firing

execute server process "request failed"

server error : timeout expired.

newbie to asp .net 2.0

nt authority\anonymous logon error.

properties tab not there anymore

export item template problems with embedded resources

what is the difference between portal and myyahoo?

 
All Times Are GMT