Link to home
Start Free TrialLog in
Avatar of devnewbee
devnewbee

asked on

Losing Session on Page Load and Postback

I have an app that has been working just fine to date, but recently started dropping session.
I have enclosed the error messages I am getting, but do not know what to make of them.
The errors happen on page_load after leaving my login page or on postback.

Object cannot be cast from DBNull to other types.

and

Operator '<>' is not defined for type 'DBNull' and type 'DBNull'.

Here is the page load event on the default page:

   If Request.QueryString("LostSession") = "True" And Not IsPostBack Then
            Me.Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "SessionWarning", "alert('Your session was lost.');", True)
        End If

Here is the page load event on the second page:

    If IsNothing(Session("id")) Or Not IsNumeric(Session("id")) Then
            Response.Redirect("default.aspx?LostSession=True", True)
        End If
Avatar of Mrpipkin
Mrpipkin



OK since the web server is all OK try a few of the following steps  before you can narrow this down.

Make sure your server is correctly working I.e no one has changes you network setting, firewall and check your exception tab.

I would check for the following, make sure your switches a functioning OK, check that no one has put a telephone cable back into a the switch .

If you have a WAN step up check that your bridgehead serve is working correctly.

Try to ping and trace route to the a extremal address when this occurs or try GFI network  monitor and keep pinging the server and switch and router to see if you are getting drop outs.

Make sure your DNS setting and DHCP are all set up correctly and that your site trust are correctly working.

Regards
ASKER CERTIFIED SOLUTION
Avatar of Alfred A.
Alfred A.
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of devnewbee

ASKER

This fixed my issue.  Thank you.