public void ProcessRequest(HttpContext context) { try { Location location = new Location() { Point = GeoRssPoint.Parse(context.Request.Form["lat"], context.Request.Form["lng"]) }; if (FireEagle.UpdateLocation(context, location, new Uri(context.Request.Url, context.Request.ApplicationPath))) { AjaxHelper.SendOk(context); } else { AjaxHelper.SendError(context, "Unable to update location"); } } catch (AuthorizationRequiredException authex) { AjaxHelper.SendAuthorizationRequired(context, authex); } catch (ThreadAbortException) { throw; } catch (Exception ex) { AjaxHelper.SendError(context, "Unexpected error: " + ex.Message); } }
private void Page_Load(object sender, EventArgs e) { try { this.UserLocation = FireEagle.GetLocation(Context, Context.Request.Url); } catch (AuthorizationRequiredException authex) { Response.Redirect(authex.AuthorizationUri.AbsoluteUri); } }
public void ProcessRequest(HttpContext context) { try { Location location = FireEagle.GetLocation(context, new Uri(context.Request.Url, context.Request.ApplicationPath)); if (location != null) { AjaxHelper.SendLocation(context, location); } else { AjaxHelper.SendError(context, "Could not get location"); } } catch (AuthorizationRequiredException authex) { AjaxHelper.SendAuthorizationRequired(context, authex); } }