How do I place my WebForm where I want it to be * sigh * ....?

See how it looks right now: alt text

How can I get the ContentPlaceHolder to go where I have drawn? Thanks for the help.

I mostly program in WinForms, so I'm used to just drag and drop things. Why can't I do it here. Help me SO!

Edit: here's what I have in my CSS:

.Form
{
    position:absolute;
    left:60px;
}

      

How can I use this in my form code:

<%@ Page Title="" Language="C#" MasterPageFile="~/EndUserMasterPage.Master" AutoEventWireup="true" CodeBehind="RegistroNuevoPostulante.aspx.cs" Inherits="WebSite.RegistroNuevoPostulante" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>

      

+2


source to share


4 answers


Screw the designer and study HTML and CSS to understand what's going on.

I mostly program in WinForms, so I'm used to just drag and drop things. Why can't I do it here.



Because the layout engine follows different rules. It's not like you have a pixel screen and you have complete control over each one.

What you absolutely need to know is the difference between Block Level Elements and Inline elements and the Box Model . Before you understand, at least it will be difficult to accomplish.

+3


source


You will need to trick your hands. What you expected from a designer (Windows Forms behavior similar to behavior) was previously called grid, which was a feature of ASP.NET 1.x. It has been removed. As you might expect, this is only "good" (in theory) in Internet Explorer.

I recommend you check out some of the w3schools css tutorials . This link can be a starting point. You need to look into a few div style attributes to achieve what you want like float, margin and padding.



You can also try the reverse engineering approach and get a free oswd template where I'm sure there is a template that solves your problem. You can use firefox + firebug to see how everything was achieved.

+2


source


You can only accomplish the simplest things with a visual designer. If you really want to do something, you need to go to the original view.

The code you have to use will include something like setting the left margin to ContentPlaceHolder

. This can be done using something like:

<div style="margin-left: 200px;">
  <asp:ContentPlaceHolder ... ></asp:ContentPlaceHolder>
</div>

      

Please note that this should go on the homepage, not on your form.

+1


source


I think this should work:

    <div id="divX" class="yourCssClass">
        <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"></asp:Content>
    </div>

      

I did not find any problems with this code and I am sure that you can easily place the content of the child pages anywhere using CSS (defining yourCssClass).

PLEASE NOTE THIS CODE YOU SHOULD REFER TO THE MASTER PAGE CAREFULLY.

Define a CSS class on the master page itself if you want this to be consistent with the website or define it on specific pages accordingly. If you don't know CSS, a little below:

.yourCssClass
{
    margin-left: 60px;
}

      

I am assuming that for the same solution set to recursive, "you injected it into a child page (content web form) that caused you to receive the error" Content is not supported outside of script "! Am I right Papucino?

0


source







All Articles