首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PageLoad不工作

PageLoad不工作
EN

Stack Overflow用户
提问于 2013-10-19 17:40:42
回答 1查看 78关注 0票数 1

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

代码语言:javascript
复制
   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);
    }
  } 
 }
EN

回答 1

Stack Overflow用户

发布于 2013-10-19 18:06:36

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19464596

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档