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

public class HomeController : Controller { public ActionResult Index() { Task<string> t = DownloadStringTaskAsync(new
I have following code in controller: public ActionResult Index(string date) { var topsong =
Controller: public class HomeController : Controller { Models.MakaleSitesiDBEntities entity = new Models.MakaleSitesiDBEntities(); public ActionResult
I have a controller like this: public FooController : Controller { public ActionResult Index()
I have 2 Actions in my controller: // GET: /Directory/ public ActionResult Index() {
Have Controller: public class MyController : Controller { [HttpGet] public ActionResult MyAction(int iMode, string
Controller to get an image: public class PicturesSmallController : Controller { public ActionResult Details(int
I have the following controller: public ActionResult Search(string Name, int? Friend, int? Page) It
I write a controller like below: public class AccountController : Controller { public ActionResult
I have an overloaded action in my Controller: public ActionResult AssignList(int id) { ...

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.