Code:
/ 4.0 / 4.0 / 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.
//------------------------------------------------------------------------------
//
// 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
- SelectingProviderEventArgs.cs
- SqlNotificationEventArgs.cs
- EventProvider.cs
- FileFormatException.cs
- NumericExpr.cs
- Monitor.cs
- ThreadPoolTaskScheduler.cs
- BindingExpressionUncommonField.cs
- _RequestCacheProtocol.cs
- SchemaElementLookUpTable.cs
- XmlMembersMapping.cs
- HMACRIPEMD160.cs
- Models.cs
- ConnectionConsumerAttribute.cs
- CuspData.cs
- CompilerState.cs
- SmtpDigestAuthenticationModule.cs
- HttpListener.cs
- MasterPageParser.cs
- SqlDataSourceSelectingEventArgs.cs
- DataGridCommandEventArgs.cs
- ScriptControl.cs
- HttpException.cs
- AutoGeneratedField.cs
- MailAddress.cs
- UdpSocket.cs
- AccessText.cs
- DBConnectionString.cs
- AsyncCompletedEventArgs.cs
- Journal.cs
- BamlVersionHeader.cs
- NavigationFailedEventArgs.cs
- IpcPort.cs
- QuaternionRotation3D.cs
- Converter.cs
- IPGlobalProperties.cs
- CalendarDesigner.cs
- RuntimeResourceSet.cs
- ToolStripDropDownItem.cs
- AutoCompleteStringCollection.cs
- PrintPageEvent.cs
- EntitySqlException.cs
- FacetChecker.cs
- Form.cs
- SuppressedPackageProperties.cs
- WorkflowDispatchContext.cs
- InkPresenter.cs
- CollaborationHelperFunctions.cs
- isolationinterop.cs
- ToolStripCustomTypeDescriptor.cs
- PropertyValidationContext.cs
- SynchronizedDispatch.cs
- DataGridViewCellCollection.cs
- NetWebProxyFinder.cs
- SelectionProviderWrapper.cs
- DataGridViewImageColumn.cs
- SendMailErrorEventArgs.cs
- FileDataSourceCache.cs
- HwndHostAutomationPeer.cs
- UnsafeNativeMethods.cs
- XPathMessageContext.cs
- BitmapPalettes.cs
- PixelFormatConverter.cs
- SafeBitVector32.cs
- ColumnHeader.cs
- Walker.cs
- EventWaitHandleSecurity.cs
- OutputCacheSettings.cs
- GiveFeedbackEventArgs.cs
- ObjectPersistData.cs
- AlignmentYValidation.cs
- EventLog.cs
- HtmlTable.cs
- QuerySetOp.cs
- SymLanguageType.cs
- ObservableDictionary.cs
- PbrsForward.cs
- RequiredFieldValidator.cs
- XmlFormatExtensionAttribute.cs
- WindowsRegion.cs
- SmtpCommands.cs
- _TimerThread.cs
- InputScope.cs
- RotateTransform3D.cs
- UpdatePanelTrigger.cs
- HealthMonitoringSection.cs
- DataGridViewComboBoxCell.cs
- DataAdapter.cs
- Size.cs
- safesecurityhelperavalon.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- ResourceManagerWrapper.cs
- StreamGeometry.cs
- Matrix3DValueSerializer.cs
- Thread.cs
- SqlInternalConnection.cs
- Control.cs
- Normalization.cs
- URLString.cs
- TraceContext.cs