Click here to Skip to main content
15,886,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
private string Search(string ids, string qryStr) {

      var ws = new searchws.AppSearchSoapClient("AppSearchSoapClient", ConfigHelper.search_Url);
      // rest logic are there   
       
    }
//the above is the code snippet where we are binding service .So Service is down,how can we render a message like service is down kindly try after some time. Please guide me on this.Thanks for your help


What I have tried:

I am looking for suggestion how can we achieve it using asp dot net web application using 4.7.2
Posted
Updated 15-Mar-23 19:52pm
Comments
GKP1992 15-Mar-23 4:21am    
Usually when a service is unavailable it would result in HTTP response code 503.
You can use this to write specific logic to show a user-friendly message on the UI.

 
Share this answer
 
v2
In catch blok I wrote like this ...but the messagebox is not showing in UI level....I need to show the error message in UI when service is down
Please help

if(((System.Net.HttpWebResponse)((System.Net.WebException)ex.InnerException).Response).StatusDescription == "Not Found")
{

    Response.Write("<script>alert(' Service is down...Please try after sometimes');</script>");
    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Record Inserted Successfully')", true);
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900