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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:15:59+00:00 2026-05-18T12:15:59+00:00

Controller: public ActionResult Index() { // not using the interface right now DealsRepository _repo

  • 0

Controller:

public ActionResult Index()
        {

            // not using the interface right now
            DealsRepository _repo = new DealsRepository();
            var deals = _repo.GetDeals("<Request><ZipCode>92618</ZipCode></Request>");

            return View(deals);
        }

        [HttpPost]
        public ActionResult Index(string data)
        {

            // not using the interface right now
            DealsRepository _repo = new DealsRepository();
            var deals = _repo.GetDeals(data);

            return View(deals);
        }

jQuery:

var url = '<%: Url.Action("Index", "Deal") %>';
var data = '<Request><ZipCode>92618</ZipCode></Request>';

$.post(url, data, function (result) {
    alert(result);
});

What I’m trying to do is refresh (reload) the View with the updated Model… I don’t want to use jQuery to update the content. Relaod the View with the updated Model.

In other words, once a user enters some refinements in their search or selects a filter, I need to make the call, and reload the page with the latest Model search results.

  • 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-18T12:16:00+00:00Added an answer on May 18, 2026 at 12:16 pm

    You don’t need javascript at all to post a form, which is what it seems you are trying to do.

    Just add a submit button to your html form. When the submit button is clicked the form will be posted to the controller and action associated with the html form. That controller and action will return an ActionResult which will be your refreshed view if you so choose…

    In your view you can do something like this:

    <%Html.BeginForm("ActionName", "ControllerName", FormMethod.Post); %>
    <!-- more form fields here -->
    <input type="submit" value="Go"/>
    <%Html.EndForm(); %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in my controller: public ActionResult Details(int id) { var
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have an action like this: public class News : System.Web.Mvc.Controller { public ActionResult
I have multiple controller actions that takes an id public ActionResult Get(int? id) {
I have a controller in C# using the ASP.Net MVC framework public class HomeController:Controller{
Given the following classes and controller action method: public School { public Int32 ID
I have a controller with an action method as follows: public class InventoryController :
I want my controller to return the right HTTP response code when the user
I want to use MEF with asp.net mvc. I wrote following controller factory: public
Repository namespace MvcApplication1.Models { public class GroupRepository { EgovtDataContext db = new EgovtDataContext(); public

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.