Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Common code behind file
Message
 
To
28/03/2003 12:44:20
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00770311
Message ID:
00771595
Views:
16
>Rick,
>
>This is a web application. There are a bunch of lookup tables with similar structures. With a common code behind, I can have all my crud pages use the common code behind. I too get strange error messages when I try to change the codebehind in the ASPX pages.

You should probably use Custom Controls for those common things, then just reuse those. Again, subclassing the classes is the way to do this. There needs to be no code in the codebehind classes - they can simply inherit everything they need from the parentclass. All you'd end up with is an extra source file with essentially nothing in it.

+++ Rick ---

>
>Any ideas?
>
>TIA
>
>Rex
>
>>>Rick,
>>>
>>>Have you successfully done this in VS.NET? When I have tried this before in VS.NET, I get all kinds of messages and the project won't compile.
>>
>>No other than that accident. I seem to remember the code compiled though...
>>
>>But then why would you ever need to do that? After all you can just inherit the form from the one you're trying to copy and then simply not put any code in there <g>...
>>
>>+++ Rick ---
>>
>>>
>>>>Yes, but probably not the way you think...
>>>>
>>>>Codebehind specifies the name of the source file and the name of the class. Youy can just change those values and point them at a different CodeBehind file.
>>>>
>>>>I've done this by accident before and it seems to work actually although at the time I really screwed up my code with that <g>....
>>>>
>>>>
>>>>+++ Rick ---
>>>>
>>>>
>>>>
>>>>
>>>>>All,
>>>>>
>>>>>Is there a way to have multiple ASPX pages share a single code behind file in VS.Net?
>>>>>
>>>>>Thanks
>>>>>
>>>>>Rex
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform