Advertisement

08.18.2008 at 06:34AM PDT, ID: 23656245
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Catching errors when connection to server is lost

Asked by Balltown in Programming for ASP.NET, C# Programming Language, Microsoft Visual C#.Net

Tags:

I'm using ASP.NET AJAX to show information on an info-screen. The application show a page for 5 seconds the switchs to another. When all pages has been shown the first page will be shown agian and so on...
The problem is if the connection to the server is lost the client machine will show a javascript alert-box with the text: "Sys.WebForms.PageRequestManagerTimeoutException: The server request timed out.". I know you could add "AsyncPostBackTimeout" to the ScriptManager like so...

<asp:ScriptManager ID="sm" runat="server" AsyncPostBackTimeout="180" />

... but I don't think this would solve the problem.

I tried simulating the error in 2 ways:
1) Renaming the database in Web.Config while the application was running. This works fine because I have a try...catch.
2) Stopping IIS while the application was running. This throws another error: "Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occured while processing the request on the server. The status code returned from the server was 12029"

Ofcause ASP.NET cannot work offline. Are there some way to catch the error - maybe though JavaScript? Like if it catches an error it should retry a minute late or so...

Theres a lot of code so here is the very basic...Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
/// default.aspx ///
 
<asp:ScriptManager ID="ScriptManager1" runat="server" AsyncPostBackTimeout="180" />
 
<asp:Timer ID="Timer1" runat="server"></asp:Timer>
 
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="Timer1" />   
    </Triggers>
    <ContentTemplate>
        <asp:Label ID="color_border" runat="server"></asp:Label>
        <div id="container" runat="server">
            <div style="background-color: transparent; position: absolute; z-index: 2;">
                <asp:Label ID="Heading" runat="server"></asp:Label>
                <asp:Label ID="Message" runat="server"></asp:Label>
            </div>
            <div id="trans" class="trans" runat="server"></div>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
 
 
/// default.aspx.cs ////
protected void Timer1_Tick(object sender, EventArgs e)
{
    try
    {
        // Connection to DB.
        // Put stuff into labels here.
    }
    catch 
    {
        Timer1.Interval = 15000;
    }
}
[+][-]08.18.2008 at 06:49AM PDT, ID: 22251761

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.18.2008 at 06:58AM PDT, ID: 22251839

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.18.2008 at 11:58PM PDT, ID: 22257660

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, C# Programming Language, Microsoft Visual C#.Net
Tags: ASP.NET, Visual C#
Sign Up Now!
Solution Provided By: Balltown
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628