How To Properly Use Redirecttoaction With String Parameters In Asp Net Mvc

Url Routing In Asp Net Mvc Example With Multiple Parameters Query You can pass the id as part of the routevalues parameter of the redirecttoaction () method. this will cause a redirect to site controller action 99. no need for temp or any kind of view data. is there anyway of doing that or something similar but also specifying the controller?. In asp mvc, the redirecttoaction function is used to switch pages and transfer data between action methods. you may quickly reroute users to the relevant page and pass the information required to carry out the planned action using the correct syntax and parameters.

Url Routing In Asp Net Mvc Example With Multiple Parameters Query With this approach, you will issue a redirect response with a unique id in the querystring, using which the second get action method can query the resource again and return something to the view. return redirecttoaction("details", "store", new { storeid=newstoreid} );. If you have objects that will be represented by the uri being redirected to, then obviously you would pass the identifying information required to retrieve them (id, slug, etc.) using either the uri path and or querystring.

C Asp Net Mvc5 Redirecttoaction Stack Overflow
Comments are closed.