CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.vs_2005_web_application_projects Tags:
Item Type: NewsGroup Date Entered: 4/27/2006 8:44:28 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 30 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
nvisser
Asp.Net User
Why does designer partial class only contain declarations?4/27/2006 8:44:28 PM

0/0

I am testing out migration of our web applications to VS.Net 2005 WAP.  After selecting to "Convert to Web Application" code-behind gets split into two partial classes (as I expect) and things work fine, but...

I expected ALL designer code to have moved to the designer partial class, but only the declarations are there.  Why isn't the "other" designer code in that same file?  The designer still writes to MY file.

I am just trying to understand why it works this way.  I think this has more to do with how VS.net 2005 works, than with my conversion (adding new controls via the designer keeps the same model).  Maybe I just don't understand the nuts and bolts.  Somebody please explain, because I don't see the advantage in this model.  Thanks!

Nick


michiel1978
Asp.Net User
Re: Why does designer partial class only contain declarations?9/18/2006 10:52:26 AM

0/0

I found this old post looking for answers to this question. So my reply will hopefully bring attention to this post, because I would like to know as well: Convert to Web Application will not move the #region Web Form Designer generated code to the designer file, only control declarations will be moved.


When you ask a question, remember to click "mark as answered" when you get a reply which answers your question; this ensures the right forum member gets credit below for being helpful (and makes search more relevant too).
timmcb
Asp.Net User
Re: Why does designer partial class only contain declarations?9/19/2006 5:39:16 PM

0/0

To some extent the code in "#region Web Form Designer generated code" is abandoned code from converting from VS 2003 to VS 2005.  You can safely remove the region around the code. However, the code inside remains for compatibility and it is up to you to decide what to do with it.

In VS 2003 the web form design surface persisted to both markup and code.  In VS 2005 the web form design surface only persists to markup.  The only exception to this is if you use the component designer on a page through the "View Component Designer" command.  The component designer only persists to code.

Persisting only to markup makes a lot of sense for the web site CodeFile model where ASP.Net generates the half of the partial class with the control declarations on the server.  For Web Applications Projects we decided to bring back the CodeBehind model.  For the first version of Web Application Projects we had no ability to change the designer and could not bring back persistence to both markup and code.  So, instead we opted for a hybrid approach where the desiger continues to work the same and only persist to markup and a separate generator creates the .designer file containing the declarations.  There were several advantages to this: 1) the generator was able to re-use some of the ASP.Net server logic for generating a partial class 2) the .designer file can be re-generated in both markup and design views of the editor 3) the generator can be used in the conversion process to create the .designer files.


Tim McBride

This posting is provided "AS IS" with no warranties, and confers no rights.
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Visual Basic 2005: How to Program Authors: Harvey M. Deitel, Pages: 1513, Published: 2006
Principles of Object-oriented Modeling and Simulation with Modelica 2.1 Authors: Peter A. Fritzson, Pages: 897, Published: 2004
Expert ASP.NET 2.0 Advanced Application Design: Advanced Application Design Authors: Dominic Selly, Andrew Troelsen, Tom Barnaby, Pages: 459, Published: 2005
Accelerated C# 2008 Authors: Trey Nash, Pages: 510, Published: 2007
The Book of Visual Basic 2005: .NET Insight for Classic VB Developers Authors: Matthew MacDonald, Pages: 490, Published: 2006
The C# Programming Language Authors: Anders Hejlsberg, Scott Wiltamuth, Peter Golde, Pages: 704, Published: 2006
Engineering Problem Solving with C++ Authors: Delores M. Etter, Jeanine A. Ingber, Pages: 576, Published: 2007
Head First C# Authors: Andrew Stellman, Jennifer Greene, Pages: 738, Published: 2007
Essential ASP.Net 2.0 Authors: Fritz Onion, Keith Brown, Pages: 345, Published: 2006
Visual Basic 2005 Programmer's Reference Authors: Rod Stephens, Pages: 1022, Published: 2005

Web:
How to: Split a Class into Partial Classes Class Designer supports partial classes and methods. ... for partial methods, File Name lists only the file that contains the partial method declaration. ...
Understanding Code-Behind with VS 2005 Web Application Projects The other partial class file is then a tool-generated/maintained file that contains the protected control field declarations and the other design-time code ...
Why don't partial types require partial on all declarations? For example, in the designer case such as a WinForm, it is really necessary to put “Partial” on the class declaration when the partial type that the ...
Implications and Repercussions of Partial Classes in the .NET ... By using partial classes, you can split the above declaration in two or more ..... The final word, though, could only be said when you have the bits in your ...
The Visual Basic Team : Partial Methods A partial method can only have 1 "implementing method", where events may have ... one partial class contains designer generated code and another contains ...
What does VS 2008's "Convert to Website" mean? - Stack Overflow It does this by using a partial class. That is, the same class for your page, but split into two seperate files. This allows the VS2k5 (and VS2k8) designer ...
Where can I view the partial class with designer code in my ASP ... May 26, 2007 ... NET the partial class with the designer code doesn't actually exist. ... in the sense that you can no longer see your object declarations. ...
Alexander Schunk's Blog: OpenJDK: Partial Classes in Java? But in C# (for partial classes, amongst other reasons) , a source file can be stored anywhere you want in the compiler's path, and not only can it contain ...
WPF's Use of Partial Classes' Access Modifiers - Omer van ... As you may well know, when defining a partial class, the definition is collected from every part, glued together, and only then are default behaviors ...
CoDe Magazine - Article: Implications and Repercussions of Partial ... Partial classes are a way to work around the issue. Logic and declaration go into distinct files but compilers have to be updated to be able to process a ...

Videos:
www.moldytoaster.com shed method of encasing the lower man with the front of the garment to the front of the wearer, was curiously reversed, and the capture of the ...
www.moldytoaster.com polled three days and got--one vote, declared County Member elect. Sibthorp shall be a man of weight and influence, "giving to (h)airy nothing a ...
Long Beach City Council Meeting Long Beach City Council Meeting




Search This Site:










how to access methods from other project in solution?

i installed reportviewer but its not showing up in my visual web developer toolbox data tab

install problem

how to open a vs 2003 solution in vs 2005 without automatically getting converted ?

vs80-kb915364-x86-enu.exe will not install

deployment options

sub aplications/bin folders

website to webapplication conversion

converting a vs 2005 web application to a vs .net 2003 web application

web application project mysteriously changes back to web project

changes to sqlexpress db not getting saved

<appcode> vs <separate classes>

execute batch files in a remote machine (c#, asp.net)

codebehind issues when deploying a wap to server

can you add another function?

error cs 0433 found class in multiple dll's

how to convert a standard vs 2005 project into a web application project

help regarding a project

edit html of aspx page after publish issue!!

migration from website project to webapplication project

compiler problem error cs0433

is already declared as 'protected dim withevents .....

install "update to support web application projects" error

remembering website password

web site to web application 2005 and web references

bug: custom controls lead to outofmemoryexception

missing asp.net web application template vs 2005

image editior in asp.net

is web application the way to go

sending smss via mobile web app

  Privacy | Contact Us
All Times Are GMT