Click here to Skip to main content
15,885,878 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSyntax error in INSERT INTO statement Pin
jadhavjitendrar14-Sep-09 19:55
jadhavjitendrar14-Sep-09 19:55 
AnswerRe: Syntax error in INSERT INTO statement Pin
Code-o-mat14-Sep-09 20:32
Code-o-mat14-Sep-09 20:32 
AnswerRe: Syntax error in INSERT INTO statement Pin
CPallini14-Sep-09 21:01
mveCPallini14-Sep-09 21:01 
AnswerRe: Syntax error in INSERT INTO statement Pin
David Crow15-Sep-09 3:04
David Crow15-Sep-09 3:04 
QuestionChild Windows Pin
Cipher 2214-Sep-09 19:00
Cipher 2214-Sep-09 19:00 
AnswerRe: Child Windows Pin
Randor 15-Sep-09 1:43
professional Randor 15-Sep-09 1:43 
QuestionRe: Child Windows Pin
David Crow15-Sep-09 3:06
David Crow15-Sep-09 3:06 
Questionhow to clear the session? Pin
shru_dhuri14-Sep-09 18:59
shru_dhuri14-Sep-09 18:59 
i has been created one login.aspzx page and one master.aspx page
when i login ,i m directly redirect to master page.master page contain logout button(linkbutten).
when clicked on logout button,the page has redirect to login page.
My problem is that,in that (after i clicked the logout button)when i clicked the "Back" it will move to master page.
i want clear the session?????

login.aspx page :

protected void buttonLogin_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(TextBox1.Text))
{ //Focus box before showing a message
// textBoxUsername.Focus();
TextBox1.Focus();
//MessageBox.Show("Enter your username", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
Response.Write("<script> alert('Enter your username');</script>");
//Focus again afterwards, sometimes people double click message boxes and select another control accidentally
TextBox1.Focus();
// textBoxUsername.Focus();
return;
}
else if (string.IsNullOrEmpty(TextBox2.Text))
{
// textBoxPassword.Focus();
TextBox2.Focus();
// MessageBox.Show("Enter your password", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
Response.Write("<script> alert('Enter your password');</script>");
TextBox2.Focus();
// textBoxPassword.Focus();
return;
}
using (DataTable dt = LookupUser(TextBox1.Text))
{
if (dt.Rows.Count == 0)
{
TextBox1.Focus();
// MessageBox.Show("Invalid username.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
Response.Write("<script> alert('Invalid username.');</script>");

TextBox1.Focus();
return;
}

else
{
//Always compare the resulting crypto string or hash value, never the decrypted value
//By doing that you never make a call to Decrypt() and the application is harder to
//reverse engineer. I included the Decrypt() method here for informational purposes
//only. I do not recommend shipping an assembly with Decrypt() methods.
string dbPassword = Convert.ToString(dt.Rows[0]["Password"])…
string appPassword = (TextBox2.Text);
//we store the password as encrypted in the DB
if (string.Compare(dbPassword, appPassword) == 0)
{
Session.Add("islogin", true);

Response.Redirect("Firstmain.aspx");

}
else


{
//You may want to use the same error message so they can't tell which field they got wrong
TextBox2.Focus();
// MessageBox.Show("Invalid Password", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
Response.Write("<script> alert('Invalid Password');</script>");
TextBox2.Focus();
return;
}
}
}
}


master page :

protected void Page_Load(object sender, EventArgs e)
{
lblTime.Text = DateTime.Now.ToLongDateString();


if ((Session["islogin"] == null) || (Session["islogin"] == ""))
{

Response.Redirect("frmLogin.aspx");
}



}

//protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
//{
// Response.Write("LoggingOut event. Don't go away now.");
// e.Cancel = true;

//}




protected void LinkButton1_Click(object sender, EventArgs e)
{

Session.Remove("islogin");
Session.Clear();
Response.Redirect("frmlogin.aspx");

}


send mi solution as soon as possible
AnswerRe: how to clear the session? Pin
«_Superman_»14-Sep-09 19:27
professional«_Superman_»14-Sep-09 19:27 
QuestionRead Text from Image file Pin
Game-point14-Sep-09 18:38
Game-point14-Sep-09 18:38 
AnswerRe: Read Text from Image file Pin
«_Superman_»14-Sep-09 19:33
professional«_Superman_»14-Sep-09 19:33 
AnswerRe: Read Text from Image file Pin
Cedric Moonen14-Sep-09 20:21
Cedric Moonen14-Sep-09 20:21 
QuestionCoCreateInstance getting the wrong coclass Pin
PaulowniaK14-Sep-09 17:01
PaulowniaK14-Sep-09 17:01 
AnswerRe: CoCreateInstance getting the wrong coclass Pin
Stuart Dootson14-Sep-09 20:39
professionalStuart Dootson14-Sep-09 20:39 
GeneralRe: CoCreateInstance getting the wrong coclass Pin
PaulowniaK14-Sep-09 20:43
PaulowniaK14-Sep-09 20:43 
AnswerRe: CoCreateInstance getting the wrong coclass Pin
Stuart Dootson15-Sep-09 0:42
professionalStuart Dootson15-Sep-09 0:42 
QuestionCode Help Pin
MrMcIntyre14-Sep-09 10:45
MrMcIntyre14-Sep-09 10:45 
QuestionRe: Code Help Pin
CPallini14-Sep-09 11:15
mveCPallini14-Sep-09 11:15 
AnswerRe: Code Help Pin
Richard MacCutchan14-Sep-09 11:43
mveRichard MacCutchan14-Sep-09 11:43 
AnswerRe: Code Help Pin
Adam Roderick J14-Sep-09 18:01
Adam Roderick J14-Sep-09 18:01 
Question[Message Deleted] Pin
Jim Fell14-Sep-09 9:45
Jim Fell14-Sep-09 9:45 
AnswerRe: Reading ASCII File TAB is Replace with NULL Pin
David Crow14-Sep-09 10:06
David Crow14-Sep-09 10:06 
QuestionActive windows Pin
mishudev14-Sep-09 8:58
mishudev14-Sep-09 8:58 
AnswerRe: Active windows Pin
Randor 14-Sep-09 9:52
professional Randor 14-Sep-09 9:52 
QuestionSetting a controls background to transparent Pin
Deepak.Prahlad14-Sep-09 7:47
Deepak.Prahlad14-Sep-09 7:47 

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.