Im developing a website for a company and it is my first time to use ASP.net in c# language. I am expert in graphic designs but slow on programming. please help me how to create a login page using in ASP.NET using c#. :)
thanks
Im developing a website for a company and it is my first time to use ASP.net in c# language. I am expert in graphic designs but slow on programming. please help me how to create a login page using in ASP.NET using c#. :)
thanks
For a quick, reliable login on ASP.NET 2.0 (exactly the situation described), the simplest path is to use the built‑in Login UI plus the Membership API and Forms authentication. That avoids most manual plumbing: the Login control gives a ready form, the Membership provider handles hashing/reset, and Forms authentication handles cookies/redirects. was right that a short tutorial helps; also flagged the main choice: use Windows auth only for intranets/AD scenarios, otherwise use Forms for public sites.
A minimal workflow:
Login control (or use custom fields). web.config for authentication and membership and add a connection string. Membership.ValidateUser(...) + FormsAuthentication on success, or let the Login control wire it automatically.Example snippets (ASP.NET 2.0):
<!-- web.config (trimmed) -->
<system.web>
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" timeout="30" />
</authentication>
<membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="ApplicationServices"
passwordFormat="Hashed" />
</providers>
</membership>
</system.web> /* Login button handler (code-behind) */
if (Membership.ValidateUser(Login.UserName, Login.Password))
{
FormsAuthentication.RedirectFromLoginPage(Login.UserName, Login.RememberMeSet);
}
else
{
FailureText.Text = "Invalid username or password.";
} Practical cautions: always serve the login page over HTTPS, never store plaintext passwords (use the Membership provider or hashed+salted storage), and prefer parameterized queries for custom auth. For new projects, consider moving to modern tooling (ASP.NET Core) when feasible. This thread drifted (see ) and was closed by , but the above gives a concise, applied path for getting a secure ASP.NET 2.0 login working.
Jump to Post— omar isaid 0you can search on Windows authentication and forms authentication , the authentication and authorization can be achieved in pure way in pro-grammatically way or you can use your programming skills associated withe the helpful tags at the Web.config
Jump to Post— Ezzaral 2,714This thread was happily sleeping in 2007 before Niluk decided to hijack and resurrect it for a completely unrelated question.
I'm going to close it here since I imagine the OP has solved his question.
Its easy really.
Follow this link, it has a video tutorial. You can even download the code.
http://www.asp.net/learn/videos/view.aspx?tabid=63&id=47
Good Luck!
Great! thank you very much tycoon!
you can search on Windows authentication and forms authentication , the authentication and authorization can be achieved in pure way in pro-grammatically way or you can use your programming skills associated withe the helpful tags at the Web.config
This thread was happily sleeping in 2007 before Niluk decided to hijack and resurrect it for a completely unrelated question.
I'm going to close it here since I imagine the OP has solved his question.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.