0

hello all,
am using asp.net vb . i have a label named label1 but i am passing data into it at runtime which depends on what the user clicks.
My problem now is that
1. How do i do autosize for the label because its not in the label properties

2. how do i align the text in the label

please help

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by shenulal
0

hello all,
am using asp.net vb . i have a label named label1 but i am passing data into it at runtime which depends on what the user clicks.
My problem now is that
1. How do i do autosize for the label because its not in the label properties

2. how do i align the text in the label

please help

For #1:
I think, you don't need anything to autosize it, because it's automatically autosize. Make Width property null or blank.

for #2:
In my way, I use ClassCSS property.
I created CSS file (Style.css) like this:

Span.RFS
{
	direction:rtl;
	background-color:White;	 
}

than in ASPX designer form

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Browse.aspx.vb" Inherits="Browse" EnableSessionState="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Browse</title> 
    [B]<link href="../Style.css" type="text/css" rel="stylesheet" />[/B]
</head>
<body>
    <form id="form1" runat="server" >
    <asp:Label ID="Label1" runat="server" BackColor="#FFFFC0" CssClass="RFS"></asp:Label>
    </form>
 </body>  
</html>
0

hai,
there is nothing to resize for label. It will get resized automatically. Remove the width you have assigned for it and try.
You can write a css for text align like

label.text{text-align: right}

then call it with the css class.

thanks,
Shenu

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.