Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. related #region Web Form Designer generated code

related #region Web Form Designer generated code

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netvisual-studioquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    smitab
    wrote on last edited by
    #1

    hi all, following code is automatically generated by visual studio #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.ChkAll.CheckedChanged += new System.EventHandler(this.ChkAll_CheckedChanged); this.Load += new System.EventHandler(this.Page_Load); } #endregion but in my app this.ChkAll.CheckedChanged += new System.EventHandler(this.ChkAll_CheckedChanged); this.Load += new System.EventHandler(this.Page_Load); i m writting manually..this is not automatically generated; every time when i made changes in my page it is automatically erased why this happens?:confused: ------

    M 1 Reply Last reply
    0
    • S smitab

      hi all, following code is automatically generated by visual studio #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); } /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { this.ChkAll.CheckedChanged += new System.EventHandler(this.ChkAll_CheckedChanged); this.Load += new System.EventHandler(this.Page_Load); } #endregion but in my app this.ChkAll.CheckedChanged += new System.EventHandler(this.ChkAll_CheckedChanged); this.Load += new System.EventHandler(this.Page_Load); i m writting manually..this is not automatically generated; every time when i made changes in my page it is automatically erased why this happens?:confused: ------

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, This is a known issue of the VS 2003 as it sometimes resets the generated code in code-behind, and as a result of that your sample code could be removed also. In VS 2005, this thing does not happen since VS 2005 uses the inline code as default model to register the event handler. So in your case, there are a couple of ways which you may consider using to register the event handler: + Place your code in the Page_Init event, not in the generated code area. + Use the in-line code model, it means you can declare the event handler in the control declaration in the web page .aspx

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups