ContentPlaceHolder under a DIV tag - Visual Studio Design view?

Discussion in 'ASP .Net' started by jobs, Jul 12, 2007.

  1. jobs

    jobs Guest

    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.
    jobs, Jul 12, 2007
    #1
    1. Advertising

  2. jobs

    nahid Guest

    On Jul 12, 10:21 pm, jobs <> 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
    nahid, Jul 12, 2007
    #2
    1. Advertising

  3. jobs

    jobs Guest

    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>
    jobs, Jul 12, 2007
    #3
  4. jobs

    nahid Guest

    On Jul 13, 3:52 am, jobs <> 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
    nahid, Jul 14, 2007
    #4
  5. jobs

    Alan Silver Guest

    In article <>, jobs
    <> 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)
    Alan Silver, Jul 17, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    2,922
    Christopher Reed
    Feb 11, 2006
  2. Greg
    Replies:
    4
    Views:
    14,874
    dassyms
    Apr 17, 2006
  3. Rolf Welskes
    Replies:
    3
    Views:
    450
    Rolf Welskes
    Oct 6, 2006
  4. Robert Smith
    Replies:
    2
    Views:
    1,222
    Juan T. Llibre
    Apr 27, 2008
  5. Greg
    Replies:
    1
    Views:
    198
    Ward Bekker
    Mar 23, 2006
Loading...

Share This Page