Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Ajax need code for login in asp.net with c#
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


minu susan
need code for login in asp.net with c#
1 Answer(s)      2 years and 4 months ago
Posted in : Ajax


hai iam trying to develop a project in asp.net with c#,so i need a code for login page using which admin and other users can log in.plz help me, thanks in advance.


Advertisement
View Answers

April 1, 2013 at 11:48 AM


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Web.Configuration;
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
string username = Login1.UserName;
string pwd = Login1.Password;
string s;
s = WebConfigurationManager.ConnectionStrings["ChartDatabaseConnectionString"].ConnectionString;
SqlConnection con = new SqlConnection(s);
con.Open();
string sqlUserName;
sqlUserName = "SELECT user_name,password FROM Login WHERE user_name ='" + username + "' AND password ='" + pwd + "'";
SqlCommand cmd = new SqlCommand(sqlUserName, con);
string CurrentName;
CurrentName = (string)cmd.ExecuteScalar();
if (CurrentName != null)
{
Session["UserAuthentication"] = username;
Session.Timeout = 1;
Response.Redirect("start.aspx");
}
else
{
Session["UserAuthentication"] = "";
}
}
}


Related Tutorials/Questions & Answers:
need code for login in asp.net with c#
need code for login in asp.net with c#  hai iam trying to develop a project in asp.net with c#,so i need a code for login page using which admin and other users can log in.plz help me, thanks in advance
login page code in asp.net
login page code in asp.net  i need front end and backend code for login page in vb asp.net using sql server....having code for submit button
Advertisements
Asp.net with C#
Asp.net with C#  Autopopulate values into textbox from database on pressing tab
asp.net
file......is it any solution of this problem. the code language is asp.net & c...asp.net  My project requrement is when somebuddy fill a web form
ASP.NET
ASP.NET  How to get multiple values of single textbox separated by commas using C
asp.net
asp.net  i am generating excel file through data base, in excel cell text are displaying with green triangle on the corner, how to convert text to number through c sharp coding
asp.net
asp.net  which place can use the WCF in most of the ASP.net projects
Asp.net
Asp.net  how to show an output of an Asp.net project work on a mobile phone
asp.net
asp.net  how to make online library management system using asp.net
ASP.NET
ASP.NET  How to autogenerate id in Letters with numbers
need a login applet in java
need a login applet in java  i'm java beginner. Can some java master teach me how to write a login applet? combine with my coding import javax.swing.*; import java.applet.*; import java.awt.*; import java.util.*; import
need a login applet in java
need a login applet in java  i'm java beginner. Can some java master teach me how to write a login applet? combine with my coding import javax.swing.*; import java.applet.*; import java.awt.*; import java.util.*; import
ASP.NET
ASP.NET  How to get the value of dynamically added rows in a table using html
ASP.NET
ASP.NET  what is the use of web.config file in ASP.NET programing... application. An Asp.net application has one web.config file which keeps the configurations... States, Error Handling, Security configurations in ASP.NET web.Config file
asp.net
asp.net  Create a web page that has the restaurant fields like Name, Address, City, State, Phone, Website, EMail on it. Also, add a Submit button... in asp.net
swing login code
swing login code  code for the login form
c code
c code  c code for this formula x=(y-0.22z-072)4; where y=7.32 x=3.1 then ans x=23.9 end code
c code
c code  c code for this formula x=(y-0.22z-072)4; where y=7.32 x=3.1 then ans x=23.9 end code for this   c code for this formula x=(y-0.22z-072)4; where y=7.32 x=3.1 then ans x=23.9 can any one end code
C# code
C# code  hi pls clear my doubts this is my code but out is not well through this code i need display a particular row to a particular columns pls... bbbb 301 55 Pass bbbb 302 22 Fail bbbb i need result like
need of code
need of code  howto convert greyscale image to binary image in java
need code
need code  Create Vehicle having following attributes: Vehicle No., Model, Manufacturer and Color. Create truck which has the following additional... is the required code: import java.util.*; class Vehicle { int
need code
need code  Create Vehicle having following attributes: Vehicle No., Model, Manufacturer and Color. Create truck which has the following additional... is the required code: import java.util.*; class Vehicle { int
need code
need code  Create Vehicle having following attributes: Vehicle No., Model, Manufacturer and Color. Create truck which has the following additional... is the required code: import java.util.*; class Vehicle { int
php login and logout code
php login and logout code  Hi, Can anyone share there code for creating a user login and logout page in PHP?or any useful tutorial that can help to create a login and logout application in PHP.. Thanks in Advance
Need urgent help with C++ errors!
Need urgent help with C++ errors!  hi, i'm new to C++ programming. this is my code... i'm using Turbo C++. It's showing so many errors!.. I...' Fatal XYZ.CPP 2: Unable to create output file 'C:\XYZ.obj' somebody please
code for login fom - Struts
code for login fom  we have a login form with fields USERNAME: PASSWORD: In this admin can login and also narmal uses can log
Role based login ..Need the concepts.. - JavaMail
Role based login ..Need the concepts..  Role based login how can i do...   Hi friend, This code help to solve your problem : Some points remember "login.jsp" 1)Code have two file "login.jsp" and "welcome.jsp
how to write a code for oracle database connection in asp.net for validation.
how to write a code for oracle database connection in asp.net for validation...;/script>   Create a new project in Visual Studio using eight C# Add reference to Oracle.DataAccess.dll file. Typically this file can be found in C
EasyEclipse for C and C++
EasyEclipse for C and C++       EasyEclipse for C and C++ is all you need to start developing C and C++ code with Eclipse. There are currently 28 comments
hi need help with C++ programming!
hi need help with C++ programming!  how do i : b. Store numbers / characters into the file (output) c. Retrieve numbers / characters from the file...; "Unable to open file"; return 0; } c) #include <iostream> #include <
HTML login page code
the complete HTML JavaScript code for User Login Page. Thanks in Advance!   ...HTML login page code  Hi all, I am writing my first HTML JavaScrip...: " + form.pwd1.value); return true; }   html registration form code
 

 

 

DMCA.com