Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save patkleef/f78d19262337e6e6033e5bad30b3523b to your computer and use it in GitHub Desktop.

Select an option

Save patkleef/f78d19262337e6e6033e5bad30b3523b to your computer and use it in GitHub Desktop.
Application Insights Blog - ApplicationInsightsRegisterActionMethod.cs
[System.Web.Mvc.HttpPost]
public ActionResult Register([FromBody]RegisterModel model)
{
var dic = new Dictionary<string, string>();
dic.Add("email", model.Email);
dic.Add("name", model.Name);
dic.Add("category", Session["selectedCategory"]?.ToString());
_telemetryClient.TrackEvent("Registration form entered event", dic);
var key = _dataService.GetKeyByCategory(Session["selectedCategory"]?.ToString());
_dataService.Save(key, model);
return View("Registered");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment