Home Can I append data from controller to url and still render same page?
Reply: 0

Can I append data from controller to url and still render same page?

user1363 Published in July 16, 2018, 8:34 pm

I have a simple MVC application that presents an IQ test to the person.

I have a controller call TestMyIQController and on this controller I have three action methods and corresponding to three views.

1) Index.cshtml

2) Questions.cshtml

3) Score.cshtml

On the first page localhost:12345/TestMyIQ/Index of the application I ask the user to input their First and Last name and click button Next to go to second page.

On the second page of the application localhost:12345/TestMyIQ/Questions I present a few multiple choice questions and I have the user select True/False for each question. Once the user complete all the question she can click button Submit to see her IQ score.

On the final score page localhost:12345/TestMyIQ/Score I show the score via a ViewBag object.

However, I want to know how to modified the final page url so that I can append the First Name of the user? For example if the person name is John Doe then I want my final score url will be like this localhost:12345/TestMyIQ/Score?firstname=John.

Note it is not necessary to append the First Name to all other url...because I only want it on the final score page.

Please help me. Thanks

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.320786 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO