Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

ContentPlaceHolder under a DIV tag - Visual Studio Design view?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jobs - 12 Jul 2007 17:21 GMT
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.
nahid - 12 Jul 2007 17:29 GMT
> Hello.
>
[quoted text clipped - 9 lines]
>
> 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
jobs - 12 Jul 2007 22:52 GMT
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>
nahid - 14 Jul 2007 05:31 GMT
> Thanks, but is DIV the best way to position my ContentPlaceHolder in
> my master page.
[quoted text clipped - 33 lines]
>     </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
Alan Silver - 17 Jul 2007 10:14 GMT
>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

Signature

Alan Silver
(anything added below this line is nothing to do with me)


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.