Solved

ASP.NET - How to align a label with its MultiLine textbox

Posted on 2013-11-22
3
3,576 Views
Last Modified: 2013-11-26
I am using Visual Studio 2005, I am using the FormView Control.  I have a text box with a a label on a form.  The TextBox TextMode is set to "MultiLine" and the Rows = 4; Width is "216px".  The label of the textbox is located at the bottom leftside of the Textbox (see the attachment).  I would like to lable to be at the upper leftside of the label.  Do you have a solution on how I can do this.

I would appreciate a response as soon as possible.  Lately, I've not received a response.  I've deleted the questions and googled for a solution.
form.png
0
Comment
Question by:cookiejar
3 Comments
 
LVL 2

Expert Comment

by:eli411
ID: 39670716
using VerticalAlignment = "Top" in your label
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 250 total points
ID: 39670719
Set the vertical=align css property for the label :

<asp:Label ID="Label4" runat="server" Text="Message" Width="15%" Style="vertical-align: top;">
</asp:Label>
0
 
LVL 3

Assisted Solution

by:CAVcc
CAVcc earned 250 total points
ID: 39670749
Just a guess here but it looks as though maybe you are using a table for your controls, maybe a div.  However you can use this example setting the valign property on the tablerow tag to "top".

Here is a small example and screen shot:

<body>
    <form id="form1" runat="server">
    <div>
   
        <table class="style1">
            <tr>
                <td valign="top">
                    <asp:Label ID="Label1" runat="server" Text="Description:" ></asp:Label>
                </td>
                <td valign="top">
                    <asp:TextBox ID="TextBox1" runat="server" Height="109px" Width="828px"
                        TextMode="MultiLine">No Description Available</asp:TextBox>
                </td>
            </tr>
        </table>
   
    </div>
    </form>
</body>
screen.PNG
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question