c# - redirect from action inside controller? -


mvc - instead of creating vm , passing in values , drawing view. want redirect url using values parameters....so

instead of:

var model = new availabilitysteponeofbookingvm(bookingquery,                       listofbookings, chosendate, foodpodid);  return view(model); 

i want load url:

http://localhost:40310/orchardlocal/food/foodpodavailability/           steponeofbooking/(value of foodpodid)/(value of chosendate) 

redirect action? directly here or create view , redirect there?

you can use redirect

string url = string.format("/orchardlocal/food/foodpodavailability" +                             "/steponeofbooking/{1}/{0}", chosendate, foodpodid)  return redirect(url); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -