Solved

c# Webpage Setting the timeout

Posted on 2011-09-22
10
226 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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
 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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