ContentPlaceHolder under a DIV tag - Visual Studio Design view?

J

jobs

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.
 
N

nahid

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
 
J

jobs

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>
 
N

nahid

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
 
A

Alan Silver

jobs said:
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
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top