Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
In Back arrow (Click to go back) how to set label false.
narasiman rao
8y
193
1
Reply
My run mode as follows
Detailspage as follows
Empid 10001
Mobile 9784000002
Submit (Button)
When i give the correct Empid and Mobile it redirects to Registration page in a new tab window.
In that New tab window in browser when i press back (<
arrow it will go detailspage.aspx.
Then again when i enter wrong Empid and Mobile it shows the message in the label1 as "Your Data does not match".
Then user enter the correct Empid and Mobile it redirects to Registration page in a new tab window.
In that New tab window, in browser when i press back (<
arrow it will go Detailspage.aspx. in that detailspage.aspx previously shows the message in the label1
"Your Data does not match". that message to set visible false.
In submit button code as follows
protected void btnsubmit_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection();
con.ConnectionString="Data Source=.\\SQLEXPRESS;Initial Catalog=test;Integrated Security=True;"
string query = "select * from login where Empid= '" + txtempid.text + "' and mobile = '" + txtmobile.text + "'";
SqlCommand cmd = new SqlCommand(query,con);
con.open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
Datatable dt = new datatable();
da.Fill(dt);
if(dt.Rows.Count > 0)
{
Response.Redirect("Detailspage.aspx");
label.visible = false;
}
else
{
label1.text = "Your Data does not match";
}
}
But when i run the code the label1 is not visible false. when it redirects to Details.aspx page.
Please help me what is the mistake in my above code.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Don`t know how to solve this error
Garbage Collectors