Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP DLL instantiation wiping out .NET Session() variable?
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
VFP DLL instantiation wiping out .NET Session() variable?
Miscellaneous
Thread ID:
00707096
Message ID:
00707096
Views:
61
All,
I have a .NET web application that requires that the user be logged in to enter several of the web pages. I store the userid in a session variable, and that works a vast majority of the time.

However, I have one web page where I call a VFP dll. The first time I hit the dll (it hasn't spun up yet) it seems to wipe out the entry in Session for the userid. I am taking the web page data and feeding it to a VFP pricing object to determine the cost of the request. Invocation is as follows:
string usersig = Session["USERID"].ToString();
Pricer VFPPricer = new Pricer();
decimal YourPrice = VFPPricer.GetPrice(usersig, quantity, color);
VFPPricer = null;
cmdSave.Enabled = true;
Here is the code I call in the pages OnInit code to see if the user has logged in. If it is null, I redirect them to a login page, then pass the page to return to as a parameter.
I do not render the page until the user logs in.
if(Session["USERID"] == null)
{
    Response.Redirect("Logon.aspx?ReturnTo=" + PageName + ".aspx");
}
The code to set the session variable is
Session.Add("USERID", e.UserID);
What is happening here is that the user has entered all of the data, pressed the price button, the click event fires, the VFP dll loads, the session gets wiped out, the page is resubmitted after servicing the click event, we hit the onInit, the session is null, we redirect to the logon, they log in again, we go back to the order form, which now sees the !IsPostback as true, which repaints the form as a new post, which wipes out the request data the user has already entered.

What might be causing this? Should I not be setting the VFP object to null? I am at a loss to figure this out.

TIA,
Doug
Douglas Osborne
Don't spend your life just wishing - http://www.AllGiftRegistry.com
Next
Reply
Map
View

Click here to load this message in the networking platform