Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6536761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:31:58+00:00 2026-05-25T10:31:58+00:00

I have been working on ASP.Net MVC3. I created view and controller. Also, I

  • 0

I have been working on ASP.Net MVC3. I created view and controller. Also, I have a model to create account.

Controller:

[HttpPost]
    public ActionResult LogOn(LogOnModel model, string returnUrl)
    {
        if (ModelState.IsValid)
        {
           ----> if (model.UserName == "Guven" && model.Password == "12345")
            {
                FormsAuthentication.SetAuthCookie(model.UserName, false);
                return RedirectToAction("Index", "Home");
            }
            else
            {
                ModelState.AddModelError("", "aaaaaaaaaaaaaaaaaa.");
            }
        }
        return View(model);
    }

I want to make from the database to control that the line marked on the above code.My question is:How can I do that controller?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:31:59+00:00Added an answer on May 25, 2026 at 10:31 am

    If you’re using MembershipProvider it has the ValidateUser Method.

    you’ll need to change your marked line to:

    if (Membership.ValidateUser(model.UserName, model.Password))
    

    If your not using MembershipProvider yet, you’ll might want to implement it.

    There are two primary reasons for creating a custom membership
    provider.

    • You need to store membership information in a data source that is not
      supported by the membership providers included with the .NET
      Framework, such as a FoxPro database, an Oracle database, or other
      data sources.

    • You need to manage membership information using a database schema that
      is different from the database schema used by the providers that ship
      with the .NET Framework. A common example of this would be membership
      data that already exists in a SQL Server database for a company or Web
      site.

    Have a look at: Sample Membership Provider Implementation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For the last 4 years I have been working as an ASP.NET developer in
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I have been working my way through Scott Guthrie's excellent post on ASP.NET MVC
On a recent project I have been working on in C#/ASP.NET I have some
I'm working on a asp.net mvc2 app. I have been using jquery to do
I am working on a web app using C# and asp.net I have been
I am a brand new Java developer (I have been working in asp.net) and
i have been working with devexpress AspxTextbox, in asp.net and c#.net? initially i was
I have been working with ASP.NET for a few years and am now working
I have been working on an ASP.Net web site and have been publishing to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.