Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / ndp / fx / src / xsp / System / Web / Extensions / ui / ControlUtil.cs / 2 / ControlUtil.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Web.Resources; using System.Web.UI; namespace System.Web.UI { internal class ControlUtil { internal static Control FindTargetControl(string controlID, Control control, bool searchNamingContainers) { Control foundControl; if (searchNamingContainers) { Control currentContainer; foundControl = null; // DevDiv 73305: Do not assume starting control is not a naming container. if (control is INamingContainer) { currentContainer = control; } else { currentContainer = control.NamingContainer; } do { foundControl = currentContainer.FindControl(controlID); currentContainer = currentContainer.NamingContainer; } while (foundControl == null && currentContainer != null); } else { foundControl = control.FindControl(controlID); } return foundControl; } internal static bool IsBuiltInHiddenField(string hiddenFieldName) { // Returns true is the field name represents a hidden field generated // by ASP.NET's core runtime. This includes fields such as ViewState and // EventValidation, but not ones generated by specific controls such as // TreeView and WebParts. // If the field is less than two chars long it's not built-in. (Perf) if (hiddenFieldName.Length <= 2) { return false; } // If it doesn't start with two underscores, it's not built-in. (Perf) if (hiddenFieldName[0] != '_' || hiddenFieldName[1] != '_') { return false; } // Examine list of built-in ASP.NET fields. The list was created by examining // the ASP.NET source code for hidden field registration and rendering. // We exclude __VIEWSTATEENCRYPTED and __VIEWSTATEFIELDCOUNT from the list // since they're covered by the general __VIEWSTATE part. return hiddenFieldName.StartsWith("__VIEWSTATE", StringComparison.Ordinal) || String.Equals(hiddenFieldName, "__EVENTVALIDATION", StringComparison.Ordinal) || String.Equals(hiddenFieldName, "__LASTFOCUS", StringComparison.Ordinal) || String.Equals(hiddenFieldName, "__SCROLLPOSITIONX", StringComparison.Ordinal) || String.Equals(hiddenFieldName, "__SCROLLPOSITIONY", StringComparison.Ordinal) || String.Equals(hiddenFieldName, "__EVENTTARGET", StringComparison.Ordinal) || String.Equals(hiddenFieldName, "__EVENTARGUMENT", StringComparison.Ordinal) || String.Equals(hiddenFieldName, "__PREVIOUSPAGE", StringComparison.Ordinal); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Variable.cs
- ReceiveActivityDesignerTheme.cs
- SafeEventLogReadHandle.cs
- GlyphManager.cs
- ZoneMembershipCondition.cs
- RelationshipFixer.cs
- MembershipUser.cs
- PasswordTextContainer.cs
- ToolTip.cs
- RolePrincipal.cs
- WithStatement.cs
- WebExceptionStatus.cs
- UnauthorizedWebPart.cs
- ZipIOExtraFieldElement.cs
- XamlClipboardData.cs
- PolyLineSegmentFigureLogic.cs
- ColorKeyFrameCollection.cs
- XmlSchemaAttributeGroup.cs
- ImportCatalogPart.cs
- WhitespaceRule.cs
- HttpCapabilitiesBase.cs
- Int32CollectionValueSerializer.cs
- KeyFrames.cs
- FacetValueContainer.cs
- NavigationEventArgs.cs
- SafeRightsManagementEnvironmentHandle.cs
- VectorAnimationUsingKeyFrames.cs
- TagPrefixAttribute.cs
- Environment.cs
- ValidatorCompatibilityHelper.cs
- GridPattern.cs
- StatusBarItemAutomationPeer.cs
- UInt64Converter.cs
- IdnMapping.cs
- SecurityUtils.cs
- Sql8ConformanceChecker.cs
- Timer.cs
- TimeZoneInfo.cs
- HttpContext.cs
- NetMsmqBindingCollectionElement.cs
- SafeSecurityHandles.cs
- PathData.cs
- UpdateCompiler.cs
- HttpWriter.cs
- MarkupCompilePass1.cs
- HtmlInputReset.cs
- HttpApplicationFactory.cs
- EntityViewContainer.cs
- xmlsaver.cs
- Rotation3D.cs
- SqlDataSourceCommandEventArgs.cs
- ThicknessAnimationBase.cs
- TableStyle.cs
- SoapObjectInfo.cs
- HandleCollector.cs
- HtmlInputHidden.cs
- StrokeDescriptor.cs
- SqlGatherProducedAliases.cs
- Variant.cs
- DefaultAssemblyResolver.cs
- Table.cs
- OleDbErrorCollection.cs
- MimePart.cs
- CompositeFontInfo.cs
- TrackingProfileSerializer.cs
- SqlException.cs
- ExceptionWrapper.cs
- InternalSafeNativeMethods.cs
- WebPartDisplayMode.cs
- OdbcHandle.cs
- MediaPlayer.cs
- WebRequest.cs
- CanonicalXml.cs
- xsdvalidator.cs
- EncryptedKeyIdentifierClause.cs
- HtmlTableCell.cs
- RestClientProxyHandler.cs
- SurrogateEncoder.cs
- SmtpFailedRecipientsException.cs
- PageRouteHandler.cs
- MsmqOutputMessage.cs
- ReferenceEqualityComparer.cs
- FillRuleValidation.cs
- CacheHelper.cs
- NavigationHelper.cs
- ComplexLine.cs
- CompilationRelaxations.cs
- WindowCollection.cs
- ExtendedPropertyCollection.cs
- IBuiltInEvidence.cs
- InvalidPrinterException.cs
- WebWorkflowRole.cs
- UdpRetransmissionSettings.cs
- DrawingServices.cs
- MetadataArtifactLoaderCompositeFile.cs
- DrawingGroup.cs
- OleDbDataReader.cs
- Mappings.cs
- KnownIds.cs
- ProtectedProviderSettings.cs