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 1: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 OriginalGriff 277
1 Maciej Los 220
2 DamithSL 190
3 Raul Iloc 185
4 Richard MacCutchan 175
0 OriginalGriff 5,130
1 DamithSL 4,197
2 Maciej Los 3,670
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,821


Advertise | Privacy | Mobile
Web01 | 2.8.141216.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