Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / RequiredFieldValidator.cs / 1305376 / RequiredFieldValidator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.Web.UI.WebControls { using System.ComponentModel; using System.Web; using System.Web.Util; ////// [ ToolboxData("<{0}:RequiredFieldValidator runat=\"server\" ErrorMessage=\"RequiredFieldValidator\">{0}:RequiredFieldValidator>") ] public class RequiredFieldValidator : BaseValidator { ///Checks if the value of /// the associated input control is different from its initial value. ////// [ WebCategory("Behavior"), Themeable(false), DefaultValue(""), WebSysDescription(SR.RequiredFieldValidator_InitialValue) ] public string InitialValue { get { object o = ViewState["InitialValue"]; return((o == null) ? String.Empty : (string)o); } set { ViewState["InitialValue"] = value; } } ///Gets or sets the initial value of the associated input control. ////// /// AddAttributesToRender method /// protected override void AddAttributesToRender(HtmlTextWriter writer) { base.AddAttributesToRender(writer); if (RenderUplevel) { string id = ClientID; HtmlTextWriter expandoAttributeWriter = (EnableLegacyRendering) ? writer : null; AddExpandoAttribute(expandoAttributeWriter, id, "evaluationfunction", "RequiredFieldValidatorEvaluateIsValid", false); AddExpandoAttribute(expandoAttributeWriter, id, "initialvalue", InitialValue); } } ////// /// EvaluateIsValid method /// protected override bool EvaluateIsValid() { // Get the control value, return true if it is not found string controlValue = GetControlValidationValue(ControlToValidate); if (controlValue == null) { Debug.Fail("Should have been caught by PropertiesValid check"); return true; } // See if the control has changed return(!controlValue.Trim().Equals(InitialValue.Trim())); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlValidatingReaderImpl.cs
- IISMapPath.cs
- AccessDataSourceView.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- StringPropertyBuilder.cs
- StretchValidation.cs
- DataGridViewSelectedCellCollection.cs
- XmlIgnoreAttribute.cs
- QilChoice.cs
- Main.cs
- PersianCalendar.cs
- ComponentEvent.cs
- ZipFileInfoCollection.cs
- SelectionProcessor.cs
- SchemaUtility.cs
- Vector3DAnimationUsingKeyFrames.cs
- ResourceManager.cs
- IList.cs
- WebConfigurationFileMap.cs
- FramingEncoders.cs
- OleStrCAMarshaler.cs
- ViewBox.cs
- ScaleTransform.cs
- XPathSelfQuery.cs
- RawStylusInputCustomData.cs
- DetailsViewPagerRow.cs
- PropertyBuilder.cs
- Viewport2DVisual3D.cs
- DataGridViewCellStyle.cs
- HttpDebugHandler.cs
- StateChangeEvent.cs
- EndPoint.cs
- RbTree.cs
- State.cs
- AvTraceFormat.cs
- FormCollection.cs
- sqlmetadatafactory.cs
- XmlSchemaDatatype.cs
- Grammar.cs
- LocalizationComments.cs
- UnsafeNativeMethods.cs
- DataColumnChangeEvent.cs
- UInt16Converter.cs
- SqlTrackingWorkflowInstance.cs
- AcceleratedTokenProvider.cs
- TextClipboardData.cs
- ImpersonateTokenRef.cs
- EventTrigger.cs
- SpeechUI.cs
- IdentityValidationException.cs
- MetadataException.cs
- EdmProperty.cs
- CaseInsensitiveComparer.cs
- UdpChannelFactory.cs
- TextProviderWrapper.cs
- StringToken.cs
- FileVersion.cs
- ZipIOLocalFileHeader.cs
- UpdateTracker.cs
- WebPartCatalogAddVerb.cs
- UniqueEventHelper.cs
- AsyncPostBackTrigger.cs
- EdmToObjectNamespaceMap.cs
- HtmlMobileTextWriter.cs
- ZipArchive.cs
- HwndHost.cs
- FloatUtil.cs
- UpdateCommandGenerator.cs
- CopyOnWriteList.cs
- XMLSchema.cs
- FixedStringLookup.cs
- FilterUserControlBase.cs
- CounterCreationData.cs
- Suspend.cs
- AnyReturnReader.cs
- ObjectCache.cs
- RelatedPropertyManager.cs
- CheckableControlBaseAdapter.cs
- DataGridDesigner.cs
- SystemIcmpV4Statistics.cs
- returneventsaver.cs
- View.cs
- Types.cs
- IsolatedStorage.cs
- LifetimeServices.cs
- Axis.cs
- XmlComplianceUtil.cs
- TaiwanCalendar.cs
- ComplexBindingPropertiesAttribute.cs
- SortedDictionary.cs
- WorkflowTransactionOptions.cs
- RegistrySecurity.cs
- FrameworkContextData.cs
- OAVariantLib.cs
- XamlInt32CollectionSerializer.cs
- PrintEvent.cs
- ProgressBarHighlightConverter.cs
- LineProperties.cs
- OracleInternalConnection.cs
- BevelBitmapEffect.cs