R
Robert
I'm trying to get a control from metabuilders.com dual list)to work under
ASP.NET 2.0. It worked find under 1.1 and then when i migrated my
application to 2.0 I ran into problems with it.
However, I'm getting an error on a particular line as follows:
Exception: System.Web.HttpUnhandledException: Exception of type
'System.Web.HttpUnhandledException' was thrown. --->
System.ArgumentException: Object of type 'System.String' cannot be converted
to type 'System.Web.VirtualPath'.
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo
culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder
binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean
skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at MetaBuilders.WebControls.DynamicListBoxResourceHandler.DetermineIsRegistere
d()
at MetaBuilders.WebControls.DynamicListBoxResourceHandler.get_IsRegistered()
at
MetaBuilders.WebControls.DynamicListBoxResourceHandler.RegisterScript(Page
page, String scriptKey, String scriptFile)
at MetaBuilders.WebControls.DualList.RegisterScriptLibrary()
at MetaBuilders.WebControls.DualList.RegisterScript()
at MetaBuilders.WebControls.DualList.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The function where the error occurs is below and the line causing the error
reads "Object handler = findMapping.Invoke..."
I'm a bit lost because I'm having trouble understanding exactly what this
function does and why all of sudden it does not work under 2.0 but works fine
under 1.1.
Any ideas or suggestions? I'm also at the point of throwning the thing
completely out and creating my own. The metabuilders site seems to be
basically dead for the past year so I'm out of luck getting help there.
private static Boolean DetermineIsRegistered() {
Object handlerMap =
System.Web.HttpContext.GetAppConfig("system.web/httpHandlers");
if ( handlerMap == null ) {
return false;
}
MethodInfo findMapping = handlerMap.GetType().GetMethod("FindMapping",
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic );
if ( findMapping == null ) {
return false;
}
Object handler = findMapping.Invoke(handlerMap, new Object[] { "GET",
handlerName } );
if ( handler == null ) {
return false;
}
PropertyInfo handlerPathProperty = handler.GetType().GetProperty("Path",
BindingFlags.NonPublic | BindingFlags.Instance );
if ( handlerPathProperty == null ) {
return false;
}
String handlerPath = handlerPathProperty.GetValue(handler,null) as String;
if ( handlerPath == null || handlerPath != handlerName ) {
return false;
}
return true;
}
ASP.NET 2.0. It worked find under 1.1 and then when i migrated my
application to 2.0 I ran into problems with it.
However, I'm getting an error on a particular line as follows:
Exception: System.Web.HttpUnhandledException: Exception of type
'System.Web.HttpUnhandledException' was thrown. --->
System.ArgumentException: Object of type 'System.String' cannot be converted
to type 'System.Web.VirtualPath'.
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo
culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder
binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean
skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at MetaBuilders.WebControls.DynamicListBoxResourceHandler.DetermineIsRegistere
d()
at MetaBuilders.WebControls.DynamicListBoxResourceHandler.get_IsRegistered()
at
MetaBuilders.WebControls.DynamicListBoxResourceHandler.RegisterScript(Page
page, String scriptKey, String scriptFile)
at MetaBuilders.WebControls.DualList.RegisterScriptLibrary()
at MetaBuilders.WebControls.DualList.RegisterScript()
at MetaBuilders.WebControls.DualList.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The function where the error occurs is below and the line causing the error
reads "Object handler = findMapping.Invoke..."
I'm a bit lost because I'm having trouble understanding exactly what this
function does and why all of sudden it does not work under 2.0 but works fine
under 1.1.
Any ideas or suggestions? I'm also at the point of throwning the thing
completely out and creating my own. The metabuilders site seems to be
basically dead for the past year so I'm out of luck getting help there.
private static Boolean DetermineIsRegistered() {
Object handlerMap =
System.Web.HttpContext.GetAppConfig("system.web/httpHandlers");
if ( handlerMap == null ) {
return false;
}
MethodInfo findMapping = handlerMap.GetType().GetMethod("FindMapping",
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic );
if ( findMapping == null ) {
return false;
}
Object handler = findMapping.Invoke(handlerMap, new Object[] { "GET",
handlerName } );
if ( handler == null ) {
return false;
}
PropertyInfo handlerPathProperty = handler.GetType().GetProperty("Path",
BindingFlags.NonPublic | BindingFlags.Instance );
if ( handlerPathProperty == null ) {
return false;
}
String handlerPath = handlerPathProperty.GetValue(handler,null) as String;
if ( handlerPath == null || handlerPath != handlerName ) {
return false;
}
return true;
}