0

In Asp.NET MVC, how do you make your controller return a view with a query string?

thanks

3 Answers 3

1

It might be better if you post what you are trying to accomplish. The simple answer is that you can't, the querystring is part of the request so if you wanted to do that you would need to redirect to your view with the querystring as part of the URL... but it sounds like you are perhaps trying to use the querystring to pass data to the view? If so you are much better off using ViewData.

Sign up to request clarification or add additional context in comments.

Comments

0

This should get you started with returning views. And this tutorial should show you how params can be passed into actions to generate specific results.

Comments

0

Use this

return RedirectToAction("AmendAbsence", new RouteValueDictionary (new  {  Controller ="Absence", Action="AmendAbsence", Id=id }));

Configure your Global.asmx appropriately

thanks

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.