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
- ToolBarPanel.cs
- XmlHierarchicalDataSourceView.cs
- TimeIntervalCollection.cs
- Dispatcher.cs
- PromptEventArgs.cs
- MarginsConverter.cs
- RelationshipNavigation.cs
- Stopwatch.cs
- Int32AnimationBase.cs
- FamilyTypeface.cs
- CursorEditor.cs
- SelectionWordBreaker.cs
- MD5.cs
- MsmqBindingElementBase.cs
- FixedTextView.cs
- basenumberconverter.cs
- DrawingCollection.cs
- InputMethodStateChangeEventArgs.cs
- RMEnrollmentPage2.cs
- FixedPage.cs
- UIInitializationException.cs
- KnownTypesProvider.cs
- Comparer.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ProcessStartInfo.cs
- ViewSimplifier.cs
- OutputCache.cs
- SerializationAttributes.cs
- ToolStripPanel.cs
- NativeMethods.cs
- SafeWaitHandle.cs
- ApplyImportsAction.cs
- EventLog.cs
- BitmapFrameEncode.cs
- Error.cs
- GeometryCombineModeValidation.cs
- AutoResizedEvent.cs
- RouteParametersHelper.cs
- CodeExpressionCollection.cs
- ResourceCategoryAttribute.cs
- AsyncPostBackErrorEventArgs.cs
- PersonalizablePropertyEntry.cs
- PrtCap_Reader.cs
- WindowsToolbarAsMenu.cs
- MatrixAnimationBase.cs
- RunInstallerAttribute.cs
- CryptoHelper.cs
- AbstractExpressions.cs
- ControlUtil.cs
- Win32SafeHandles.cs
- Subset.cs
- InternalResources.cs
- ZipIOModeEnforcingStream.cs
- DataServiceRequest.cs
- DBPropSet.cs
- LabelDesigner.cs
- EntityDataSourceEntityTypeFilterConverter.cs
- CompModHelpers.cs
- AutomationElementCollection.cs
- SemanticTag.cs
- TreeWalkHelper.cs
- SqlDataSourceStatusEventArgs.cs
- PagedDataSource.cs
- ExpandableObjectConverter.cs
- WebException.cs
- ResXFileRef.cs
- CodeNamespaceCollection.cs
- SqlParameter.cs
- LocatorManager.cs
- Geometry.cs
- DbgUtil.cs
- ButtonColumn.cs
- XdrBuilder.cs
- ClientTargetCollection.cs
- TextParagraphProperties.cs
- SQLBinary.cs
- GCHandleCookieTable.cs
- ReturnEventArgs.cs
- updateconfighost.cs
- XmlElementAttribute.cs
- FocusChangedEventArgs.cs
- SqlBooleanMismatchVisitor.cs
- PDBReader.cs
- FileAuthorizationModule.cs
- SessionEndedEventArgs.cs
- XmlNamedNodeMap.cs
- OrderByBuilder.cs
- SelectedPathEditor.cs
- AssemblyBuilder.cs
- Filter.cs
- ModelTreeEnumerator.cs
- AlphaSortedEnumConverter.cs
- ParameterModifier.cs
- StreamUpgradeBindingElement.cs
- DetailsViewUpdatedEventArgs.cs
- WebServiceFaultDesigner.cs
- NonVisualControlAttribute.cs
- CompiledRegexRunnerFactory.cs
- XmlReflectionMember.cs
- TypeConverterHelper.cs