You must Sign In to post a response.
  • Category: Webservices

    Webp API post method example

    hi,

    I am new to web api services, i need simple post method to check the User name/ password and return user detail record if not found i want to return error msg.

    i am using Asp.net MVC5

    Thanks
  • #769131
    This example code help to set Authorization is the mechanism by which a system determines and Users will be redirected to the account/login route

    if (ModelState.IsValid)
    {
    if (Membership.ValidateUser(model.UserName, model.Password))
    {
    FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
    return RedirectToAction("Index", "Home");
    }
    else
    {
    ModelState.AddModelError("", "The user name or password provided is incorrect.");
    }
    }
    // something failed,
    return View(model);


Sign In to post your comments