Change following codes
$J(function () {
$J('#demo').dialog({
autoOpen: false,
width: 400,
title: "Login",
resizable:false,
buttons: {
"Login": function() {
$("#formID").submit();
}
});
$J('#pop').click(function () {
$J('#demo').dialog('open');
});
});
then change Html.BeginForm() as below
Html.BeginForm("ActionName","Controller")
where action name -you HttpPost fucntion.
When you click the "login" button that appears on the dialog box, it will call the function you have specified.