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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:53:50+00:00 2026-06-17T19:53:50+00:00

I have a view and partial View in my MVC 4 Project. I have

  • 0

I have a view and partial View in my MVC 4 Project. I have 3 textbox, one check box and a dropdown in view.I am using ajax.actionlink method, to call my controller, Action and pass the parameters and get the result from the partial view and display them in the div tag of the view page.

Here is my code.

@Html.TextBoxFor(m=>m.searchParameter.cityName)
@Html.TextBoxFor(m=>m.searchParameter.CountryName)
@Html.TextBoxFor(m=>m.searchParameter.StateName)

@Ajax.ActionLink("submit", "DisplaySearchResult", "Home"
      , new { searchParameter =  Model.searchParameter }
     , new AjaxOptions() { HttpMethod = "Post", UpdateTargetId = "Results", InsertionMode = InsertionMode.Replace }, new { id = "DisplaySearchResult" }).

The problem is am not able to pass the parameters to the model. I am new to MVC4. Is there any way to pass the parameters using jquery or javascript?. I don’t want to load the page during my search result.

  • 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-17T19:53:51+00:00Added an answer on June 17, 2026 at 7:53 pm

    As I see, you’re trying to implement a search form. In this case I avoid using a ViewModel and usually do this:

    @Html.TextBox("CityName", string.Empty)
    @Html.TextBox("CountryName", string.Empty)
    @Html.TextBox("StateName", string.Empty)
    

    Then you can use a bit of jQuery to pass the values to your action method:

    $("#submit").click(function() {
    
                var $form = $('form');
    
                $.ajax({
                    type: "GET",
                    cache: false,
                    url: '@Url.Action(ActionName, ControllerName)',
                    data: $form.serialize(),
                    success: loadResult
                });
    
    function loadResult(data)
            {
                $("#container").html(data);
            }
    

    Just make sure your action method has the appropriate parameters CityName, CountryName, StateName so that the values bind correctly.

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

Sidebar

Related Questions

I have an ASP.NET MVC Partial View that contains a Html.TextBox that is configured
I am using MVC C# along with Jquery. I have a partial view in
I have two partial view and I want to call one of them in
I.e I have a partial view in MVC Asp.net project with loads of javascript
Inside of an asp.net mvc partial view, I have an Ajax form that posts
I have a partial view that uses a Telerik MVC Grid, and it has
in a partial view I have the following: <%Html.RenderAction(MVC.User.GetComments(Model.UserGroupName)); %> can I render a
I am playing around with AJAX functionality using ASP.NET MVC. I have created a
I am using T4MVC in our ASP.NET MVC project. I have a statement like
I have taken on an MVC project that has a view that displays several

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.