本文整理汇总了C#中ScriptManager.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptManager.GetType方法的具体用法?C# ScriptManager.GetType怎么用?C# ScriptManager.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptManager
的用法示例。
在下文中一共展示了ScriptManager.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetUrl
public string GetUrl(ScriptManager scriptManager)
{
string url = string.Empty;
if (String.IsNullOrEmpty(Path))
{
try
{
PropertyInfo piScriptManager_IControl = scriptManager.GetType().GetProperty("Control", BindingFlags.NonPublic | BindingFlags.Instance);
MethodInfo miScriptReference_GetUrl = typeof(ScriptReference).GetMethod("GetUrl", BindingFlags.NonPublic | BindingFlags.Instance);
Type typeIControl = Type.GetType(piScriptManager_IControl.PropertyType.AssemblyQualifiedName.ToString(), false, true);
//object value = Convert.ChangeType(piScriptManager_IControl.PropertyType, typeIControl);
object value = piScriptManager_IControl.GetValue(scriptManager, null);
url = (string)miScriptReference_GetUrl.Invoke(this, new object[] { scriptManager, value, false });
/*return base.GetUrl(scriptManager, false); //Ajax 3.5*/
//MethodInfo miGetScriptResourceUrl = typeof(ScriptManager).GetMethod("GetScriptResourceUrl", BindingFlags.NonPublic | BindingFlags.Instance);
//Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
//url = (string)miGetScriptResourceUrl.Invoke(scriptManager, new object[] { Name, asm });
}
catch (Exception ex) { }
}
else
{
url = scriptManager.ResolveClientUrl(Path);
}
return url;
}