I am displaying a value on my MVC view using a query string. For example ..
in my view I have:
<h3>Selected Game <%=Request["GameId"]%> </h3>
This displays the gameid selected by user on the view (via a query string)
Now I want to be able to use this value displayed on the view and run a query in the controller/service layer code. How can I pass this value to the controller.
You can access the Request the same way from the controller.
I would caution you, however, about trusting values you get from the request. This is where hackers like to strike, by entering their own values, which may not even be numbers.
Validate all data you get from the client, including querystring parameters.