Solved

c# Webpage Setting the timeout

Posted on 2011-09-22
10
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 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