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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:24:46+00:00 2026-05-28T13:24:46+00:00

i have a jquery Dialog in a partial view: @model JQueryDialogPoc.Models.FeedBack @using (Ajax.BeginForm(GiveFeedback, Home,

  • 0

i have a jquery Dialog in a partial view:

@model JQueryDialogPoc.Models.FeedBack
@using (Ajax.BeginForm("GiveFeedback", "Home", null, new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "emailDialog" }, new { id = "popForm" }))
{
    <div class="popUp">
        <div>
            <ul>
                <li>
                    @Html.EditorFor(x => x.Feedback)
                    @Html.ValidationMessageFor(x => x.Feedback) </li>
            </ul>
        </div>
        <input type="submit" />
    </div>
}

model is:

public class FeedBack
{
    [Required]
    [Display(Name = "Feedback")]
    public string Feedback { get; set; }
}

i Render the partial view like this :

   @Html.Partial("MyFeedbackPartialView");

i have this js file which i use to open the dialog:

$("div.popUp").dialog({
title: "",
close: function () {
},
modal: true,
show: "fade",
hide: "fade",
open: function (event, ui) {
    $(this).parent().appendTo($('#popForm'));
    $(this).load(options.url, function() {
        var $jQval = $.validator;
        $jQval.unobtrusive.parse($(this));

    });
}

});

the actionMethod is  :

     [HttpPost]
        public ActionResult GiveFeedback(string Feedback)
        {
            return Json(new {result = "Back from Server!"});
        }

now the problem is everytime i click on the submit button it redirect the page and show me this :

{"result":"Back from Server!"}

although it supposed to make ajax request !

any idea why this is happening ?

  • 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-28T13:24:47+00:00Added an answer on May 28, 2026 at 1:24 pm

    You haven’t really shown what scripts have you included in your page, how does the markup of your view looks like, etc… things allowing us to reproduce your problem. Usually what I do with such questions is to try to provide a full example that I think might be close to what you are trying to do.

    Model:

    public class FeedBack
    {
        [Required]
        [Display(Name = "Feedback")]
        public string Feedback { get; set; }
    }
    

    Controller:

    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    
        public ActionResult GiveFeedback()
        {
            return PartialView(new FeedBack());
        }
    
        [HttpPost]
        public ActionResult GiveFeedback(FeedBack model)
        {
            if (!ModelState.IsValid)
            {
                return PartialView(model);
            }
            return Json(new { result = "Thanks for submitting your feedback" });
        }
    }
    

    View (~/Views/Home/Index.cshtml):

    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>
    
    <script type="text/javascript">
        $(function () {
            $('#feedbackLink').click(function () {
                $('#feedback').dialog({
                    modal: true,
                    open: function (event, ui) {
                        $(this).load($(this).data('url'), function () {
                            $.validator.unobtrusive.parse($(this));
                        });
                    }
                });
                return false;
            });
        });
    
        var onSuccess = function (data) {
            if (data.result) {
                alert(data.result);
                $('#feedback').dialog('close');
            } else {
                $.validator.unobtrusive.parse($('#popForm'));
            }
        }
    </script>
    
    @Html.ActionLink("Give feedback", "GiveFeedback", null, new { id = "feedbackLink" })
    <div id="feedback" data-url="@Url.Action("GiveFeedback")"></div>
    

    Remark: obviously the scripts I have shown in this Index view have nothing to do there. They should be moved to the layout and the inline script moved into a separate javascript file and referenced in the layout. I just included them to show what scripts are required for the example to work.

    And finally we have the partial containing the feedback form (~/Views/Home/GiveFeedback.cshtml):

    @model FeedBack
    
    @using (Ajax.BeginForm("GiveFeedback", "Home", null, new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "feedback", OnSuccess = "onSuccess" }, new { id = "popForm" }))
    {
        <ul>
            <li>
                @Html.EditorFor(x => x.Feedback)
                @Html.ValidationMessageFor(x => x.Feedback)
            </li>
        </ul>
        <input type="submit" />
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am have an issue returning a partial view in a jquery dialog. The
I have a partial view which gets rendered within a jQuery UI dialog. Because
I am using Loading a partial view in jquery.dialog as a reference in order
I have a view with a button that opens a jquery dialog via partial
I have a partial view that is rendered inside of a JQuery dialog. I
I am using SimpleModal in jQuery, and I have one confirm dialog. If the
I have a jQuery dialog box that opens and then an AJAX call is
I have the following jQuery script to show a model dialog to enable editing
I have a partial view which is returned via an Ajax call with a
I have a jQuery UI Dialog working great on my ASP.NET page: jQuery(function() {

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.