【问题标题】:PageLoad not working页面加载不起作用
【发布时间】:2013-10-19 09:40:42
【问题描述】:

我的代码没有进入页面加载。这有什么问题。我在页面加载上使用了断点,但它没有进入页面加载。为什么会这样?帮我做这个

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

【问题讨论】:

  • 检查 web.config 文件中是否启用调试。并尝试 autoeventwireup=true

标签: c# asp.net


【解决方案1】:

在这些状态下,问题通常很容易解决,例如你在Response.Redirect("name.aspx");中写了一个错误的名字

【讨论】:

  • 我遇到了问题。这是我的错误。实际上是一个愚蠢的错误。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-11-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多