/// <summary> /// delete a host /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void DeleteHostButtonClick( object sender, EventArgs e) { if (_enterpriseClient == null || _enterpriseSession == null || !_hostId.HasValue) { return; } try { _enterpriseClient.DeleteHost(_hostId.Value, _enterpriseSession.SessionID); // refresh the hosts list Response.Redirect(Request.RawUrl + (Request.RawUrl.Contains("?") ? "&" : "?") + "edit=success" + string.Format("&hostType={0}", _hostType)); } catch (ThreadAbortException) { // occurs because the response is ended after redirect } catch (Exception exc) { System.Diagnostics.Trace.TraceError("Failed to delete host {0} ({1})", _hostId.Value, exc); } }
/// <summary> /// delete a host /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void DeleteHostButtonClick( object sender, EventArgs e) { if (_enterpriseClient == null || _enterpriseSession == null || !_hostId.HasValue) { return; } try { _enterpriseClient.DeleteHost(_hostId.Value, _enterpriseSession.SessionID); // refresh the hosts list Response.Redirect(Request.RawUrl + (Request.RawUrl.Contains("?") ? "&" : "?") + "edit=success"); } catch (Exception exc) { System.Diagnostics.Trace.TraceError("Failed to delete host {0} ({1})", _hostId.Value, exc); } }