Solved

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

Posted on 2013-11-22
3
3,514 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

777 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