Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / ValidatorCompatibilityHelper.cs / 1305376 / ValidatorCompatibilityHelper.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System.Globalization;
using System.Reflection;
using System.Web.Util;
// Needed to support Validators in AJAX 1.0 (Windows OS Bugs 2015831)
internal static class ValidatorCompatibilityHelper {
public static void RegisterArrayDeclaration(Control control, string arrayName, string arrayValue) {
Type scriptManagerType = control.Page.ScriptManagerType;
Debug.Assert(scriptManagerType != null);
scriptManagerType.InvokeMember("RegisterArrayDeclaration",
BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod,
null, /*binder*/
null, /*target*/
new object[] {control, arrayName, arrayValue});
}
public static void RegisterClientScriptResource(Control control, Type type, string resourceName) {
Type scriptManagerType = control.Page.ScriptManagerType;
Debug.Assert(scriptManagerType != null);
scriptManagerType.InvokeMember("RegisterClientScriptResource",
BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod,
null, /*binder*/
null, /*target*/
new object[] {control, type, resourceName});
}
public static void RegisterExpandoAttribute(Control control, string controlId, string attributeName, string attributeValue, bool encode) {
Type scriptManagerType = control.Page.ScriptManagerType;
Debug.Assert(scriptManagerType != null);
scriptManagerType.InvokeMember("RegisterExpandoAttribute",
BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod,
null, /*binder*/
null, /*target*/
new object[] {control, controlId, attributeName, attributeValue, encode});
}
public static void RegisterOnSubmitStatement(Control control, Type type, string key, string script) {
Type scriptManagerType = control.Page.ScriptManagerType;
Debug.Assert(scriptManagerType != null);
scriptManagerType.InvokeMember("RegisterOnSubmitStatement",
BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod,
null, /*binder*/
null, /*target*/
new object[] {control, type, key, script});
}
public static void RegisterStartupScript(Control control, Type type, string key, string script, bool addScriptTags) {
Type scriptManagerType = control.Page.ScriptManagerType;
Debug.Assert(scriptManagerType != null);
scriptManagerType.InvokeMember("RegisterStartupScript",
BindingFlags.Public | BindingFlags.Static | BindingFlags.InvokeMethod,
null, /*binder*/
null, /*target*/
new object[] {control, type, key, script, addScriptTags});
}
}
}
// 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
- PlaceHolder.cs
- UnsafeNativeMethods.cs
- SqlCommandSet.cs
- DynamicValidatorEventArgs.cs
- ClientSponsor.cs
- DocumentOutline.cs
- TabControlAutomationPeer.cs
- LogConverter.cs
- WebPartUserCapability.cs
- StubHelpers.cs
- LineSegment.cs
- HostingPreferredMapPath.cs
- ExpressionsCollectionConverter.cs
- SpecialNameAttribute.cs
- XsltLibrary.cs
- XmlC14NWriter.cs
- ObjectPropertyMapping.cs
- XmlToDatasetMap.cs
- CommonGetThemePartSize.cs
- StateChangeEvent.cs
- EncoderParameters.cs
- ClientData.cs
- CompoundFileDeflateTransform.cs
- EncoderBestFitFallback.cs
- NotImplementedException.cs
- ProtocolsConfigurationHandler.cs
- RequestCacheManager.cs
- SharedStatics.cs
- oledbconnectionstring.cs
- HttpModuleCollection.cs
- XmlDataImplementation.cs
- ValidationErrorCollection.cs
- ExtensibleClassFactory.cs
- ManifestBasedResourceGroveler.cs
- ThreadStartException.cs
- RemotingConfiguration.cs
- Registration.cs
- StandardCommands.cs
- WindowsSysHeader.cs
- StaticExtensionConverter.cs
- LinkArea.cs
- ISAPIApplicationHost.cs
- EnumType.cs
- XmlUtilWriter.cs
- MultiPropertyDescriptorGridEntry.cs
- PropertyValueUIItem.cs
- AdjustableArrowCap.cs
- TreeBuilderBamlTranslator.cs
- XmlJsonWriter.cs
- QueryReaderSettings.cs
- WebServiceTypeData.cs
- ApplicationFileCodeDomTreeGenerator.cs
- _Win32.cs
- TextDecoration.cs
- ColorMatrix.cs
- SystemEvents.cs
- ZipIOCentralDirectoryBlock.cs
- IdlingCommunicationPool.cs
- DataListItemCollection.cs
- WebConfigurationHostFileChange.cs
- ValidateNames.cs
- DataGridView.cs
- CodeMemberEvent.cs
- activationcontext.cs
- _Win32.cs
- DependencyPropertyConverter.cs
- StylusDevice.cs
- FontFamilyConverter.cs
- BaseParser.cs
- SettingsProperty.cs
- EndpointInfo.cs
- PropertyManager.cs
- SiteMapDataSource.cs
- TransformerInfoCollection.cs
- DeploymentSection.cs
- QueryStringParameter.cs
- ImportCatalogPart.cs
- DbConnectionStringBuilder.cs
- ProfileProvider.cs
- DeviceSpecific.cs
- DataGridViewSelectedColumnCollection.cs
- storepermissionattribute.cs
- WindowsToolbar.cs
- Size.cs
- ForeignKeyFactory.cs
- ListItemConverter.cs
- PerformanceCounterPermission.cs
- SqlUtil.cs
- WebSysDescriptionAttribute.cs
- WebPartMovingEventArgs.cs
- DataGridViewCellStyleConverter.cs
- WSDualHttpSecurityElement.cs
- LayoutTableCell.cs
- PropertyItemInternal.cs
- MulticastIPAddressInformationCollection.cs
- PathFigure.cs
- TextTreeRootTextBlock.cs
- MailHeaderInfo.cs
- LocalizationParserHooks.cs
- ReadOnlyCollection.cs