public IActionResult UrlEncode(UrlEncodeViewModel model) { try { if (model.Decrypt) { model.ResultString = WebUtility.UrlDecode(model.SourceString); } else { model.ResultString = WebUtility.UrlEncode(model.SourceString); } } catch (Exception e) { model.ResultString = $"Invalid input! Error message: \r\n{e.Message} \r\n {e.StackTrace}"; } return(View(model)); }
public IActionResult UrlEncode() { var model = new UrlEncodeViewModel(); return(View(model)); }