label property problem in asp.net

Reply

Join Date: Dec 2007
Posts: 38
Reputation: omotoyosi is an unknown quantity at this point 
Solved Threads: 1
omotoyosi omotoyosi is offline Offline
Light Poster

label property problem in asp.net

 
0
  #1
Oct 9th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 182
Reputation: Kusno is an unknown quantity at this point 
Solved Threads: 15
Kusno's Avatar
Kusno Kusno is offline Offline
Junior Poster
 
0
  #2
Oct 12th, 2009
Originally Posted by omotoyosi View Post
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:
  1. Span.RFS
  2. {
  3. direction:rtl;
  4. background-color:White;
  5. }

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> 
    <link href="../Style.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server" >
    <asp:Label ID="Label1" runat="server" BackColor="#FFFFC0" CssClass="RFS"></asp:Label>
    </form>
 </body>  
</html>
NEVER NEVER NEVER GIVE UP
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 6
Reputation: shenulal is an unknown quantity at this point 
Solved Threads: 2
shenulal shenulal is offline Offline
Newbie Poster
 
0
  #3
Oct 13th, 2009
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
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the ASP.NET Forum


Views: 411 | Replies: 2
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC