What's wrong with my code?

Last post 11-30-2005, 2:12 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  11-29-2005, 11:35 AM 13176

    What's wrong with my code?

    The code works fine in my developer machine, But when i publish it, the page rasie a runtime error,but another page also use cute editor works fine.
    Here is my code :
    public class FileEditor : System.Web.UI.Page
     {
      protected System.Web.UI.WebControls.DropDownList DropDownList1;
      protected System.Web.UI.WebControls.Button Button1;
      protected CuteEditor.Editor inputCont;
      private void Page_Load(object sender, System.EventArgs e)
      {
          if(!Page.IsPostBack)
       {
        LoadFile();
       }
      }
      public string FileName
      {
       get {return(Server.MapPath(this.DropDownList1.SelectedValue));}
      }
      #region Web Form 
      override protected void OnInit(EventArgs e)
      {
       //
       // CODEGEN: 
       //
       InitializeComponent();
       base.OnInit(e);
      }
      
        /// </summary>
      private void InitializeComponent()
      {   
       this.DropDownList1.SelectedIndexChanged += new System.EventHandler(this.DropDownList1_SelectedIndexChanged);
       this.Button1.Click += new System.EventHandler(this.Button1_Click);
       this.Load += new System.EventHandler(this.Page_Load);
      }
      #endregion
      private void Button1_Click(object sender, System.EventArgs e)
      {
       try
       {
        inputCont.SaveFile(FileName);
       }
       catch(Exception e1)
       {
        Response.Write(e1.Source + "<Br>" + e1.Message);
       }
      }
      private void Button2_Click(object sender, System.EventArgs e)
      {
       //inputCont.LoadHtml(FileName);
      }
      private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
      {
       LoadFile();
      }
      private void LoadFile()
      {
       try
       {
        inputCont.LoadHtml(FileName);
       }
       catch(Exception e)
       {
        Response.Write(e.Source + "<Br>" + e.Message);
       }
      }
      
     }
  •  11-30-2005, 2:12 PM 13231 in reply to 13176

    Re: What's wrong with my code?

    idol ,
     
    What's kind of error message did you receive?
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML