Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebControls / ValidatorCompatibilityHelper.cs / 3 / 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});
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HashSet.cs
- HMACSHA512.cs
- ConsoleTraceListener.cs
- CodeLinePragma.cs
- HexParser.cs
- AccessedThroughPropertyAttribute.cs
- StringCollectionEditor.cs
- PropertyKey.cs
- Tablet.cs
- Matrix3DStack.cs
- ClientOptions.cs
- MissingMethodException.cs
- CustomAssemblyResolver.cs
- WaitHandleCannotBeOpenedException.cs
- HttpListener.cs
- WorkflowWebService.cs
- ContentWrapperAttribute.cs
- ExtenderControl.cs
- Pair.cs
- Filter.cs
- BamlBinaryReader.cs
- GroupItem.cs
- DesignerSerializationOptionsAttribute.cs
- ToolStripDropDownDesigner.cs
- ContextDataSourceView.cs
- FrameworkElementAutomationPeer.cs
- XmlCollation.cs
- ReadWriteControlDesigner.cs
- ExpressionList.cs
- PointHitTestParameters.cs
- ToolboxItemCollection.cs
- CodeTypeMemberCollection.cs
- NotifyCollectionChangedEventArgs.cs
- BamlBinaryWriter.cs
- SecurityElement.cs
- ObjectNavigationPropertyMapping.cs
- SelectingProviderEventArgs.cs
- LongValidator.cs
- WebControl.cs
- WebPartDescriptionCollection.cs
- MainMenu.cs
- Root.cs
- WsrmTraceRecord.cs
- WindowsFormsHostAutomationPeer.cs
- LogWriteRestartAreaState.cs
- OrderPreservingMergeHelper.cs
- MaxValueConverter.cs
- MarkupCompilePass2.cs
- _UriSyntax.cs
- UIElementCollection.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- XmlSerializerOperationBehavior.cs
- DefaultParameterValueAttribute.cs
- DocumentPageHost.cs
- MergeFailedEvent.cs
- AuthenticationModuleElement.cs
- ComponentCodeDomSerializer.cs
- ZipIOExtraFieldElement.cs
- GridViewCancelEditEventArgs.cs
- TextBoxRenderer.cs
- Int64AnimationBase.cs
- IntermediatePolicyValidator.cs
- TimeManager.cs
- NameTable.cs
- DataError.cs
- FrameworkRichTextComposition.cs
- ToolStrip.cs
- EmptyEnumerable.cs
- DefaultEventAttribute.cs
- PageBreakRecord.cs
- HwndAppCommandInputProvider.cs
- StringToken.cs
- Application.cs
- LifetimeServices.cs
- Thumb.cs
- ToolboxComponentsCreatingEventArgs.cs
- CookieHandler.cs
- ObjectAnimationBase.cs
- DataSourceXmlClassAttribute.cs
- Rfc2898DeriveBytes.cs
- DocumentEventArgs.cs
- ContractInferenceHelper.cs
- PathSegmentCollection.cs
- MultipartIdentifier.cs
- WebServiceTypeData.cs
- FilteredXmlReader.cs
- ControlValuePropertyAttribute.cs
- WizardSideBarListControlItem.cs
- bindurihelper.cs
- CommandBinding.cs
- OrderedEnumerableRowCollection.cs
- DrawingContextDrawingContextWalker.cs
- NestPullup.cs
- SiteMap.cs
- MappingException.cs
- SystemSounds.cs
- DiagnosticsConfiguration.cs
- ProbeMatchesCD1.cs
- StoreAnnotationsMap.cs
- CookielessHelper.cs