我正在更改onclick()
活动中的用户个人资料图片。它越来越
保存在 iis 服务器中,但是当它没有反映 aspx 页面时。当我注销并再次登录时。它正在更新。这是我的代码:
默认.aspx
<input type="file" id="userPicFileUpload" runat="server" />
<button runat="server" class="btn btn-info editable-submit" id="btnChangeUserPic" onclick="ChangeUserPic();">Change</button>
默认.aspx.cs
protected void btnChangeUserPic2_Click(object sender, EventArgs e)
{
try
{
string filePath = Server.MapPath("~/Upload/");
HttpPostedFile File = userPicFileUpload.PostedFile;
string fileExtn = Path.GetExtension(File.FileName).ToLower();
string filename = System.IO.Path.GetFileName(File.FileName);
File.SaveAs(filename);
lblStatus.Visible = true;
lblStatus.Text = "Profile picture changed successfully !!";
}
catch (Exception ex)
{
}
}
上传图片后没有刷新。请帮帮我