Solved

c# Webpage Setting the timeout

Posted on 2011-09-22
10
224 Views
Last Modified: 2013-12-17
I have a website that calls different pages. I need to set the time out for each page, but I dot know where to set this value or where to look for it.

And is there a way to change the time out once the page has started?

For example if the initial time out is 3 mins,
but once the user logs in depending on who they will have a different time alloctated for the time out.
0
Comment
Question by:jhacharya
  • 6
  • 4
10 Comments
 
LVL 5

Assisted Solution

by:zvytas
zvytas earned 500 total points
ID: 36580813
I assume you need to set script execution timeout, not session timeout. This can be done as follows:

// 60 seconds = 1 minute
Server.ScriptTimeout = 60;

You can put this code in the Page_Load for each page OR in the global.asax.
0
 
LVL 2

Assisted Solution

by:jhacharya
jhacharya earned 0 total points
ID: 36580978
this doesnt seem to be working

I have a log in page which has no time out setting so i presume that there is some default

this log in page calls my data page and this is where I wanted to set a time out

I placed the Server.ScriptTimeout = 1; in the Page_load section, but this does not time out the page.

I am testing this from  visual studio using debugging (F5) so i dont knwo if doing this ignores the time out error. I also can not find any global.asax page in my pjoect

        protected void Page_Load(object sender, EventArgs e)
        {
           
            try
            {
                Server.ScriptTimeout = 1;
..
..
0
 
LVL 5

Accepted Solution

by:
zvytas earned 500 total points
ID: 36581043
I would guess this is because debug attribute in the web.config is set to true. See the following for more details:

http://blogs.msdn.com/b/paraga/archive/2006/05/08/592417.aspx
0
 
LVL 2

Assisted Solution

by:jhacharya
jhacharya earned 0 total points
ID: 36581282
I have set the             <compilation debug="false" targetFramework="4.0">
            </compilation>
in the webc.config file but still no luck with tryng to test the time out...

i am not sure how i can test this out before i relese the web page. I do not have a test wb server to deploy. I only have a production env which is live and my development ....

is there anything else i can try?


here is my wec.config file in whole

<?xml version="1.0"?>
<configuration>
      <appSettings/>
      <connectionStrings/>
      <system.web>
            <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
            <compilation debug="false" targetFramework="4.0">
            </compilation>
            <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
            <authentication mode="Windows"/>
            <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
            <pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"/></system.web>
      <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
</configuration>
0
 
LVL 5

Assisted Solution

by:zvytas
zvytas earned 500 total points
ID: 36581298
Are you running the website in the Debug build configuration? I would try changing it to Release.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Assisted Solution

by:jhacharya
jhacharya earned 0 total points
ID: 36581541
i cant seem to do what you are suggesting I test the website directly from Visual studio 2010, I have tried with the debug option off ... i am not sure how to test this change from my pc.

0
 
LVL 5

Assisted Solution

by:zvytas
zvytas earned 500 total points
ID: 36581586
So are you running the website in Debug configuration?
0
 
LVL 2

Assisted Solution

by:jhacharya
jhacharya earned 0 total points
ID: 36582055
no i use the debug off which is done by using cntrl + F5
0
 
LVL 2

Author Comment

by:jhacharya
ID: 37693082
awarding poibnts for effort
0
 
LVL 2

Author Closing Comment

by:jhacharya
ID: 37708851
closing our question as no one could really find the issue
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now