tags:

views:

7

answers:

0

hi friends,iam new to asp.net mvc 2.0.I am implementing the user registration using ajax.begin form.my ajax.beginform function is as follows, <%using (Ajax.BeginForm("AjaxRegister", new { @action = "AjaxRegister", @controller = "../Account" }, new AjaxOptions { OnSuccess = "handleRegisteration", OnFailure = "handleRegisteration", OnBegin = "AjaxValidate" }, new { @id = "registerForm", @name = "registerForm" })) { %> <%= Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")%> <%Html.RenderPartial("Register"); %> <%} %> <%} %> <%else { %> Account Details Customer Name:

       <%=Html.Encode(User.Identity.Name) %>
       </fieldset>
   <%} %>

and my Controller AjaxRegister function is as follows,

[HttpPost] public ActionResult AjaxRegister(RegisterModel model) { if (ModelState.IsValid) { // Attempt to register the user MembershipCreateStatus createStatus = MembershipService.CreateUser(model.UserName, model.Password, model.Email);

            if (createStatus == MembershipCreateStatus.Success)
            {
                FormsService.SignIn(model.UserName, false /* createPersistentCookie */);
                return Json(new {id=true }, JsonRequestBehavior.AllowGet);
            }
            else
            {
                ModelState.AddModelError("",          AccountValidation.ErrorCodeToString(createStatus));
                return Json(new {status=false }, JsonRequestBehavior.AllowGet);
            }
        }

        // If we got this far, something failed, redisplay form
        ViewData["PasswordLength"] = MembershipService.MinPasswordLength;
        return View(model);
    }

my scenario is if i enter the registration details and click submit button it will register the user and move to the next page.But this works fine in Firefox but in Google chrome if click Submit button it will display one blnk page and display Status:False . Please give me the solution for both google chrome and firefox browser.