Click here to Skip to main content
15,899,313 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Login page when edit clicked in Gridview Pin
demouser74324-Oct-09 1:35
demouser74324-Oct-09 1:35 
GeneralRe: Login page when edit clicked in Gridview Pin
nagendrathecoder24-Oct-09 1:40
nagendrathecoder24-Oct-09 1:40 
GeneralRe: Login page when edit clicked in Gridview Pin
demouser74324-Oct-09 2:14
demouser74324-Oct-09 2:14 
GeneralRe: Login page when edit clicked in Gridview Pin
nagendrathecoder24-Oct-09 2:33
nagendrathecoder24-Oct-09 2:33 
GeneralRe: Login page when edit clicked in Gridview Pin
sashidhar24-Oct-09 2:41
sashidhar24-Oct-09 2:41 
GeneralRe: Login page when edit clicked in Gridview Pin
sashidhar24-Oct-09 1:59
sashidhar24-Oct-09 1:59 
AnswerRe: Login page when edit clicked in Gridview Pin
demouser74324-Oct-09 4:14
demouser74324-Oct-09 4:14 
GeneralRe: Login page when edit clicked in Gridview Pin
demouser74325-Oct-09 19:17
demouser74325-Oct-09 19:17 
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["Loginerrors"] = 0;
}
}

private bool validate(String Uname, String Pwd)
{
bool val = false;
SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["sqlcon"].ToString());
string qry = "Select Uname, Pwd FROM login";
SqlCommand cmd = new SqlCommand(qry, con);
SqlDataReader dr;
con.Open();
dr = cmd.ExecuteReader();
while (dr.Read())
{
if ((Uname == dr["Uname"].ToString()) & (Pwd == dr["Pwd"].ToString()))
{
val = true;
}
dr.Close();
return val;
}
return val;
}

protected void Login1_Authenticate(object sender, EventArgs e)
{
if (validate(Login1.UserName,Login1.Password))
{
Login1.Visible = false;
Label1.Text = "Success";
}
else
{
Label1.Text = "Failed";
}
}
}


Is this code efficient for login
Questioncheck box in datagrid Pin
suzzain23-Oct-09 20:36
suzzain23-Oct-09 20:36 
AnswerRe: check box in datagrid Pin
Christian Graus23-Oct-09 22:33
protectorChristian Graus23-Oct-09 22:33 
Questionscript menu login [modified] Pin
KhandelwalA23-Oct-09 20:31
KhandelwalA23-Oct-09 20:31 
AnswerRe: script menu login Pin
sashidhar23-Oct-09 20:48
sashidhar23-Oct-09 20:48 
GeneralRe: script menu login Pin
KhandelwalA23-Oct-09 20:52
KhandelwalA23-Oct-09 20:52 
GeneralRe: script menu login Pin
sashidhar23-Oct-09 21:06
sashidhar23-Oct-09 21:06 
AnswerRe: script menu login Pin
Christian Graus23-Oct-09 22:32
protectorChristian Graus23-Oct-09 22:32 
Questionnot getting .value property of any asp.net textbox in java script Pin
bhavnvyas23-Oct-09 20:19
bhavnvyas23-Oct-09 20:19 
AnswerRe: not getting .value property of any asp.net textbox in java script Pin
Christian Graus23-Oct-09 22:36
protectorChristian Graus23-Oct-09 22:36 
GeneralRe: not getting .value property of any asp.net textbox in java script Pin
bhavnvyas23-Oct-09 23:25
bhavnvyas23-Oct-09 23:25 
Questionhow to hide the query string in url Pin
sarang_k23-Oct-09 19:54
sarang_k23-Oct-09 19:54 
AnswerRe: how to hide the query string in url Pin
Christian Graus23-Oct-09 19:54
protectorChristian Graus23-Oct-09 19:54 
GeneralRe: how to hide the query string in url Pin
sarang_k23-Oct-09 19:56
sarang_k23-Oct-09 19:56 
GeneralRe: how to hide the query string in url Pin
Christian Graus23-Oct-09 20:02
protectorChristian Graus23-Oct-09 20:02 
AnswerRe: how to hide the query string in url Pin
Rob Branaghan25-Oct-09 0:04
Rob Branaghan25-Oct-09 0:04 
AnswerRe: how to hide the query string in url Pin
dtmore5-Apr-10 21:33
dtmore5-Apr-10 21:33 
QuestionHow can I use GridView1_rowUpdating event in c# Pin
nilesh.saraf23-Oct-09 18:19
nilesh.saraf23-Oct-09 18:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.