Maximizing.ASP.dot.NET.Real.World.ObjectOriented.Development [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Maximizing.ASP.dot.NET.Real.World.ObjectOriented.Development [Electronic resources] - نسخه متنی

Jeffrey Putz

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Validation Controls


The ASP.NET validation controls are one of the first "gee whiz" features that are introduced to a lot of developers, and rightfully so. These controls take some of the grunt work out of making sure that user input meets certain criteria. If any of these controls finds the input to be invalid, it can display an error message, and the Page object's IsValid property returns false.[View full width]

<asp:RequiredFieldValidator id="checkName" runat="server" controlToValidate="NameTextBox"
text="Please enter a name." />

All of the details required to make this control work are declared right there on the page. You've seen the id and runat attributes in every control, but controlToValidate instructs the control to check on a TextBox control, while the text attribute indicates what the error message to the user should be.

These are among the simplest declarative controls in ASP.NET, but they still save us a bit of work. Using them in Visual Studio is even easier, as we can drag and drop them from the toolbox and set the attributes in the property window.


/ 146