Solved

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

Posted on 2013-11-22
3
3,363 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
Comment Utility
using VerticalAlignment = "Top" in your label
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 250 total points
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now