2010-04-13 4 views

Répondre

8

C'est la propriété pour voir combien de temps le texte est au cours d'une postback:

TextBox.Text.Length; 

TextBox: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.aspx

propriété Text: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.text.aspx

Longueur de chaîne Propriété: http://msdn.microsoft.com/en-us/library/system.string.length.aspx

String str = TextBox.Text; 

if(str.Length > 50) 
{ 
    str = str.SubString(0, 50) + "<br/>" + str.SubString(50); 
} 
+0

Comment compter les charachters dans la zone de texte, et si les nubmers dépasse 50, ajouter
tag dans charachters? –

0

Comment compter les charachters dans la zone de texte, et si les nubmers dépasse 50, ajouter
tag dans charachters?

Questions connexes