|
-
May 21st, 2008, 09:22 PM
#1
How to create a partial class?
Hi all. I am using C# as well as VB.NET for my ASP.NET applications. I have come across the keyword partial used to split up a single class' definition into two .cs files. I hope that is correct. I do not, however, know what is the purpose of doing so? Also, I have seen this concept used in windows programming with winforms/.NET more frequently. The code behind file for the windows forms is a partial class file in C# and the default name is Form1. In C++/CLI, it is ref class and in VB.NET the inheritance clause is omitted altogether. The difference in the three environments is evident. However, I have the following questions:
<1> What is the purpose of using the keyword partial in C#?
<2> How can I use partial in web applications (using C# as a language) in a web-forms code behind file? I mean to say that, I want to split a single code behind file into 2 (or more) code behind files for a web form.
<3> Also, looking at the code, I found that VB.NET environment does not show up the details of the form designer code at all, C# exposes a few code chunks where as C++/CLI gives minute details such as ResumeLayout() and PerformLayout()...So why is it that the level of exposure of the designer generated code in the three different languages different?
Thanks and Regards,
Bhushan.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|