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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:33:44+00:00 2026-06-19T03:33:44+00:00

I have a problem with Ajax. I want to make multiple forms and replace

  • 0

I have a problem with Ajax.
I want to make multiple forms and replace div containing one after submiting with some Partial View. It’s working for me when I use only one form. I don’t know what I’m doing wrong here. Maybe it’s becasue of custom editorfor?
Here is my code, plese try to help me, I’ve been trying do this for 2 days.

Index

@model MetriceWeb.Models.TaskInputModel
@{
    ViewBag.Title = "Tasks";
}
<h3>
    Tasks</h3>

@if (Model.Values.Count == 0)
{
   <p>No pendings forms for you at the moment</p>
}
else
{
    @Html.EditorFor(x => x.Values)
}

TaskInputValue (editorfor)

@model MetriceWeb.Models.TaskInputValue
@{string s = "task" + Model.TaskId;}

@using (Ajax.BeginForm("GetFromLibrary", "Metrice", new AjaxOptions
{
HttpMethod = "Get",
UpdateTargetId = s,
InsertionMode = InsertionMode.Replace
}))
{
<div class="editor-field" id="@s">
@Html.HiddenFor(x => x.TaskId, new { @class = "TaskId" , id = "TaskId" })
@Html.HiddenFor(x => x.InputId, new { @class = "InputId" })
<h2>
@Html.DisplayFor(x => x.Task)
</h2>
<span>Created: </span>
@Html.DisplayFor(x => x.Date)

<div>
Input Value

    @Html.EditorFor(x => x.DateValue)
    @Html.ValidationMessageFor(x => x.DateValue)
</div>
<input type="submit" value="Submit" />
</div>
<br />
}

It’s entering method in my controller where I’m returning partial view. After submitting my div isn’t replacing, the whole new site is loaded. What is wrong here? Please help me, I am in big need.

  • 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-19T03:33:46+00:00Added an answer on June 19, 2026 at 3:33 am

    In order to the Ajax helpers like Ajax.BeginForm work correctly (e.g sending an AJAX request) you need reference in your view the following JavaScript file

    jquery.unobtrusive-ajax.js
    

    (and of course before that jquery)

    From the Unobtrusive Ajax in ASP.NET MVC 3

    An interesting note: since there is no actual JavaScript being emitted
    when you use unobtrusive Ajax, if you forget to include one or the
    other script, you won’t see any errors when attempting to submit the
    Ajax request; it will simply behave like a non-Ajax request.

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

Sidebar

Related Questions

i want to use the paging toolbar but have one problem. I don't make
i have problem.. for(a=1;a<10;a++){ $(.div).append(<div id=+a+></div>) $.ajax({ url: file.php, data: a=+a, type: POST, async:
I have some sort of a design problem with my Django AJAX application. I
I have a puzzling problem with trying to make an ajax/static state program. What
So, I have a jQuery ajax call, and I want to make sure that
I have a website say xyz.com. i want to make an ajax call from
i have a little problem with my Ajax calls. Maybe i do not have
I have this problem that my sites uses alot of ajax and when a
I have a problem with an animation in jQuery using ajax. On the click
I have a problem consistently displaying Facebook Comments on my AJAX driven website. Each

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.