We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Custom error page for "Query timeout expired" errors?RSS

11 replies

Last post Apr 23, 2021 08:59 AM by samwu

  • Custom error page for "Query timeout expired" errors?

    Apr 19, 2021 09:29 AM|Chenks76|LINK

    hi

    Windows Server 2008 R2 running IIS 7.5
    We have a page that pulls data from an SQL database and displays the data in a table. Sometimes (depending on the time of day) the database is getting hit quite a lot and the query the pages times out - which is fine as this would be a low priority query request anyway.

    However, IIS simply displays a basic "query timed out" error.
    Is it possible to replace this with a custom error page? (We already have one in place for 404 errors).

  • Re: Custom error page for "Query timeout expired" errors?

    Apr 20, 2021 01:57 AM|samwu|LINK

    Hi Chenks76,

    Yes, the following configuration example demonstrates how to specify the error handling pages to use for an ASP.NET application.

    <configuration>
      <system.web>
      <customErrors defaultRedirect="GenericError.htm" mode="RemoteOnly">
        <error statusCode="404" redirect="InternalError.htm"/>
        </customErrors>
      </system.web>
    </configuration>

    More information you can refer to this link: customErrors Element.

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Custom error page for "Query timeout expired" errors?

    Apr 20, 2021 07:05 AM|Chenks76|LINK

    samwu

    Yes, the following configuration example demonstrates how to specify the error handling pages to use for an ASP.NET application.

    it's not an asp.net application though.

    and i do already know how to set up customer errors (for 404 etc).

    i was asking about this specific error.

  • Re: Custom error page for "Query timeout expired" errors?

    Apr 21, 2021 08:33 AM|samwu|LINK

    Hi Chenks76,

    Chenks76

    i was asking about this specific error.

    Do you have an error code for this specific error? If not, you can use iis url rewrite to redirect this error page to 404.

    https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Custom error page for "Query timeout expired" errors?

    Apr 21, 2021 08:38 AM|Chenks76|LINK

    samwu

    Do you have an error code for this specific error? If not, you can use iis url rewrite to redirect this error page to 404.

    hi

    all that i have is what is displayed on screen - which is what the screenshot in the opening post shows.

  • Re: Custom error page for "Query timeout expired" errors?

    Apr 21, 2021 08:41 AM|samwu|LINK

    Hi Chenks76,

    Chenks76

    all that i have is what is displayed on screen - which is what the screenshot in the opening post shows.

    Then I suggest you use url rewrite.

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Custom error page for "Query timeout expired" errors?

    Apr 21, 2021 08:46 AM|Chenks76|LINK

    samwu

    Then I suggest you use url rewrite.

    URL rewrite based on what though?
    i would need to create a rewrite rule for every single page where this might happen?

    the error is displayed in the content of the page (and numerous others that do a similar thing), not the URL

  • Re: Custom error page for "Query timeout expired" errors?

    Apr 21, 2021 08:53 AM|samwu|LINK

    Hi Chenks76,

    Chenks76

    URL rewrite based on what though?
    i would need to create a rewrite rule for every single page where this might happen?

    the error is displayed in the content of the page (and numerous others that do a similar thing), not the URL

    You can redirect the url of the error page to 404.

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Custom error page for "Query timeout expired" errors?

    Apr 21, 2021 09:01 AM|Chenks76|LINK

    samwu

    Hi Chenks76,

    Chenks76

    URL rewrite based on what though?
    i would need to create a rewrite rule for every single page where this might happen?

    the error is displayed in the content of the page (and numerous others that do a similar thing), not the URL

    You can redirect the url of the error page to 404.

    Best regards,

    Sam

    the existing "error page" doesn't have it's own URL, the content of the existing URL displays the error shown in the screenshot.

    so if i load https://blah.com/tableresults.asp the error is displayed within the content of that page

    same if the page is https://blah.com/tableresults2.asp

  • Re: Custom error page for "Query timeout expired" errors?

    Apr 22, 2021 07:36 AM|samwu|LINK

    Hi Chenks76,

    Chenks76

    the existing "error page" doesn't have it's own URL, the content of the existing URL displays the error shown in the screenshot.

    How do you access the page without the url?

    Chenks76

    so if i load https://blah.com/tableresults.asp the error is displayed within the content of that page

    same if the page is https://blah.com/tableresults2.asp

    In the url rewriting rule, you can use parameters to match only tableresults.asp.

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >
  • Re: Custom error page for "Query timeout expired" errors?

    Apr 22, 2021 07:46 AM|Chenks76|LINK

    samwu

    Hi Chenks76,

    Chenks76

    the existing "error page" doesn't have it's own URL, the content of the existing URL displays the error shown in the screenshot.

    How do you access the page without the url?

    Chenks76

    so if i load https://blah.com/tableresults.asp the error is displayed within the content of that page

    same if the page is https://blah.com/tableresults2.asp

    In the url rewriting rule, you can use parameters to match only tableresults.asp.

    Best regards,

    Sam

    i think either you are not understanding me fully or i am not understanding you fully.

    the error i am getting is not an "error" page, but rather just a message displayed within the conten of the page that a timeout error occured when the page tried to run an SQL query.

    the URL is just the URL of the actual page, not the URL of an IIS "error" page.

    this error could occur on any page, not just the specific example i gave.

    if you are saying this can be achieved using a URL rewrite in the say way a 404 error would be handled (which i already configured), then please explain in a little more detail, as from what i can see it's not possible.

  • Re: Custom error page for "Query timeout expired" errors?

    Apr 23, 2021 08:59 AM|samwu|LINK

    Hi Chenks76,

    Chenks76

    the error i am getting is not an "error" page, but rather just a message displayed within the conten of the page that a timeout error occured when the page tried to run an SQL query.

    the URL is just the URL of the actual page, not the URL of an IIS "error" page.

    If it is an error in the SQL query query, it cannot be replaced with a custom error page, you can only use one url to replace another url.

    Best regards,

    Sam

    IIS.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today. Learn more >