RE: How to create a label which only displays a certain amount of characters?
v-jetan_at_online.microsoft.com
Date: 03/04/04
- Next message: Oscar Rodriguez: "Re: [ Custom Controls ] Insertar tags dentro de <HEAD>"
- Previous message: BaluSmiles: "Re: how to capture which Tree node is clicked and its ID in client side javascript"
- In reply to: Daniel Walzenbach: "How to create a label which only displays a certain amount of characters?"
- Next in thread: Daniel Walzenbach: "RE: How to create a label which only displays a certain amount of characters?"
- Reply: Daniel Walzenbach: "RE: How to create a label which only displays a certain amount of characters?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 04 Mar 2004 06:13:53 GMT
Hi Daniel,
Thank you for posting in the community!
Based on my understanding, you want the WebForm Label control to only
display certain amount of characters.
=====================================
I think you should inherit the Label class and override the Text property.
As you said, this does not work as you expected, can you show me how you do
with your Text property? Why it does not work as you expected?
I think you may do like this(Suppose you only want to display the Text's
length less than 8 ):
public class WebCustomControl1 : System.Web.UI.WebControls.Label
{
public override string Text
{
get
{
return base.Text;
}
set
{
if(value.Length<=8)
{
base.Text=value;
}
else
{
this.Page.Response.Write("The value you set is greater than 8!");
}
}
}
}
=====================================
Please apply my suggestion above and let me know if it helps resolve your
problem.
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
- Next message: Oscar Rodriguez: "Re: [ Custom Controls ] Insertar tags dentro de <HEAD>"
- Previous message: BaluSmiles: "Re: how to capture which Tree node is clicked and its ID in client side javascript"
- In reply to: Daniel Walzenbach: "How to create a label which only displays a certain amount of characters?"
- Next in thread: Daniel Walzenbach: "RE: How to create a label which only displays a certain amount of characters?"
- Reply: Daniel Walzenbach: "RE: How to create a label which only displays a certain amount of characters?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|