Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Ajax jQuery MVC3
Hi all,
 

I am doing mvc3 razor application for this i want to display popup for signin page but i am getting errors ml controller is:
       [HttpGet]
       public ActionResult SigningIn()
       {
           if (Request.IsAjaxRequest())
           {
               return PartialView("_PartialSigningIn");
           }
           return View();
       }
       [HttpPost]
       public ActionResult SigningIn(Account account3)
       {
           if (!ModelState.IsValid)
           {
               if (Request.IsAjaxRequest())
                   return PartialView("_PartialSigningIn",account3);
           }
           return View(account3);
       }
 

 
and my view Is:
@model GoGrain.Models.Account
 
<h2>SigningIn</h2>
@Html.Partial("_PartialSigningIn")
 

 
and partialview is:
 
<pre lang="sql">@model GoGrain.Models.Account
 
@using (Ajax.BeginForm(new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "signinginDialog" }))
{
    @Html.ValidationSummary(true)
    @Html.EditorForModel()
}
 

and jquery is:
 
<script type="text/javascript">
 
    $.ajaxSetup({ cache: false });
 
    $(document).ready(function () {
        $(".openDialog").live("click", function (e) {
            e.preventDefault();
 
            $("<div></div>")
                .addClass("dialog")
                .attr("id", $(this)
                .attr("data-dialog-id"))
                .appendTo("body")
                .dialog({
                    title: $(this).attr("data-dialog-title"),
                    close: function () { $(this).remove() },
                    modal: true
                })
                .load(this.href);
        });
 
        $(".close").live("click", function (e) {
            e.preventDefault();
            $(this).closest(".dialog").dialog("close");
        });
    });
</script>
Posted 8-Jan-13 0:53am
Comments
Sandeep Mewara at 8-Jan-13 8:50am
   
What error?

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 265
1 _Amy 235
2 Peter Leow 205
3 Andreas Gieriet 180
4 Shmuel Zang 120
0 OriginalGriff 7,540
1 Sergey Alexandrovich Kryukov 6,412
2 Maciej Los 3,849
3 Peter Leow 3,653
4 CHill60 2,712


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 9 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100