-2
我的FileUpload位于UpdatePanel Ajax中,并且始终返回false。 我应该怎么办?这里是我的代码FileUpload.Has文件在updatepanel中始终返回false
if (FileUpload1.HasFile)
{
try
{
string filename = Path.GetFileName(FileUpload1.FileName);
FileUpload1.SaveAs(Server.MapPath("~/") + filename);
string script2 = "alert(\"uploaded\");";
ScriptManager.RegisterStartupScript(this, GetType(),
"ServerControlScript", script2, true);
}
catch (Exception ex)
{
}
}
你绝对应该也发布UpdatePanel的ASPX标记,从这段代码中很难判断出什么可能是错误的 –