Click here to Skip to main content
15,917,473 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questiondisplay image in repeater and retrieve its tooltip value Pin
gautamamit88-Dec-09 23:31
gautamamit88-Dec-09 23:31 
AnswerRe: display image in repeater and retrieve its tooltip value Pin
Abhishek Sur9-Dec-09 2:49
professionalAbhishek Sur9-Dec-09 2:49 
Questionhow to pass gridview textbox value to javascript Pin
ravihd8-Dec-09 23:31
ravihd8-Dec-09 23:31 
AnswerRe: how to pass gridview textbox value to javascript Pin
Dinesh Mani8-Dec-09 23:54
Dinesh Mani8-Dec-09 23:54 
GeneralRe: how to pass gridview textbox value to javascript Pin
ravihd9-Dec-09 0:59
ravihd9-Dec-09 0:59 
GeneralRe: how to pass gridview textbox value to javascript Pin
Dinesh Mani9-Dec-09 1:17
Dinesh Mani9-Dec-09 1:17 
Questionerror in showing blogs in the web site Pin
Amit Spadez8-Dec-09 23:29
professionalAmit Spadez8-Dec-09 23:29 
AnswerRe: error in showing blogs in the web site Pin
Dinesh Mani8-Dec-09 23:46
Dinesh Mani8-Dec-09 23:46 
GeneralRe: error in showing blogs in the web site Pin
Amit Spadez9-Dec-09 0:07
professionalAmit Spadez9-Dec-09 0:07 
GeneralRe: error in showing blogs in the web site Pin
rahuuul179-Dec-09 0:12
rahuuul179-Dec-09 0:12 
GeneralRe: error in showing blogs in the web site Pin
Dinesh Mani9-Dec-09 0:22
Dinesh Mani9-Dec-09 0:22 
QuestionPaging toGridView Pin
rahul.net118-Dec-09 23:13
rahul.net118-Dec-09 23:13 
AnswerRe: Paging toGridView Pin
Blue_Boy8-Dec-09 23:30
Blue_Boy8-Dec-09 23:30 
GeneralRe: Paging toGridView Pin
rahul.net118-Dec-09 23:41
rahul.net118-Dec-09 23:41 
GeneralRe: Paging toGridView Pin
Blue_Boy8-Dec-09 23:44
Blue_Boy8-Dec-09 23:44 
Questionerror in the login web page Pin
Amit Spadez8-Dec-09 23:06
professionalAmit Spadez8-Dec-09 23:06 
I have made login page...
And i'm taking the values from the 'tbLogin' table.
there are, for instance 5 entries in the table ...And i'm entering three entries out of 5...they are working fine but when I try to enter other two entries ....login form doesn't pick'em ..what could be the error ..plz help ..The coding for the login form is :



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

if (validateFunction(Login1.UserName,Login1.Password))
{
Response.Redirect("gallery.aspx?Name=" + Login1.UserName);
}

}

protected void Login1_Authenticate(object sender,AuthenticateEventArgs e)
{
if (validateFunction(Login1.UserName, Login1.Password))
{
Session["UserName"] = Login1.UserName.ToString();
Login1.Visible = false;
Response.Redirect("gallery.aspx?Name=" + Login1.UserName);

}
else
{
e.Authenticated = false;
}

}

private bool validateFunction(string username, string password)
{
bool returnval = false;
string strConnection = "Server=.\\sqlexpress;Integrated Security=true;Initial Catalog=dbLogin";
con = new SqlConnection(strConnection);
String sqlQuery = "SELECT UserName, password FROM tbLogin WHERE UserName='" + username + "' and password='"+password + "'";
cmd = new SqlCommand(sqlQuery, con);
Session["UserName"] = Login1.UserName.ToString();
SqlDataReader dtr;
con.Open();
dtr = cmd.ExecuteReader();

while (dtr.Read())
{
if ((username == dtr["UserName"].ToString()) & (password == dtr["password"].ToString()))
{
returnval = true;

}
dtr.Close();
return returnval;
}
return returnval;
}

protected void login_error(object sender, EventArgs e)
{
if (ViewState["LoginErrors"] == null)
ViewState["LoginErrors"] = 0;
int errorcount = (int)ViewState["LoginErrors"] + 1;
ViewState["LoginErrors"] = errorcount;

if ((errorcount > 3) && (Login1.PasswordRecoveryUrl != string.Empty))
{
Response.Redirect(Login1.PasswordRecoveryUrl);
}
}






the table "tbLogin" columns are:
UserName,
Password
UserId


plz help in finding the error
AnswerRe: error in the login web page Pin
Blue_Boy8-Dec-09 23:34
Blue_Boy8-Dec-09 23:34 
GeneralRe: error in the login web page Pin
Amit Spadez9-Dec-09 0:10
professionalAmit Spadez9-Dec-09 0:10 
AnswerRe: error in the login web page Pin
Dinesh Mani9-Dec-09 0:36
Dinesh Mani9-Dec-09 0:36 
GeneralRe: error in the login web page Pin
Amit Spadez9-Dec-09 0:42
professionalAmit Spadez9-Dec-09 0:42 
GeneralRe: error in the login web page Pin
Dinesh Mani9-Dec-09 0:46
Dinesh Mani9-Dec-09 0:46 
GeneralRe: error in the login web page Pin
Amit Spadez9-Dec-09 0:49
professionalAmit Spadez9-Dec-09 0:49 
GeneralRe: error in the login web page Pin
Dinesh Mani9-Dec-09 0:52
Dinesh Mani9-Dec-09 0:52 
GeneralRe: error in the login web page Pin
Amit Spadez9-Dec-09 0:56
professionalAmit Spadez9-Dec-09 0:56 
GeneralRe: error in the login web page Pin
Dinesh Mani9-Dec-09 1:01
Dinesh Mani9-Dec-09 1:01 

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.