Migration Solutions for ColdFusion Applications to ASP.NET
      
New Atlanta Product Forums Profile | Search | Login | RSS
New Topic Reply   Previous Page  Page: 1   Next Page

Thread: Error moving from CFM to ASPX page
Created on: 05/02/16 03:49 AM Replies: 0
shubsri


Joined: 04/26/16
Posts: 6
Error moving from CFM to ASPX page
05/02/16 3:49 AM

Hi Team BlueDragon,

We have recently updated BlueDragon to 9.0(earlier 7.1).
Most of the features in our application are working fine, however, we are struggling with some issues.

The most critical of them is like whenever we are moving to an ASPX page from a CFM page, we are getting :
System.InvalidCastException: Unable to cast object of type 'com.naryx.tagfusion.cfm.application.cfSessionData' to type 'System.Collections.Hashtable'.


This occurs when we are retrieving the user information while returning from a CFM Page and trying to cast that info into a Hashtable.
protected virtual void Page_Init(object src, EventArgs e)

{

Hashtable cfmSession = (Hashtable)Session["AppCompany"];



if (cfmSession != null)

{

if (cfmSession.Contains("CompanyID"))

{

try

{

_companyID = Convert.ToInt32(cfmSession["CompanyID"]);

}

catch { }

}

}

}


Debugging the code shows that, prior moving to CFM page, UserInfo is stored in Session State variable 'AppCompany' in form of HashTable, however, after returning from CFM page to ASPX page, the type of AppCompany changes to structure 'com.naryx.tagfusion.cfm.application.cfSessionData' adding 'sessionid' as additional property due to which it is unable to cast it back to hashtable.

Interestingly, debugging the same code with BD 7.1 shows that after returning from CFM page, type of 'AppCompany' session state changes to 'com.naryx.tagfusion.cfm.engine.cfJSharpStructData' which can be converted to Hashtable easily.
(something confirms to point 3.6.2.2 in 'BlueDragon_90_Integrating_CFML_with_ASPNET' documentation). Is this point still valid with BlueDragon 9.0?
Also, Please explain point 6 in 'MigratingFromBD_NET_7' documentation which seems related.

Also, for your information, this problem occurs while moving back from CERTAIN CFM Pages only, not all.
However, each of such problematic CFM page must contain following code:
<cflock scope="Session" type="Readonly" timeout="10">
   <cfset sessionCompanyID=session.CompanyID>
</cflock>

Hope all this information helps you in understanding the issue properly and suggesting way to fix the problem.
Please let me know if you need any other information.

Regards,
Shubham Srivastava
Link | Top | Bottom

New Post
Please login to post a response.


company media information terms of use privacy policy contact us
This page was dynamically built on the BlueDragon CFML Engine