我的代码没有进入页面加载。这里面有什么问题。我在页面加载上使用了断点,但它不会进入页面加载。为什么会发生这种情况?帮我做这个
public partial class UploadVideo : System.Web.UI.Page
{
public string UploadVideoToFolder()
{
string vTitle = "";
string vDesc = "";
string FilePath = HttpContext.Current.Server.MapPath("~/ProductVideos/" + HttpContext.Current.Request.Form["title"]);
HttpFileCollection MyFileCollection = HttpContext.Current.Request.Files;
if (MyFileCollection.Count > 0)
{
// Save the File
try
{
MyFileCollection[0].SaveAs(FilePath);
return "1";
}
catch (Exception ex)
{
return "-1";
}
}
else
return "-1";
}
protected void Page_Load(object sender, EventArgs e)
{
string result = UploadVideoToFolder();
Response.Write(result);
}
}
}发布于 2013-10-19 18:06:36
在这些状态下,问题通常很容易解决,例如,您在Response.Redirect("name.aspx");中写了一个错误的名称
https://stackoverflow.com/questions/19464596
复制相似问题