Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All
Can any one help me on this:-

How to show progress bar or loading image in MVC application when i click on button.

Thanks in Advance
Posted

1 solution

private void button1_Click(object sender, EventArgs e)
{


cn.Open();
cmd = new SqlCommand("select * from admin", cn);
cmd.Connection = cn;
dr = cmd.ExecuteReader();
while (dr.Read())
{
if ((textBox1.Text == dr[1].ToString()) && (textBox2.Text == dr[2].ToString()))
{
progressBar1.Visible = true;
progressBar1.Minimum = 1;
progressBar1.Maximum = 10000;
progressBar1.Value = 1;
progressBar1.Step = 1;
for (int i = 1; i < 10000; i++)
progressBar1.PerformStep();
this.Hide();
Form2 sForm = new Form2(textBox1.Text);
sForm.Show();
}
else
{
MessageBox.Show("entered data's not valid!!!");
}
}

cn.Close();


}
 
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