views:

157

answers:

2

HI all,

I am working with asp.net with c#.net

Here i am using session state to pass the value from one page to another.

i have two pages, in first page i am calculating the value and passing the value to second page using session and in second page i am displaying the message through the value.

I am using these two pages for facebook application.

I uploaded my two pages then i am checking with facebook by opening through internet explorer and its giving below error.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

But when i open my application using firefox the pages are working fine.

please help me...

A: 

This sounds like the session data from the first page isn't available on the second page for some reason. You're trying to pull your value from the session and perform an operation on it but the value is null, hence the NullReferenceException.

Is it possible that your Internet Explorer settings are blocking the ASP.NET session cookie? This would potentially cause the symptoms that you describe.

LukeH
where are editor when u need them ????I don't got votes Up for my answer and this occurrs each time so i think that i will not strain myself to answer questions....
Ahmy
@Ahmy - it would help if you used proper sentences, grammar and punctuation. Using "u" for "you" and grammatical shortcuts make your posts difficult to understand and looks unprofessional, so people are less likely to vote for them.
womp
@Womp execuse me but your reason for this problem is not reasonable !!! Each time i reply any question and the answer is helpful no evaluation inspit i took time for seraching to a solution for user problem at all i know the real reason but i will not mind or care with....
Ahmy
+1  A: 

It appears you are writing an IFRAME facebook application. Does it only happen in IE? if it happens with you in IE so put this code in your page that use the session :

protected override void OnPreRender(EventArgs e)
{
    Response.AppendHeader("P3P", "CP=\"CAO PSA OUR\"");
    base.OnPreRender(e);
}

See the section 'Solution to an IE gotcha when developing Facebook App in an IFRAME' on here: http://wiki.developers.facebook.com/index.php/ASP.NET

There is a problem already occurs with IE

Hope that this is useful

Ahmy