www.webdeveloper.com
Results 1 to 4 of 4

Thread: Weird behaviour of VS.NET

  1. #1
    Join Date
    May 2004
    Location
    Russia
    Posts
    13

    Weird behaviour of VS.NET

    I create ASP.NET application.

    codebehind file contain following area:
    Code:
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {    
    ...
    }
    I add events handlers there manually. But every once in a while VS.NET review this region and erase my lines
    The questions are:
    1. Is this really a result of VS.NET activity?
    2. If yes then how can I change behaviour of VS.NET?
    3. If not then can anybody explain me what is going on?

    thanking you in anticipation

  2. #2
    Join Date
    Nov 2003
    Posts
    655
    "do not modify the contents of this method with the code editor"

    Why do you insist on doing what they told you NOT to do?

    To answer 1 and 3: My guess it that something is being done elsewhere to the page (perhaps adding components to it) that causes this code to be rewritten automatically to account for the changes. It probably just does an overwrite of the code, hence the warning not to do any changes to it yourself, lest they be wiped out at a later point.

  3. #3
    Join Date
    May 2004
    Posts
    6
    The erase activity might be due to RAM problem.
    I have also faced with this problem.
    I think u have only 128KB RAM.
    Add one more 64KB.
    it will be ok.i hope so.

  4. #4
    Join Date
    Jun 2004
    Posts
    1
    CardboardHammer had it right. The visual ide will change that code on a whim, has nothing to do with ram.

    There are two parts to the page you need to be aware of.

    InitializeComponent <- DO NOT MODIFY

    Page_Init <- HERE YOU CAN PUT YOUR HANDLERS


    Page_Init actually calls InitializeComponent (doesn't show visibly sometimes, because it does so by default), so insert your handlers after that call inside the Page_Init event.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles