当我单击按钮时如何在MVC应用程序中显示进度条或加载图像 [英] How to show progress bar or loading image in MVC application when i click on button

查看:68
本文介绍了当我单击按钮时如何在MVC应用程序中显示进度条或加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
谁能帮助我:-

当我单击按钮时,如何在MVC应用程序中显示进度条或加载图像.

在此先感谢

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

推荐答案

私有无效button1_Click(对象发送者,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;
为(int i = 1; i< 10000; i ++)
progressBar1.PerformStep();
this.Hide();
Form2 sForm =新的Form2(textBox1.Text);
sForm.Show();
}
其他
{
MessageBox.Show(输入的数据无效!");
}
}

cn.Close();


}
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();


}


这篇关于当我单击按钮时如何在MVC应用程序中显示进度条或加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆