.GetType.ToString() is your friend for comparison too when chekcing
out objects that may shift type if null or empty
On Mon, 10 Jan 2005 18:41:21 -0800 (PST), Hemant Anugonda
<[EMAIL PROTECTED]> wrote:
> check for if (Session["Admin"] ==null) instead of trying to perform a
> ToString() on a null reference.
>
> Arindam <[EMAIL PROTECTED]> wrote:Hello Friend
>
> In Page_Load i have written
> if (Session["Admin"].ToString()=="")
> {
> Response.Redirect("controlpanel.aspx?Msg=illegal");
> }
> when Session["Admin"] expired its not getting redirected to the specified
> url ,
> i am getting the following error..why ? How should i write ?
>
> 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.
>
>
> Thanks
> Arindam
>
>
>
> Thanks & Regards
>
> Arindam
> Web Designer & Developer
>
>
>
>
> Yahoo! India Matrimony: Find your life partneronline.
>
> [Non-text portions of this message have been removed]
>
>
>
> ---------------------------------
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
>
>
> We don't know a millionth of one percent about anything -- Edison
>
> Hemant
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> [Non-text portions of this message have been removed]
>
>
>
> ________________________________
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>
> To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/