1

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

   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);
    }
  } 
 }
4

1 に答える 1

1

これらの状態では、通常、問題は簡単に解決できます。たとえば、間違った名前をResponse.Redirect("name.aspx");

于 2013-10-19T10:06:35.787 に答える