ContentPlaceHolder under a DIV tag - Visual Studio Design view? : DOTNET
This is a discussion on ContentPlaceHolder under a DIV tag - Visual Studio Design view? within the DOTNET forums in Framework and Interface Programming category; Hello. I have a master page with ContentPlaceHolder under a html Div tag. That DIV tag has CSS that positions it. While in Visual Studio design view, that div tag and contentplace holder does not appear where it actually shows up when you run it the code. Is DIV the best way to go? How else can I do this? ContentPlaceHolder does not appear to all for a style setting. Thanks for any help or information....
| DOTNET Discussion forums related to Microsoft Dot net technologies, CSharp and other related items |
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| I have a master page with ContentPlaceHolder under a html Div tag. That DIV tag has CSS that positions it. While in Visual Studio design view, that div tag and contentplace holder does not appear where it actually shows up when you run it the code. Is DIV the best way to go? How else can I do this? ContentPlaceHolder does not appear to all for a style setting. Thanks for any help or information. |
|
#2
| |||
| |||
| On Jul 12, 10:21 pm, jobs <j...@webdos.com> wrote: > Hello. > > I have a master page with ContentPlaceHolder under a html Div tag. > That DIV tag has CSS that positions it. > > While in Visual Studio design view, that div tag and contentplace > holder does not appear where it actually shows up when you run it the > code. > > Is DIV the best way to go? How else can I do this? ContentPlaceHolder > does not appear to all for a style setting. > > Thanks for any help or information. hi, don't worry vs not suport design time of masterpage check it http://aspnet.4guysfromrolla.com/articles/010505-1.aspx some copy paste from this article Implement the needed HTML on each and every page on our site Pros: Visual Studio .NET will provide a rich, WYSIWYG design-time experience for each page. Cons: If we want to change the look and feel of the site, we need to edit every single page! Implement the layout using a "top" and "bottom" User Control, which will be added to each page Pros: Altering the site's layout only involves changing at most two files - the top and bottom User Controls. Cons: Have to manually add the top and bottom User Controls to all pages; no WYSIWYG support. Utilize MasterPages support in ASP.NET 1.x Pros: Can easily change the site layout by editing just the MasterPage; allows for a more fluid layout than kludging together top and bottom User Controls. Cons: No WYSIWYG design-time support in VS.NET. nahid http://nahidulkibria.blogspot.com/ http://www.kaz.com.bd |
|
#3
| |||
| |||
| Thanks, but is DIV the best way to position my ContentPlaceHolder in my master page. It does not appear to be positioning my child content pages in same location: <div id= "DivContent" class="DivContent" > <asp:ContentPlaceHolder ID="Content1" runat="server" > </asp:ContentPlaceHolder> </div> ... css file ..DivContent { position:absolute; left:105px; width:700px; height:600px; top:220px; background-color: rgb(246,246,246); overflow: auto; } ... child page: (the master page shows up, but the changepassword control appears to be in the upper left. outside the contentplaceholder. %@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/Main/ MasterPage.master" CodeFile="ChangePassword.aspx.vb" Inherits="Service_test" %> <<asp:Content ID="Content1" ContentPlaceHolderID="Content1" runat="Server"> <asp:ChangePassword ID="ChangePassword1" runat="server"> </asp:ChangePassword> </asp:Content> |
|
#4
| |||
| |||
| On Jul 13, 3:52 am, jobs <j...@webdos.com> wrote: > Thanks, but is DIV the best way to position my ContentPlaceHolder in > my master page. > > It does not appear to be positioning my child content pages in same > location: > > <div id= "DivContent" class="DivContent" > > <asp:ContentPlaceHolder ID="Content1" runat="server" > > </asp:ContentPlaceHolder> > </div> > > .. css file > > .DivContent > { > position:absolute; > left:105px; > width:700px; > height:600px; > top:220px; > background-color: rgb(246,246,246); > overflow: auto; > > } > > .. child page: (the master page shows up, but the changepassword > control appears to be in the upper left. outside the > contentplaceholder. > > %@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/Main/ > MasterPage.master" > CodeFile="ChangePassword.aspx.vb" Inherits="Service_test" %> > <<asp:Content ID="Content1" ContentPlaceHolderID="Content1" > runat="Server"> > <asp:ChangePassword ID="ChangePassword1" runat="server"> > </asp:ChangePassword> > </asp:Content> hi, i'm try this way in master page <form id="form1" runat="server" > <div class="DivContent "> <asp:contentplaceholder id="ContentPlaceHolder1" runat="server"> </asp:contentplaceholder> </div> </form> and in child page <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <div style="text-align:center"> <asp:ChangePassword ID="ChangePassword1" runat="server"> </asp:ChangePassword> </div> </asp:Content> ...css ..DivContent { position:absolute; left:105px; width:700px; height:600px; top:220px; background-color: rgb(246,246,246); overflow: auto; } both style are working fine to me nahid http://nahidulkibria.blogspot.com/ http://www.kaz.com.bd |
|
#5
| |||
| |||
| In article <1184277157.955742.142040@22g2000hsm.googlegroups.com>, jobs <jobs@webdos.com> writes >Thanks, but is DIV the best way to position my ContentPlaceHolder in my >master page. Yes, positioning should always be done with CSS, and divs are the logical way to do that, unless the content in question has a natural block element around it (such as a <ul> for example, you can position this directly and so don't need to wrap it in a div). >It does not appear to be positioning my child content pages in same >location: This sounds like a CSS problem, not one to do with ASP.NET or master pages. I suspect you will be making work for yourself by trying to tackle this problem from within VS. Try saving the generated source of the page (File->Save in your browser), and tinker around with the (X)HTML and CSS until you get it working. Then copy the changes back into the master page and CSS file. FWIW, I always design, test and debug (X)HTML and CSS in plain text files from a text editor, I never do this from VS. I work with sample content, or content generated from a real ASP.NET page, but saved from the browser. That way you are concentrating on the real issue at hand. HTH -- Alan Silver (anything added below this line is nothing to do with me) |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Design-Time Attribute for a Font Array in Visual Studio 2005 | usenet | DOTNET | 0 | 07-13-2007 05:29 AM |
| How to take an IE rendered screenshot of a website with visual studio .net 2002 or visual stuido .net 2003? I can't install visual studio .net 2005 on this computer. | usenet | DOTNET | 4 | 05-17-2007 01:57 PM |
| How to take an IE rendered screenshot of a website with visual studio .net 2002 or visual stuido .net 2003? I can't install visual studio .net 2005 on this computer. | usenet | DOTNET | 1 | 05-14-2007 02:06 PM |
| Visual Studio 2005 and XML Data view | usenet | XML SOAP | 2 | 03-14-2006 04:52 AM |
| ODBC, MySQL Visual Studio .net and DESIGN time | usenet | DOTNET | 0 | 04-27-2004 01:19 AM |
All times are GMT -5. The time now is 08:38 AM.


