CHAPTER 8 ?– USING THE ASP.NET AJAX CONTROL TOOLKIT (PART 2) 170
FilteredTextBox Extender
A common function of a client web application is data entry through forms. The typical
workflow for forms is that the user enters information, and a special type of input tag
called a submit button triggers an HTTP postback of the information to a server. The
server then processes the submitted information and returns a response. If the data is
invalid, the server returns a message indicating this, and the page developer writes a
script that emphasizes this to the user. This transaction involves at least one round-trip
to the server. You can also perform basic validation in JavaScript prior to form submission;
this can be very effective and certainly faster for the user. However, performing
validation using JavaScript can be a complex task, which ASP.NET AJAX control extenders
lend themselves naturally to.
The FilteredTextBox extender is very useful in that it forces inline validation on a target
control. You can apply a custom validator or one of the provided ones to a TextBox
control and prevent the user from entering invalid input.
Pages:
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246