RE: ASP.Net 2.0 - App_Code Folder



Hi netasp,

You can find more information about common ASP.NET 2.0 conversion issues
and solutions here:

#Common ASP.NET 2.0 Conversion Issues and Solutions
http://msdn2.microsoft.com/en-us/library/ms972973.aspx


From the document, you will see following changes are related to your issue:

--------------------
In ASP.NET 1.x, the graphical components were typically separated from the
coding components using an .aspx page and a code-behind file. The .aspx
page is derived from the code-behind file. This means that you have to
declare all your controls in both classes in order to properly wire up the
callback events. The inheritance relationship also caused some problems
with synchronizing the classes, especially when a developer made a change
to the .aspx (such as adding a control), without making the necessary
changes to the code-behind or recompiling the application.

In ASP.NET 2.0, the code separation model has changed, thanks to the advent
of a concept known as the partial class. The partial keyword lets you split
the code for a single class into two separate files. The code-behind file
defines a partial class that contains user code. The designer will also
generate a stub file containing a partial class that defines the field
declarations for the controls used in the aspx page. When compiled, the
aspx page will derive from the combined partial classes, and be compiled
into its own page assembly. This design reduces the risk of inadvertently
breaking the page by editing designer-generated code.

The conversion wizard updates your application by moving all standalone
code to the App_Code directory.
--------------------


I think maybe some of your code are standalone and therefore they're
migrated to App_Code. However, based on my test, if the code file is a
CodeBehind class for a WebForm, it will not be migrated to App_Code.

Would you please create a simpler reproducible VS2003 web project and send
it to me? I can verify the migration behavior on my side. Thanks.


Regards,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: Global subroutines
    ... >> surround the code with the script tags. ... > HTML code for Global.asax (usually, an aspx combo has three different ... and the code-behind file which sits in another window. ... > You definitely need to compile the file in any case. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Attributes.Add not workign
    ... top of your aspx page. ... created in the code-behind file from which the aspx file will derive.The new ... which points to the codebehind file.The codebehind attribute is used to keep ... editor like NOTEPAD,then you need the src attribute in the Page directive to ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.Net 2.0 and partial classes
    ... ASP.NET 2.0 continues to offer both the code-inline and code-behind coding ... code-behind model by modifying the nature of the code-behind file. ... The partial class contains all of the user-defined ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.Net 2.0 and partial classes
    ... In terms of the code-inline model, very little has changed except for the way that Microsoft Visual Studio 2005 supports single-file development. ... In v1.1 you couold do all of your layout and code in a single ASPX file, it's just that it was painful to do. ... the code-behind model by modifying the nature of the code-behind file. ... The partial class contains all of the user-defined code, but omits all of the plumbing and connectivity code that was auto-generated by Visual Studio .NET in ASP.NET 1.x. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: hiddenfield / htmlInputHidden ?
    ... If I wanted to use a server control, which one should I use in an *.aspx ... then how do I define a reference to it in my code-behind file? ... >> How do I declare a htmlInputHidden field manually in code-behind file ... >> TIA ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)