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

  • Home
  • SEARCH
  • 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 6593867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:44:15+00:00 2026-05-25T17:44:15+00:00

I have two text inputs, content of which needs to be passed to a

  • 0

I have two text inputs, content of which needs to be passed to a certain action as parameters when a button is clicked. I’m using MVC3
View:

<input name="input2" type="text"  class="inputfield" id="datepicker_1" /></td>
<input name="input2" type="text"  class="inputfield" id="datepicker_2" /></td>

@Html.Action("Search", ...)

Controller:
public ActionResult Search(…)
I suppose the object routeValues or RouteValueDictionary should be used in the @Html.Action for this. These object are confusing for me a bit. Could anyone clarify this for me please. Thank you!

  • 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-25T17:44:16+00:00Added an answer on May 25, 2026 at 5:44 pm

    The Html.Action will probably generate the link html before you provide the inputs. You need to either place your inputs inside a form to be submited to your action, or use ajax, with jquery perhaps, to call the action, like so:

    @using (Html.BeginForm("Search", "Controller", FormMethod.Post, new { id = "frmAction" }))
    {
        <input name="datepicker_1" type="text"  class="inputfield" id="datepicker_1" /></td>
        <input name="datepicker_2" type="text"  class="inputfield" id="datepicker_2" /></td>
    }
    
    
    [HttpPost]
    public ActionResult Search(Datetime datepicker_1, Datetime datepicker_2) {...}
    

    For an Ajax example, check this question:

    jquery ajax forms for ASP.NET MVC 3

    Hope this helps…

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

Sidebar

Related Questions

i have two text inputs like the following, i don't want to use <form>
I have two input text boxes which are decimal. The sum of the two
I have two text fields in my view. I did it using IB. My
I currently have two text boxes which accept any number. I have a text
I'm using NHibernate 2.1.2 and Spring 1.3 I have two Text columns (blobs) in
I have a text box and a button, which is described with the HTML/CSS
I have two forms, latitude and longitude, i.e.: <form action=> Latitude <input type=text name=latitude
I have a form with two text_fields: <input type=text id=post_name name=post[name] /> <input type=text
I have two text boxes t1 and t2 in an html page. I'd like
I have two text files that contain columnar data of the variety position -

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.