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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:05:16+00:00 2026-05-26T04:05:16+00:00

REVISED BUT SAME ISSUE: I am building a site with MVC 3 and have

  • 0

REVISED BUT SAME ISSUE:

I am building a site with MVC 3 and have run into a big road block. On the profile page, users will have the ability to create a new listing offered by their center. I have created this using a partial view for the “_CenterProfile” portion of the page which works perfectly. I’ve implemented the Create Listing as the main focus of the page and model which also works perfectly. I would like to use Ajax to create the database entries as well as populate or update the Listings shown on the Profile page. This is where the problem comes in.

When I click the submit button, rather than updating the targeted element, the page flips to a non existent “CreateListing” page ../Exchange/CreateListing. I’m going crazy trying to get this to function and no matter what I try it does the same thing. The Listing is populated to the database and the page changes from /Exchange/Profile to /Exchange/CreateListing.

I’m sure someone out there can help me, I’m on a deadline and getting past this headache will save me big time.

“Profile” View:

      @model Exchange.Models.CreateListingModel

@{
    ViewBag.Title = "Profile";
}

<h2>Profile</h2>

@Html.Action("_CenterProfile")

<br />
@using (Ajax.BeginForm("CreateListing", "Exchange", new AjaxOptions
{
    HttpMethod = "Get",
    UpdateTargetId = "centerListings",
    InsertionMode = InsertionMode.Replace
}))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>CreateListingModel</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.productName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.productName)
            @Html.ValidationMessageFor(model => model.productName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.forSale)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.forSale)
            @Html.ValidationMessageFor(model => model.forSale)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.forTrade)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.forTrade)
            @Html.ValidationMessageFor(model => model.forTrade)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.price)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.price)
            @Html.ValidationMessageFor(model => model.price)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.unit)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.unit)
            @Html.ValidationMessageFor(model => model.unit)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.catagoryID)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.catagoryID)
            @Html.ValidationMessageFor(model => model.catagoryID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.description)
            @Html.ValidationMessageFor(model => model.description)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.imageURL)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.imageURL)
            @Html.ValidationMessageFor(model => model.imageURL)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.activeListing)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.activeListing)
            @Html.ValidationMessageFor(model => model.activeListing)
        </div>
    </fieldset>

    <p>
        <input type="submit" value="CreateListing" />
    </p>
}

    <table id="centerListings">

    </table>


<p>
    @Html.ActionLink("Edit", "Edit", new { /* id=Model.PrimaryKey */ }) |
    @Html.ActionLink("Back to List", "Index")
</p>

CreateListing Controller:

public PartialViewResult CreateListing(CreateListingModel model)
{
    mmjc.CreateListing(model.catagoryID, model.productName, model.forSale, model.forTrade, model.price, model.unit, model.description, model.imageURL, model.activeListing);
    var listings = mmjc.GetCenterListings();
    return PartialView("_CenterListings", listings);
}

_CenterListings PartialView:

@model IEnumerable<Exchange.Models.Listing>

<table id="centerListings">
    <tr>
        <th>
            CatagoryID
        </th>
        <th>
            ProductName
        </th>
        <th>
            ToSell
        </th>
        <th>
            ToTrade
        </th>
        <th>
            PricePerUnit
        </th>
        <th>
            Unit
        </th>
        <th>
            Description
        </th>
        <th>
            ImgPath
        </th>
        <th>
            ProfileID
        </th>
        <th>
            ActiveListing
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.CatagoryID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ProductName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ToSell)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ToTrade)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.PricePerUnit)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Unit)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ImgPath)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ProfileID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ActiveListing)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ListingsID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ListingsID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ListingsID })
        </td>
    </tr>
}

</table>
  • 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-26T04:05:17+00:00Added an answer on May 26, 2026 at 4:05 am

    Ok everyone. So I fixed my own problem here. It seems many people are having this same issue. The fix is so easy it made me feel very silly.

    All you have to do is include

    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>
    

    In your _Layout or Main View. Without it the Ajax.BeginForm is useless and will continue to redirect to the PartialViewResult.

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

Sidebar

Related Questions

I have revised a jquery box : http://designer-depot.com/manset/test.html In <ol></ol> everything work perfect. But
Revised: I have a list items on the page that I'm creating from database
I'm refactoring, and have run into a roadblock. Background: I have a base class
REVISED QUESTION : We have tracked this down to a custom add to cart
* revised, but still not solved...* I want to combine data from two files
NOTE: I completely revised the question and turned it into an example project specifically
Basic question, but I can't figure it out...I have a label with an accelerator
(Didn't mean to create a new question, but revised the old one enough that
So I know STI is the most reviled thing ever but I have an
I've had this problem a few times and solved it the same way. But

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.