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
- WsdlImporter.cs
- EntityKey.cs
- DataGridViewCellFormattingEventArgs.cs
- ListViewGroup.cs
- PublisherMembershipCondition.cs
- GenericPrincipal.cs
- ColorPalette.cs
- ArrayMergeHelper.cs
- CatalogZone.cs
- DisableDpiAwarenessAttribute.cs
- ComponentEditorForm.cs
- FieldBuilder.cs
- ToolStripContentPanelRenderEventArgs.cs
- PropertyValueChangedEvent.cs
- PublisherMembershipCondition.cs
- HotSpot.cs
- BamlBinaryReader.cs
- TimerEventSubscription.cs
- _PooledStream.cs
- FileLevelControlBuilderAttribute.cs
- HtmlTernaryTree.cs
- SoapSchemaImporter.cs
- RenderOptions.cs
- odbcmetadatafactory.cs
- OrCondition.cs
- ValidationPropertyAttribute.cs
- DataGridRow.cs
- AssemblyResourceLoader.cs
- TableRow.cs
- WebBrowsableAttribute.cs
- InlineUIContainer.cs
- UniformGrid.cs
- SizeConverter.cs
- ISO2022Encoding.cs
- PageThemeParser.cs
- CultureSpecificCharacterBufferRange.cs
- XmlCharCheckingReader.cs
- ListDataHelper.cs
- NavigationWindow.cs
- CodeAccessSecurityEngine.cs
- ConfigurationLocationCollection.cs
- TextProviderWrapper.cs
- ScrollableControl.cs
- QueryResult.cs
- DoubleCollectionConverter.cs
- InArgumentConverter.cs
- BitmapCache.cs
- XmlIterators.cs
- WebPartConnectionsEventArgs.cs
- GridViewPageEventArgs.cs
- Polyline.cs
- MetadataArtifactLoaderFile.cs
- DbConnectionHelper.cs
- EntityClassGenerator.cs
- LoopExpression.cs
- ObjectStorage.cs
- FontUnit.cs
- EntityDataSourceContextCreatedEventArgs.cs
- PieceNameHelper.cs
- RoutedEventValueSerializer.cs
- ContentWrapperAttribute.cs
- MetadataItemSerializer.cs
- ActivityScheduledQuery.cs
- GeneralTransformGroup.cs
- ServiceHandle.cs
- FSWPathEditor.cs
- OdbcRowUpdatingEvent.cs
- RenderCapability.cs
- DataServiceResponse.cs
- CombinedTcpChannel.cs
- HasCopySemanticsAttribute.cs
- AuthenticationSection.cs
- HandlerMappingMemo.cs
- JumpList.cs
- KnownColorTable.cs
- PreservationFileReader.cs
- DocumentSchemaValidator.cs
- Rect.cs
- RenderData.cs
- ObjectAnimationBase.cs
- GACIdentityPermission.cs
- sqlnorm.cs
- ADMembershipUser.cs
- StringUtil.cs
- InternalBufferOverflowException.cs
- SchemaImporter.cs
- QueryHandler.cs
- EmbeddedObject.cs
- Base64Encoder.cs
- UnauthorizedAccessException.cs
- PropertyGridCommands.cs
- HashMembershipCondition.cs
- GPPOINTF.cs
- DiscoveryDocumentSearchPattern.cs
- SqlDataSourceView.cs
- DecoderNLS.cs
- BooleanFunctions.cs
- Inflater.cs
- Font.cs
- RC2.cs