TheDevTeam

.Net bug when adding 'MaxLength' attribute to MultiLine Textboxes

Another little hidden feature within .Net for you!

.Net kindly ignores the ‘MaxLength’ attribute for a textbox with it’s ‘TextMode’ set to ‘MultiLine’, if it is set within the frontend files.

Woop! Why I’m not sure, but the simple workaround is to do this within the backend. Personally I choose to do it within the PreRender method.

 

<!-- Omits MaxLength Attribute -->
<asp:TextBox ID="Textbox1" Runat="server" TextMode="MultiLine" MaxLength="500" />

<!-- Fixed via adding MaxLength attribute in Backend code -->
<asp:TextBox ID="Textbox1" Runat="server" TextMode="MultiLine" />

 

// Add MaxLength attribute via code
Textbox1.Attribute.Add("maxlength", "500");

 

That’s all folks! Keeping it nice and simple Wink

Read more about Dave Radley on

Related to .Net bug when adding 'MaxLength' attribute to MultiLine Textboxes

Postcode Profiler

Find out what is going on in your Post Code

Data for Microsoft Power Bi

With the amount of data available to you growing exponentially, we're here to help you make sense of it all. There are now many business intelligence tools available from companies such as Microsoft, Google and Tableau but you'll need experts in data analysis if you want to make sense of it. That's where we fit in.

Eclipse Page Counter

Our O&M Manuals division collate vast quantities of information for inclusion in the H&S manuals for the construction industry.


Knowledge Base

Data for Microsoft Power Bi

With the amount of data available to you growing exponentially, we're here to help you make sense of it all. There are now many business intelligence tools available from companies such as Microsoft, Google and Tableau but you'll need experts in data analysis if you want to make sense of it. That's where we fit in.

Eclipse EMail PowerBI Reporting Example

Eclipse EMail is available to all organisations, regardless of whether or they already exist as clients of TheDevTeam. Integrate your email services with all your other business data. Well structured, targeted campaigns can be finely tuned and developed as you learn to interpret the wealth of information that's generated as a result.

PowerBI digger production example using Eclipse

There are literally thousands of different types of reports you can extract from our mining production tracking system: Eclipse Miningware. This article is a brief demonstration of just one; a daily report for the diggers which worked in production "yesterday".

Software Development Skills

Productivity in software development has improved even faster than the hardware - Moore's Law - double the power every 18 months.

Address:
The Dev Team
8 The Lawn,
St Leonards-On-Sea,
East Sussex, TN38 0HH