Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8417321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:00:32+00:00 2026-06-10T02:00:32+00:00

I am displaying a value on my MVC view using a query string. For

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:00:34+00:00Added an answer on June 10, 2026 at 2:00 am

    You can access the Request the same way from the controller.

    string gameid = Request["GameId"];
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string in a ASP.NET MVC details page with the value of
I have problem with displaying error message in spring Application.i am using Spring MVC
I'm trying to find a way of displaying the text of the selected/initial value
I have a user control that i am using inside a DataTemplate , this
i am using mvc struts framework in my web application. i am displaying dynamic
I have a problem with slash in javaScript n Ajax I am displaying value
I have a model but one of its property is not displaying its value.
I am using MVC 3 with ASP.NET. I have a dropdown box and getting
I am using Spring MVC with annotation configuration. I have a controller class for
I am using Entity Framework code first and ASP.NET MVC 3. I have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.