I have been stuck with this issue for sometime now. Can someone help me solve this bug.
Before I submit the form the following UI gets displayed. However, Upon clicking on the Register button, I am supposed to be redirected to another page. But, the VIew I get is an overlapped version of the previous view (Look screen shot below)
After submitting the registration view the page gets displayed as follows: (You'll be able to see part of the previous screen also embedded to this view which is not the expected result)v- Expected result will be to display ProfileOption
and the Copyright mark
on the page.
Code:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Register(RegisterViewModel acount)
{
return RedirectToAction("ProfileOption", "Acc");
}
[HttpGet]
public ActionResult ProfileOption()
{
return View("ProfileOption");
}
AJAX USED IN THE FRONT END
function submitdata() {
$('form').click(function() {
if (!$(this).valid()) {
return;
}
var token = $('[name=__RequestVerificationToken]').val();
$.ajax({
url: '@Url.Action("Register", "Acc")',
type: 'POST',
data: {
EMAIL: 'email@ss.ss',
PASSWORD: $('#pword').val(),
ConfirmPassword: $('#cpwd').val(),
__RequestVerificationToken: token
},
success: function (result) {
}
});
return false;
});
}