• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3930
  • Last Modified:

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

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
cookiejar
Asked:
cookiejar
2 Solutions
 
eli411Commented:
using VerticalAlignment = "Top" in your label
0
 
Paul JacksonCommented:
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
 
CAVccCommented:
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now