有没有什么办法显示标签,显示“上传..”,而我的按钮点击正在处理?如何在完成数据库处理后显示警报弹出窗口?
我这样做这样
`
保护无效btnUpload_Click(对象发件人,EventArgs的)
{
lblOutput.Text="uploading..";
HttpPostedFile postedFile = FileUpload1.PostedFile;
string ClientFileName, ServerFileName;
if ((FileUpload1.HasFile && FileUpload1.PostedFile != null) || txtUrl.Text!="")
{
try
{
HttpPostedFile myFile = FileUpload1.PostedFile;
if (fileType == "Image")
{
if (fileExt == ".jpg" || fileExt == ".gif" || fileExt == ".png" || fileExt == ".bmp" || fileExt == ".tif")
{
ServerFileName = System.IO.Path.Combine(ServerSavePathI, ClientFileName);
string serverPath = Server.MapPath(ServerFileName);
FileUpload1.SaveAs(serverPath);
dbInsert(fileType, fileName, fileExt, filePath+fileType+"/"+fileName.Replace(" ",string.Empty)+fileExt, url);
}
}
}
`
但它显示在我的文件已被上传后。
我做错了什么?还是有其他方法可以做到这一点?
哪里*数据库处理*做了什么? – 2011-06-14 05:51:59
你是否使用标准的asp.net FileUpload控件或其他东西来上传? – 2011-06-14 05:55:16
是的我使用asp:FileUpload – 2011-06-14 06:02:40