Click here to Skip to main content
15,886,693 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi all,
i am writing a program for my course.in my login form I have a button.in this button's click event i write some codes that when i click that some information showed to me.

but after i placed this button(in form) in a update panel,update progress,and script manager.when i click in this button.that information do not showed for me.wwhat i must do?please help
Posted
Comments
AmitGajjar 23-Apr-13 6:53am    
can you post your code ?
_Starbug_ 23-Apr-13 7:00am    
this is button click code

protected void Button1_Click1(object sender, EventArgs e)//login as website member
{
RequiredFieldValidator1.Enabled = true;
RequiredFieldValidator2.Enabled = true;
RequiredFieldValidator3.Enabled = true;
RegularExpressionValidator1.Enabled = true;
if (IsPostBack)
{
if (TextBox3.Text == Label7.Text)
{
string constring = "server=localhost;database=SanjeshOrganizationDB;Trusted_connection=true";
SqlConnection con0 = new SqlConnection(constring);
con0.Open();
SqlCommand com0 = new SqlCommand("select Username from Profile_Information where Username='" + TextBox1.Text + "' and Password='" + TextBox2.Text + "'", con0);
SqlDataReader rdr = com0.ExecuteReader();
try
{
if (rdr.HasRows)
{
rdr.Close();
Session["Username"] = com0.ExecuteScalar();
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(3));
Label8.Text = "wait...";
System.Threading.Thread.Sleep(TimeSpan.FromSeconds(3));
Label8.ForeColor = System.Drawing.Color.Green;
Response.Redirect("MainPage.aspx");
con0.Close();

}
else
{
HyperLink1.Visible = true;
Label8.Text = "incorrect username and password";
}
}
catch
{
HyperLink1.Visible = true;
Label8.Text = "error ";
}
}
else
{
Label8.Text = "incorrect capcha code";
}
}
}
ZurdoDev 23-Apr-13 7:05am    
First off, you need to reply to the person who made the comment instead of adding a comment to your own question. Secondly, please use the improve question button and put the code into the main question. It will be easier for everyone to follow.
_Starbug_ 23-Apr-13 7:17am    
sorry you right.
Sandeep Mewara 23-Apr-13 7:07am    
Is that control showing 'some information' inside the update panel which is being triggered by a button click?

1 solution

solved my friends.
I have a label that show me some information when button clicked.
this label is out of update panel.i dragged it to inside of update panel.and show me error message and others.

the lesson from this question is that when you add a button to a update panel you must add every button's that have relation with this button to the update panel.I think this.is it correct?suggestions?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900