Is Setting The Value Of Server.ScriptTimeout Enough To Prevent Page Timeouts

Dec 20, 2010

On an administrative page with a long running process we're setting the following:

protected void Page_Load(object sender, EventArgs e)
{
this.Server.ScriptTimeout = 300;
//other code
}

Is this enough that should prevent that page from timing out as it does what it needs to? I have no control over the process and how long it runs but we've found that 5 minutes is more than enough time, yet we're still getting intermittent errors of:

System.Web.HttpException: Request timed out.

We've tried upping the value to 600 with really no difference and in any testing we've done we can never get the actual process to run for that long. Is there elsewhere that we need to be setting timeout values that won't affect the entire application and only the specific page we need the longer timeout value on?

View 1 Replies


Similar Messages:

State Management :: To Prevent The Server From Setting Cookie On The Client Machine?

Sep 2, 2010

I have deployed a Web application on IIS 6. I want to prevent my server from setting cookie on the client browser. I am using the following setting on the web.config file.

< sessionState
mode="InProc"
cookieless="false" [code]....

However, it looks like its creating a default cookie named ".ASPXAUTH" in the client machine. I dont want my application to create any sort of cookie.Is there anything specific I need to do in web.config?

View 3 Replies

AJAX :: Server And Client Side Timeouts - Server Timeout Not Triggering?

Nov 22, 2010

We have an UpdatePanel that is showing a gridview with loads of data in it. We have loads of well written sprocs that don't take very long, BUT we have a few horrible ones that take ages.

We do intend to rewrite them but in the interim we have put the ADO.NET commandtimeout up to 180s. The scriptManager.AsyncPostBackTimeout is set to 240s. We want to handle this on the serverside. One of the reports still fails (it's got a couple of nested cursors in it - someone who hasn't had SQL lesson 101 from me!).

Half the time, the nice error timeout message is shown using server side handling of the command timeout. The problem is that the other half of the time the commandtimeout doesn't seem to fire.

View 1 Replies

State Management :: Avoiding Timeouts With Very Long Page Processing?

Apr 7, 2010

I have an asp.net page that will be doing some processing that may take a very long time to complete. I cannot just set the page timeout value since this is going to be in a hosted environment and the timeout values that I set in my web.config are overridden by the server host. What I'm doing is taking a file from a FileUpload control and doing some web requests to a 3rd party service for each line in the file, all of which may take a very long time to process a large file. I'm talking on the order of, say, 30 minutes, and there's just no way to optimize this any further to cut down on the processing time. Is it possible to even do such a lengthy page request in asp.net? Can someone give me a pointer in the right direction here to make this happen? Is my only hope to create an async page? It seems that doing an async page is the way to go if I have a potential for a lot of lengthy requests, but really this massive of a request is going to happen VERY rarely so this is not an issue of running out of thread pool since most of the time this particular request will be completed relatively quickly, but on occasion it may receive a very large file it will need to process and will take a very long time. So what is the best way to handle that case?I'd also like to update the client with the processing status as the processing is going on. I'm familiar with doing client ajax calls via jQuery to a page webmethod so if there is some clean way to update the client as this long processing

View 7 Replies

C# - Prevent Thread.CurrentThread.CurrentCulture To Switch To The Default Browser Value After Setting It Manually?

Aug 26, 2010

In my current application I want to implement ASP.Net localization with global resources. I have the problem, that after changing the CurrentThread.CurrentUICulture and CurrentThread.CurrentCulture and changing to another page, these values are overwritten by the browser default values.

I have a DropDownList that enables a selection between different languages. In the ItemChanged Event I store the culturename in the session, redirect to my defaultpage and use this code

protected override void InitializeCulture()
{
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE");
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
base.InitializeCulture();
}

After switching to another contentpage, that does not override InitializeCulture I'm back to the default browser language. How can I make that persistent?

What options do I have? The following come to my mind:

On every *.aspx page I do implement InitializeCulture I create a new class that derives from System.Web.UI.Page and overrides the InitializeCulture Eventhandler. Every *.aspx page I use derives from it.

Isn't there a more "built-in" way? ASP.net offers such good localization support, so I guess there must be an easier/more efficient way to achieve my goal. Which one is there?

View 3 Replies

C# - Setting HttpCacheability.Public Also Cache The Page On The Server?

Mar 24, 2010

I have these lines in my global.asax (basically because of http://stackoverflow.com/questions/2469348/can-i-add-my-caching-lines-to-global-asax)

The thing I want to now understand is whether this code purely adds the HTTP headers to the page or does it also make .Net cache this page on the server for 300 seconds?

Response.Cache.SetExpires(DateTime.Now.AddSeconds(300));
Response.Cache.SetCacheability(HttpCacheability.Public);

View 1 Replies

Setting A Server Control Property From The Content Page?

Oct 27, 2010

I need to validate a textbox to ensure the submit date is older than Today. I wanted to use a CompareValidator to do that, but unfortunately the following code doesn't work:

<asp:CompareValidator ID="cvtbDateExpiration" ControlToValidate="tbDateExpiration"
Operator="GreaterThan" Type="Date" ValueToCompare="<%= DateTime.Today %>"
ErrorMessage="Card has expired" runat="server" />

The compiler tells me that ValueToCompare="<%= DateTime.Today %>" is wrong: "This is not scriptlet. Will be output as plain text."

Is there a simple way to achieve this (without setting it using the Code Behind)?

View 1 Replies

IIS Configuration :: Setting Start Or Default Page In Server?

Feb 20, 2013

I have problem with default.aspx setting in global.asax file.When i am running dot net application from solution explorer i can set the default page as start page or when i am running the application the on IIS server i can set that default page as start page through the setting.This thing i want to do in programmatic way using the global.asax file

View 1 Replies

Web Services - Does The Server Timeout Setting Affect The Client Timeout Setting

Oct 15, 2010

I'm working with ASP.Net web services and am having a problem with a long-running process that takes about 5 minutes to complete, and it's timing out. To fix this, I was able to set the executionTimeout on the server's web.config to 10 minutes, and then set the .Timeout property on the Web Service object to approximately 9 minutes. Now, I'm worried that this may possibly cause some other web service calls to sit there for 10 minutes before they time out rather than the previous 90-100 seconds. I know the default on the client side is 100 seconds, but wasn't sure if updating the server's timeout setting would affect this.

Bottom line is - Is it safe to update the server's timeout setting to a long amount like 10 minutes, and rely on the default timeout on the client, or could this end up causing some problems?

View 1 Replies

All Webrequests Timeouts Location?

Jan 16, 2010

I have a file upload to SQL Server 2005 DB that keeps timeing out at different times. I know about the web.config <httpRuntime maxRequestLength="2097151" executionTimeout="180"/> Where else are there times out settings?

View 8 Replies

Timeouts For Process That Can Take Hours

Nov 22, 2011

I have a web service that sends up to 5000 emails to our customers.

It is called asynchronously from a web application and then chuggs away sending the emails. Generally it works okay. Yesterday, it kept stopping - sometimes after sending a small number (33 first time) and then it might send another couple of hundred - then 50 or so etc. This went on all day as I kept manually calling the web service.

The data (subject, body, fromaddress, replytoaddress etc) is all kept in the database - as are the recipients.

Here's the code that gets the data from the database.

// Create Instance of Connection and Command Object
SqlConnection myConnection = new SqlConnection(ConnectionString);
SqlCommand myCommand = new SqlCommand("CPEmailsToSend_List", myConnection);

// Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure;
myCommand.CommandTimeout = 1000;

[Code]....

So I have a dataset containing 3 sets of data - the subject, body etc., a list of attachments and a list of recipients. I then use the .net smtpClient like this:

Code:
//about to start sending emails - update the MessageSendStatus to inprogress
myCommand.CommandText = "CPEmailSendStatus_Update";
myCommand.Parameters.Clear();
myCommand.Parameters.Add("@CPEmailID", SqlDbType.Int).Value = CPEmailID;
myCommand.Parameters.Add("@SendStatus", SqlDbType.TinyInt).Value = 1;

[Code] ....

When the web service stopped (it kept stopping yesterday) - no errors were raised. I have a function on the page that checks the email address is valid before I try to send the email as I know the smtpClient does not like invalid email addresses. Normally, invalid email addresses are trapped and the loop continues and sends the next one etc. But, yesterday, it just stopped sending. No error messages - nothing.

So, I began to wonder if the Command object is timing out. With a lot of email addresses to send to (up to 5000) and half a dozen attachments - the web service can take a long time (hours) to send all the emails. So, is the fact that I am reusing the command object over and over again for different stored procedures the issue? (I do this a lot and have never had a problem before - I read somewhere that the CommandTimeout only counts the time network access is used).

I've been sending test emails all morning (but I can only send small batches as I have a limited number of email addresses I can send test emails to) and they have all worked okay ... but, yesterday, trying to send about 5000 emails took about 30 attempts.

View 1 Replies

WCF / ASMX :: Customize Timeouts For Web Services?

Mar 25, 2010

I have a webservice, that when called, calls many other web services based on the information that was sent. I have always left the timeout as the default, or a better way to describe it, I have never changed anything.
How (and where) do I change the timeouts for each service individually. Since I have quite a few now, I want the original transaction to never take more than 30 seconds. That said. I want to go in and change the timeouts for the services I have to ping in that 30 seconds to be 5 to 10 seconds based on which one.

View 2 Replies

C# - Best Approach To Handle Session Timeouts?

Jul 22, 2010

There are various ways to handle session timeouts, like "meta refreshes" javascript on load functions etc.

I would like something neat like: 5 minutes before timeout, warn the user...

I am also contemplating keeping the session open for as long as the browser is open(still need to figure out how to do it though... probably some iframe with refreshing).

How do you handle session timeouts, and what direction do you think i should go in?

View 3 Replies

Security :: How To Control Session Timeouts

Feb 19, 2010

My web.config file contains:

<system.web>
<membership defaultProvider="AccessMembershipProvider"
userIsOnlineTimeWindow="30">
<providers><clear/>
<add
name="AccessMembershipProvider"
type="Samples.AccessProviders.AccessMembershipProvider, SampleAccessProviders" .... >
</providers>
<membership>

I expected this would set 30 minutes as timeout for inactive sessions, but they seem to be timing out much sooner.

Is there some other way to specify time for session timeout ?

I know I am using an unsupported AccessMembershipProvider which I was forced to do because my host service does not support SQL Server Database (so I am using an Access Database).

However, this AccessDB provider seems to work fine in all other respects. I'm suspecting that the early timeout is because of some other obscure setting.

View 1 Replies

Handling Timeouts In A Website SQLCommand Object And C#?

May 14, 2010

I'm using visual studio 2008 and sql server 2005 and everything is working just fine under normal use. However if a user is on a page for a while several minutes with no activity then clicks a button on occassion the site throws the following exception ...

Procedure or Function "sp_name" parameter '@SomeParameterName', which was not supplied

I'm also encountering this error in Visual Studio while debugging the application, in otherwords run the site from visual studio then make some change to the html in VS save the changes and refresh the page.

The error is not consistent nor is the time the page has to stay idle in order for it to occur....

The current sql command object timeout is 30 secs and the website timeout is 30 minutes.

View 1 Replies

State Management :: Different Session Timeouts For Different Users?

Jun 22, 2010

I are building a web application which will be deployed to Windows Azure. I want user to set session timeout value which will be stored in Database. Currently I am aware of Web.Config method to set session timeout. i.e.

<sessionState
mode ="InProc"
timeout ="60"></sessionState>

Is there any method to set session timeout value according to User's Preference?

View 5 Replies

Visual Studio :: Azure VS2010 Timeouts During Debug?

Sep 14, 2010

I've converted an ASP.Net website over to an Azure version and I've got it up and running. However the vast majority of the time I experience timeouts when I'm trying to debug the application.This seems to happen on any page at any time. I start debugging from VS2010 and sometimes the home page will come up sometimes it hangs. When it does come up if I select an item from a drop down list sometimes it works somtimes it times out. I have breakpoints set and they don't even fire I just eventually get the time out.

If I hit refresh that sometimes seems to fix it but it eventually starts happening again. This is making the completion of the conversion VERY difficult and I'm starting to creep up to a deadline.Does anyone have any idea what might be happening? If there is a better location I can post this question to would someone be kind enough to point me in the right direction?Thanks in advance for any help and in addition my email is
mgorgone@pictureu.com as our Windows Live account email is diff.

View 1 Replies

State Management :: Gracefully Handle Session Timeouts?

Oct 13, 2010

Can I still use Session_OnEnd to trap a session timeout? Is there a better way to trap a session timeout? I want to take the user to a page that tells them the session timed out, and give them an opportunity to re-enter the application in a new session if they wish. How can I accomplish this? Is there still a global.asax file in the .NET 4.0 world?

View 1 Replies

C# - Avoiding Deadlocks And TimeOuts When Processing Huge Data?

Oct 14, 2010

I have code in an ASP.NET form that needs to, depending on user entry create messages in the database. We are speaking of potentially thousands of db entries. How do I protect against deadlocks, I mean apart from using Transactions and setting IsolationLevel to Serializable, as well as using WITH(NOLOCK) statement on my select statements since I don't mind a dirty read.

Event code: 3005 Event message: An unhandled exception has occurred. Event time: 10/13/2010 10:12:14 PM Event time (UTC): 10/14/2010 3:12:14 AM Event ID: a565c58a7f844692859aa21303447c7c Event sequence: 206 Event occurrence: 1 Event detail code: 0 Application information: Application domain: /LM/W3SVC/610100832/Root-12-129314933998593750 Trust level: Full Application Virtual Path: / Application Path: D:Websitesadmin.beta.sharedTime.com Machine name: SHAREDTIME Process information: Process ID: 3440 Process name: w3wp.exe Account name: NT AUTHORITYNETWORK SERVICE Exception information: Exception type: SqlException Exception message: Transaction (Process ID 56) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. Request information: Request URL: http://beta.admin.sharedTime.com/admin_text_mass_send.aspx Request path: /admin_text_mass_send.aspx User host address: 69.211.10.138 User: Is authenticated: False Authentication Type: Thread account name: NT AUTHORITYNETWORK SERVICE Thread information: Thread ID: 10 Thread account name: NT AUTHORITYNETWORK SERVICE Is impersonating: False Stack trace: at mtNamespace.mt.createmessage_queue(String phone_number, String text_message, DateTime send_on, String system_name, Double user_no, Double send_priority, String message_type, Boolean returnqueue) in http://server/App_Code/mt.vb:line 1509 at ASP.admin_text_mass_send_aspx.save_user_values(Object sender, EventArgs e) in http://server/admin_text_mass_send.aspx:line 103 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) Custom event details:

View 1 Replies

Web Forms :: Prevent Master Page From Loading Whenever Content Page Loads?

Mar 10, 2010

The problem with my web application is when ever i load the home page - The master page as well as content page loads ---This seems fine but when i navigate thorugh the website which have the same Master page but diffrent content page .... the master page loads again. What i want to do is ..I want to keep the master page intact and only the content page loads. How can I accomplish it..

View 3 Replies

Databinding - Prevent Page From Automatically Binding Data Controls On The Page?

Dec 6, 2010

How can I prevent ASP.NET page from automatically binding data controls on the page? I want to increase performance and I want to do binding of each data control based on my own order.

View 1 Replies

How To Prevent The Page To Load Elements In The Page Refresh ASP

Jun 22, 2010

I have a page that add Items to RadioButtonList with this code :

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
RD.Read()
RBQ1.Items.Add(RD.GetString(3))
RBQ1.Items.Add(RD.GetString(4))
RBQ1.Items.Add(RD.GetString(5))

View 2 Replies

SQL Server :: How To Prevent Deadlock

Sep 28, 2010

how to prevent deadlock? read from other forum knowing that even a simple select statement will cause deadlock, but i confuse on how can i prevent it?

View 8 Replies

.net - How To Prevent Go To The Top Page

Mar 27, 2011

Possible Duplicate:scroll go to the top page how i can prevent go to the top page when post back page (asp.net)

View 1 Replies

SQL Server :: How To Prevent Inserting Record

Aug 14, 2010

Students can subscribe for any project via a webform. Table 'project ' contains all the proposed project and table 'student' contain the name of the student and the project-id.Now, suppose there is a limit of 4 students for project 'A' and there are already 3 subscribed students for that project. One more student can choose that project. The code-behind checks whether the limit is not reached (by counting the amount students for that project in table 'student') before inserting that student in the table 'student'.

My problem is that when two students fills the webform for the same project and click on the 'save-button' exactly at the same time, the code has no time to check the limit and both students are inserted into table 'student'. Is there a way to lock the table or something in order to preventing this?

[Code]....

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved