Hi,
New to MVC here, I would like to have the login box working in a jquery dialog across the site by placing it on the master page.
I have wrapped the logOn.aspx form with a dialog div and added a button to open the dialog and some jq
<button id="show-sign-in">Sign In</button>
<script type="text/javascript">
$(function () {
$("#dialog").dialog({
bgiframe: true,
autoOpen: false,
modal: true
});
$('#show-sign-in').click(function () {
$('#dialog').dialog('open');
});
</script>
<div id="dialog" title="User Login">...</div>
Problems:
if I include the page in the master with RenderPartial, the controller's ActionResult won't catch the submit, unless the url has /Account in it.
Html.RenderPartial("~/Views/Account/LogOn.aspx");
if I include it using with Ajax request (below) the submit goes through fine, however if the login attempt is invalid the page redirects to the actual LogOn page (I'd like to return them to the dialog).
<script type="text/javascript"> $(document).ready(function () { $.ajax({ url: "/Account/LogOn", cache: false, success: function (html) { $("#logindisplay").append(html); } }); });</script>
Bottom line, this is something I did a lot with ascx in web forms and I find it annoying to go through ajax gets and lots of js to do the same thing, am i approaching this completely wrong? any ideas?