You must Sign In to post a response.
  • Category: ASP.NET

    HowTo Rectify this type of Session Logout error

    Hi developers ,
    am hosted my Project . In Live
    i have logged in to my created website. after 10 minutes of idle, if the session is expired it should be go to login page. but in my site i am fill up all the records and i am try to click insert button while the same page throw the error message like below.
    i want to set one hour of Session stand by time in all the pages.
    how to i am done it. Please help me friends.

    Server Error in '/' Application.

    Runtime Error

    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


    <!-- Web.Config Configuration File -->

    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>

    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


    <!-- Web.Config Configuration File -->

    <configuration>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
    </configuration>

    Thanks with
    Paul.S
  • #767459
    You have to turn on the error more. So that you can get clear error

    < customErrors defaultRedirect="DefaultRedirectErrorPage.aspx" redirectMode="ResponseRewrite"
    mode="On" >
    < /customErrors >

    You can handle the session time out in the web.config. Add the following tags in the web.config, that will handle your session time out.

    < configuration >
    < system.web >
    < sessionState
    mode="InProc"
    cookieless="true"
    timeout="30" / >
    < /system.web >
    < /configuration >

    By Nathan
    Direction is important than speed

  • #767460
    thanks mr.Nathan thanks for your quick reply
    i will try and reply you.
    Paul.S

  • #767483
    Hi,

    If you have a master page then use below sample


    <authentication mode="Forms">
    <forms loginUrl="~/LogIn.aspx" protection="All" timeout="2880" path="/" />
    </authentication>
    <authorization>
    <deny users="?" />
    </authorization>


    If you don't have a master page then on page load check the below condition


    Protected void Page_Load(object sender, EventArgs e)
    {

    if(Session["Login"]!=null)
    {
    //do your stuff
    }
    else
    {
    Response.Redirect("Login.aspx",true);
    }
    }


    Hope this will help you...

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #767495
    oh , i am using lot of master pages in my application mr.Naveen

    i am trying your code.and let you know mr.neveen.

    thanking you
    Paul.lS


Sign In to post your comments