ASP.NET MVC Routing From Controller Based On Access or Business Logic
12/12/2013 3:27:33 PM
Less first understand rounting module in MVC as shown below diagram-
For more information on MVC Routing refer -ASP.NET MVC Routing
Consider this situation where if logged in user has admin right then you want to redirect him to Admin if user is not admin redirect to Listing (index)page.
Here is code snippet to do this:
public ActionResult Edit(ITEM item)
db.Entry(item).State = EntityState.Modified;