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
- ButtonFieldBase.cs
- Monitor.cs
- WebPartTransformer.cs
- PresentationSource.cs
- QueryInterceptorAttribute.cs
- TiffBitmapDecoder.cs
- ConfigUtil.cs
- PolicyFactory.cs
- FixedSOMTable.cs
- TreeNodeSelectionProcessor.cs
- EditorZoneAutoFormat.cs
- XmlDocumentType.cs
- ProjectedWrapper.cs
- SynchronizationValidator.cs
- FormView.cs
- ECDiffieHellmanPublicKey.cs
- Array.cs
- MarginCollapsingState.cs
- ConfigXmlWhitespace.cs
- Cloud.cs
- WsdlImporterElement.cs
- ModelItemImpl.cs
- InfoCardRSACryptoProvider.cs
- BoolExpressionVisitors.cs
- Psha1DerivedKeyGenerator.cs
- SectionInput.cs
- NavigationWindowAutomationPeer.cs
- HtmlInputCheckBox.cs
- ParameterReplacerVisitor.cs
- KerberosReceiverSecurityToken.cs
- FilteredAttributeCollection.cs
- ReadOnlyHierarchicalDataSourceView.cs
- MediaContext.cs
- BamlBinaryReader.cs
- documentsequencetextpointer.cs
- TcpAppDomainProtocolHandler.cs
- MetafileEditor.cs
- Storyboard.cs
- ServiceOperationHelpers.cs
- SubMenuStyleCollection.cs
- dbdatarecord.cs
- RuntimeIdentifierPropertyAttribute.cs
- TextDecorationUnitValidation.cs
- BevelBitmapEffect.cs
- DictionarySurrogate.cs
- SByteStorage.cs
- UnitControl.cs
- CriticalHandle.cs
- CultureMapper.cs
- XmlProcessingInstruction.cs
- ObfuscationAttribute.cs
- ChannelDispatcherCollection.cs
- HoistedLocals.cs
- Inflater.cs
- WorkflowTimerService.cs
- XmlEventCache.cs
- StylusPointPropertyUnit.cs
- DataFormats.cs
- OciLobLocator.cs
- KnownTypeHelper.cs
- DeviceOverridableAttribute.cs
- FontNamesConverter.cs
- XamlTreeBuilder.cs
- Executor.cs
- SoapFault.cs
- ByteStream.cs
- LinkLabel.cs
- OSFeature.cs
- SpStreamWrapper.cs
- UnsafeMethods.cs
- DecoderExceptionFallback.cs
- DependencyObjectProvider.cs
- XmlSerializationWriter.cs
- DbSetClause.cs
- FontDifferentiator.cs
- NativeMethodsOther.cs
- PatternMatcher.cs
- ArrayTypeMismatchException.cs
- AdapterUtil.cs
- httpapplicationstate.cs
- AssertFilter.cs
- ProviderConnectionPointCollection.cs
- InputReportEventArgs.cs
- RunInstallerAttribute.cs
- QilTernary.cs
- ToolStripSeparatorRenderEventArgs.cs
- smtpconnection.cs
- VectorCollectionConverter.cs
- HexParser.cs
- CodeArrayIndexerExpression.cs
- SchemaNotation.cs
- Error.cs
- TransformGroup.cs
- LayoutEditorPart.cs
- Task.cs
- OracleConnectionFactory.cs
- DataGridViewCellStyle.cs
- ColumnReorderedEventArgs.cs
- LeafCellTreeNode.cs
- XPathDescendantIterator.cs