我是新手,所以希望你们能忍受我。我正在尝试在 btnDone 时将 filePathImage 的 URL 目录插入数据库。部分代码:
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
EnsureDirectoriesExist();
String filepathImage = (@"Images/Story/" +txtTitle.Text + "/" + e.FileName);
AjaxFileUpload1.SaveAs(Server.MapPath(filepathImage));
}
protected void btnDone_Click(object sender, EventArgs e)
{
act.ActivityName = dropListActivity.SelectedItem.Text;
act.Title = txtTitle.Text;
act.FileURL = filepathImage;
daoStory.Insert(act);
daoStory.Save();
}
我在 act.FileURL = AjaxFileUpload1.filePathImage 中遇到了 filePathImage 的问题;任何建议或解决方案将不胜感激