Reputation: 65155
Example
When editing item
/domain.com/app/item/detail/111
OR
/domain.com/app/item/detail/?Id=111
When creating a new item
/domain.com/app/item/detail/new
OR
/domain.com/app/item/detail/
Upvotes: 0
Views: 1800
Reputation: 2982
You can access query strings like this
@if(Request.QueryString["Id"] == "111")
{
<div>foo bar</div>
}
or
use ViewBag in your controller to give the information to the view
public ActionResult Detail(string Id)
{
ViewBag.Id = Id;
return View();
}
Then in your view
<div>@ViewBag.Id</div>
Upvotes: 3