2

i have develop a Mvc3 application in that i have integrating Jquerymobile,when try to login the page Both devices are working but after login there is one Button for redirect to another view page.When i click that button in Desktop device is working fine but i mobile device it showing error like "Error in pageloding" Here is my Controle page code

       [AcceptVerbs(HttpVerbs.Post)]
    public ActionResult Login(LogOnModel model, string returnUrl, FormCollection collection)
    {
        var silButton = Request.Params.AllKeys.FirstOrDefault(key => key.StartsWith("Button_"));
        string name = silButton;

        if (silButton == "Button_login")
        {
            try
            {
                string uname = model.UserName;
                string pwd = model.Password;
                bool id = model.RememberMe;
                if (ModelState.IsValid)
                {
                    if (Membership.ValidateUser(model.UserName, model.Password))
                    {
                        FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
                        if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/")
                            && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
                        {
                            return Redirect(returnUrl);
                        }
                        else
                        {
                            return RedirectToAction("Index","DashBoard");
                        }
                    }
                    else
                    {
                        ModelState.AddModelError("", "The user name or password provided is incorrect.");
                    }
                }
            }
            catch
            {
                return RedirectToAction("Login", "Account");
            }

        }
        else
        {
           //Here i want page redirect but it showing error ;
           return RedirectToActionPermanent("FacebookLogin", "IlifelooksShare");
        }
        return View();
    }
1
  • Could you please edit your question and add some of the code you're trying? Commented Aug 17, 2011 at 13:24

1 Answer 1

0

I think its because you dont have forms authentication setup properly in your web.config - the desktop lets this continue but on iphone etc it doesnt work - try commenting out the call to validateuser and replace with if(true) and you should see it all work (without obviously validating who the user is!)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.