TechQA.

Linked Questions

  • HtmlHelper missing?
  • MVC 2 Models Directory
  • wildcards in asp.net mvc routes
  • how to exclude another attribute in this syntext [Bind(Exclude = "ID")] in MVC
  • Generating a client URL in a Timer running in global.asax
  • usefulness of microsoft data access application
  • MVC update Dropdownlistfor with jquery
  • changing stylesheet in MVC view
  • Building pages with multiple views
  • <%= How to write out a String MVC.Net
  • How to select and pass data from the view
  • MVC Custom Model - Where is a simple example?
  • How to interact with List<t> in MVC
  • Affect CultureInfo for all application
  • In ASP.NET MVC I encounter an incorrect type error when rendering a user control with the correct typed object

Popular Questions

  • Partially applied generic function "cannot be cast to Nothing"
  • Agar.io style ripple effect for canvas arcs
  • What is the difference between [ValidateModel] and a check of valid state in ASP.NET?
  • Passing shared_ptr to std::function (member function)
  • UWP location tracking even when the app was suspended
  • Dynamic partition in hive
  • Woocommerce Different Products Different Currency
  • Rails render js file but can't execute it
  • My rotated TextView is cut off. What i have to do?
  • Store object created by gson in greenDao

Return different view, depends on caller view

Asked by Community At 01 May at 19:23

I have action which, update database. I can call it from two different views. I would like to return view A when view A call this funtion and return view B when view B call it. How to do that?

asp.net-mvc
Original Q&A

1 Answers

0
evilGenius Answered by evilGenius On 01 May at 19:39

you can add to your business model new property

string action = Routing(model.First().Action);
return RedirectToAction(action);

Related Questions

  • ASP.NET MVC JavaScript Routing
  • Download a file using a POST request rather than GET
  • ActionLink contains current parameters when route matches
  • Is there a way to include a fragment identifier when using Asp.Net MVC ActionLink, RedirectToAction, etc.?
  • Best practices for project organization with ASP.NET MVC
  • Stuck creating a "security trimmed" html.ActionLink extension method
  • Best practices for model definition in ASP.NET MVC
  • asp.net mvc checkbox detailview
  • Problem with Strongly Typed Views
  • Creating your own table with CommandArgument buttons in ASP.NET MVC
  • Route all controller actions to a single method, then display a view according to action name
  • ASP.NET MVC Readonly Field Based on Action in Partial View
  • MVC, Elmah, apparent hacker attempts and "generic" IgnoreRoutes
  • Is really impossible to write code in an mvc master page?
  • ASP.Net MVC Route to Username
  • Privacy
  • Terms
  • Cookies