Not sure if you saw my post on page 1 about the same "Null Reference" issue, but we were able to debug down into the generated bridgehandler class in Temporary ASP.NET Files and see what the line that was failing was. I pasted the code - it seemed like
it should not be failing because neither parameter was null...
Not sure if you saw my post on page 1 about the same "Null Reference" issue, but we were able to debug down into the generated bridgehandler class in Temporary ASP.NET Files and see what the line that was failing was. I pasted the code - it seemed like
it should not be failing because neither parameter was null...
I saw the code. I would first check the javascript calls to see if the parameter order is right and if the callback functions are in the right place.
I do not see any reasons for that line to crash because of moving to Beta2.
No, it is 1. We can't seem to see any missing parameters, or incorrect javascript calls. It seems that the base Microsoft.Web.Preview.Services.BridgeHandler method
ConvertToType is throwing the exception on our first parameter, "businessPurposeTypeID". Here is the code we see in Reflector, but I'm not sure how we can step into this code and see what parameters may be null:
One more thing: We just displayed external code in the stack trace and were able to verify that the method ConvertToType is being called with valid parameters - but we can't dig further into the DLL code to see what is failing in that method:
to me, initially, i thought that the problem lies in the this.ConvertToType. internally, it calls objectconverter.convertobjecttotypeinternal and i think it should call objectconverter.convertobjedttotype. however, i was wrong. the problem is that Type.GetType
used by the previous method isn't working and is returning null. The only i've managed to solve this was to add a new method that hides the base method and uses the complete type name. Here's the method i've added to my bridge in the code behind file:
protected new object ConvertToType(object argValue, Type paramType)
{
string text1 = "Microsoft.Web.Script.Serialization.ObjectConverter, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
return Type.GetType(text1).GetMethod("ConvertObjectToType", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { argValue, paramType, new JavaScriptSerializer() });
}
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
Very interesting... how did you override it? The BridgeHander is generated at compile time, right? Are you editing the generated class in Temporary ASP.NET Files, or doing it some other way?
dglsmason
Member
80 Points
31 Posts
Re: asbx support in AJAX ASP.NET
Nov 09, 2006 02:21 PM|LINK
madscene
Member
97 Points
20 Posts
Re: asbx support in AJAX ASP.NET
Nov 09, 2006 02:22 PM|LINK
Not sure if you saw my post on page 1 about the same "Null Reference" issue, but we were able to debug down into the generated bridgehandler class in Temporary ASP.NET Files and see what the line that was failing was. I pasted the code - it seemed like it should not be failing because neither parameter was null...
avmoldovan
Member
199 Points
41 Posts
Re: asbx support in AJAX ASP.NET
Nov 09, 2006 02:26 PM|LINK
Is not a dumb question. Simlpy write the word 'debugger' in a new line, in the javascript code, where you want the debugger to hit.
Hope this helps.
avmoldovan
Member
199 Points
41 Posts
Re: asbx support in AJAX ASP.NET
Nov 09, 2006 02:50 PM|LINK
I saw the code. I would first check the javascript calls to see if the parameter order is right and if the callback functions are in the right place.
I do not see any reasons for that line to crash because of moving to Beta2.
At the line:
arg0 = ((int)(this.ConvertToType(obj, typeof(int))));
is the 'obj' parameter null?
madscene
Member
97 Points
20 Posts
Re: asbx support in AJAX ASP.NET
Nov 09, 2006 02:55 PM|LINK
No, it is 1. We can't seem to see any missing parameters, or incorrect javascript calls. It seems that the base Microsoft.Web.Preview.Services.BridgeHandler method ConvertToType is throwing the exception on our first parameter, "businessPurposeTypeID". Here is the code we see in Reflector, but I'm not sure how we can step into this code and see what parameters may be null:
When it is called, argValue = 1 and paramType = System.Int32. Here is our javascript call:
MLDB.Website.WebServices.MLDBSearchBridge.LoadListingResults(
{
'businessPurposeTypeID': this._businessPurposeTypeID,
'userID': this.get_userID(),
'searchCriteria': this._searchCriteriaObject, // a dictionary object
'currentPage': this.get_currentPage(),
'itemsPerPage': this.get_itemsPerPage(),
'sortColumn': this._sortColumn,
'sortDirection': this._sortDirection
},
Function.createDelegate(this, this.Success),
Function.createDelegate(this, this.Failure),
"philsUserContext"
);
madscene
Member
97 Points
20 Posts
Re: asbx support in AJAX ASP.NET
Nov 09, 2006 03:03 PM|LINK
One more thing: We just displayed external code in the stack trace and were able to verify that the method ConvertToType is being called with valid parameters - but we can't dig further into the DLL code to see what is failing in that method:
Microsoft.Web.Preview.DLL!Microsoft.Web.Preview.Services.BridgeHandler.ConvertToType(object argValue = 1, System.Type paramType = {Name = "Int32" FullName = "System.Int32"}) + 0x27 bytes
avmoldovan
Member
199 Points
41 Posts
Re: asbx support in AJAX ASP.NET
Nov 09, 2006 03:37 PM|LINK
madscene
Member
97 Points
20 Posts
Re: asbx support in AJAX ASP.NET
Nov 09, 2006 03:43 PM|LINK
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: asbx support in AJAX ASP.NET
Nov 09, 2006 04:21 PM|LINK
hello.
to me, initially, i thought that the problem lies in the this.ConvertToType. internally, it calls objectconverter.convertobjecttotypeinternal and i think it should call objectconverter.convertobjedttotype. however, i was wrong. the problem is that Type.GetType used by the previous method isn't working and is returning null. The only i've managed to solve this was to add a new method that hides the base method and uses the complete type name. Here's the method i've added to my bridge in the code behind file:
protected new object ConvertToType(object argValue, Type paramType)
{
string text1 = "Microsoft.Web.Script.Serialization.ObjectConverter, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
return Type.GetType(text1).GetMethod("ConvertObjectToType", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, new object[] { argValue, paramType, new JavaScriptSerializer() });
}
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
madscene
Member
97 Points
20 Posts
Re: asbx support in AJAX ASP.NET
Nov 09, 2006 04:50 PM|LINK
Very interesting... how did you override it? The BridgeHander is generated at compile time, right? Are you editing the generated class in Temporary ASP.NET Files, or doing it some other way?
Thanks!
Brian