Click here to Skip to main content
15,878,602 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi i want to create Custom Server Controls for TextBox
in that i want to set textBox length as 5 or 10 when
user Type MaxLength attribute then value should be only 5 or 10 to set
for ex
<cc1:TextBox runat="server" MaxLength="5">
5 or 10 should be visible in option

plz help
Posted
Comments
Sergey Alexandrovich Kryukov 3-Feb-14 16:47pm    
Did you try to add any? What happened?
—SA

Control's properties in ASP.NET are no different from any other properties: http://msdn.microsoft.com/en-us/library/65zdfbdt.aspx[^].

—SA
 
Share this answer
 
Refer

Create Custom Control and Properties[^]

Custom Control with Custom Properties[^]

And for the last qusetion ,
Quote:
5 or 10 should be visible in option


You can use enum for using predefined values which will appear on the Markup to select.

Refer
http://stackoverflow.com/questions/1604287/create-property-in-asp-net-control-to-c-sharp-and-aspx[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900