When I want to pass some value that won't be seen by users, I find it useful to use this.
It can help us creates a hidden input on the form for the field for pass.
For example, in .Net MVC view
@Html.HiddenFor(model => model.IsEvent)
in Controller
[HttpPost] [Route("edit")] [ValidateAntiForgeryToken] public ActionResult Edit(Tweet tweet) // the tweet instance will contained assigned IsEvent value { var loggedUserId = this.User.Identity.GetUserId(); tweet.AuthorId = loggedUserId; tweet.DatePosted = DateTime.Now; Data.Tweets.Update(tweet); Data.SaveChanges(); return RedirectToAction("Index", "Home"); return View(tweet); }