Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

c# Webpage Setting the timeout

Posted on 2011-09-22
10
Medium Priority
?
233 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 1000 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 1000 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
Implementing Azure Infrastructure Exam 70-533

This course is designed to familiarize and instruct students in the content that is covered by Microsoft Exam 70-533, Implementing Microsoft Azure Solutions. It focuses on all the November 2016 objective domain topics.

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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

715 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