私のコードはページの読み込みに入りません。これの問題は何ですか。ページロードでブレークポイントを使用しましたが、ページロードにはなりません。なぜこうなった?これを手伝って
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);
}
}
}