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 7195597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:36:34+00:00 2026-05-28T20:36:34+00:00

I am sending parameters to the GET ActionResult like this: public ActionResult MyFormLetter(string studentName,

  • 0

I am sending parameters to the GET ActionResult like this:

public ActionResult MyFormLetter(string studentName, string teacherName, string courseName, string appointmentDate)
{    
    // Do stuff here;
}

After clicking on a form button that calls the POST ActionResult, those values are out of scope. Ho can I retain the values in the GET ActionResult to reuse in the Post ActionResult?

Thanks for any help!

  • 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-05-28T20:36:36+00:00Added an answer on May 28, 2026 at 8:36 pm

    You should be using a ViewModel for this, as well as a strongly-typed View. Something like this would work:

    public class StudentInformation
    {
        public string StudentName { get; set; }
        public string TeacherName { get; set; }
        public string CourseName { get; set; }
        public string AppointmentDate { get; set; }
    }
    

    Your Action methods would look like this:

    public ActionResult MyFormLetter()
    {
        return View();
    }
    
    [HttpPost]
    public ActionResult MyFormLetter(StudentInformation studentInformation)
    {
        // do what you like with the data passed through submitting the form
    
        // you will have access to the form data like this:
        //     to get student's name: studentInformation.StudentName
        //     to get teacher's name: studentInformation.TeacherName
        //     to get course's name: studentInformation.CourseName
        //     to get appointment date string: studentInformation.AppointmentDate
    }
    

    And a little View code:

    @model StudentInformation
    
    
    @using(Html.BeginForm())
    {
        @Html.TextBoxFor(m => m.StudentName)
        @Html.TextBoxFor(m => m.TeacherName)
        @Html.TextBoxFor(m => m.CourseName)
        @Html.TextBoxFor(m => m.AppointmentDate)
    
        <input type="submit" value="Submit Form" />
    }
    

    When you reach the Action method from the POST of the submit, you will then have access to all of that data that was input into your form view.

    Disclaimer: The View code just shows the necessary elements to show how data is saved in the model for Model Binding.

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

Sidebar

Related Questions

I get parameters from client with java servlet. This is my post: For sending
I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It
I am sending a GET request to a site and would like to know
I'm sending some parameters from a form in this way: myparam[0] : 'myValue1' myparam[1]
I am very new to python and having to get into this stuff for
Sending Parameters to the Function called by a thread in C#, this is my
I've got this menu hook below by which I'm sending two parameters to the
From my JSP, I am sending a GET request with a parameter called jobDetails
In my previous question I had a problem with sending parameters over the command
Im sending (with ASIFormDataRequest) a POST request, with 4 parameters. The server launches a

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.