473,388 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Web form inheritance?

Joe
We are working on a project that requires 3rd parties (ie, consultants) to
use our ASP.net webforms in a very reusable manner. The big catch is that
we are not allowed to give them source. There are a group of screens that
they all need to use in other applications, but need the ability to
customize some of the simpler behavior.

Some of the problems we are having include:

- they of course want to to be able to jump into and out of the "common"
pages. That is, they want to load our reusable pages, and then when the
user is done with the page, jump back into a specific page in their
applications.
- They want to do simple customizations of the page - like include a
different logo, maybe include or exclude certain controls, etc. We are
still thinking this part through.
- It seems that with precompilation, we get a separate assembly for each
page, and the name of the generated dll seems to be somewhat random. We
havent figured out how to map the dll name to which page it is.

The first thought that occurred to us is to use some form of form
inheritance. If memory serves, Windows Forms allow some cool form
inheritance features. Does Web Forms allow the same kind of functionality?

Does anyone have any best practices for how to do this? Please keep in mind
that we are only allowed to ship the assemblies, and not source code to the
clients.

Thanks for any info,

joe
Jul 6 '06 #1
4 2556
Hello Joe,

Welcome to the ASPNET newsgroup.

From your description, you're going to develop an ASP.NET (2.0?) web
application framework which will provide the sufficient flexiblity and
reusablity so that other vendors or users will be able to customize it
easily, correct?

Based on my experience, here are some of my understanding and suggestions:

1. ASP.NET 2.0 has naturally support visual inheritance through the
MasterPage feature. Master page is somewhat like a page template where we
can define some common UI elements(such as logo, banner, side navigation
bar, etc...). Then, other concrete pages in our web application can apply
this master page so that those common UI elements will be inherited from
the master page(note that the implementation of masterpage is not class
level inheritance in OO, but the "aggregation" model). In another word,
visual inheritance is not actual OO inheritance. Such visual inheritance
can make our web site's pages be consistent in UI, and easy to modify it
(we only need to modify the master page when necessary). However, for your
scenario, it won't be quite easy to be further reused after precompilation.
2. To make the #1 abit more flexible, you can consider constructing the
master page UI through code dynamically, e.g. the logo, banner or
navigatino bars in the master page can be loaded at runtime(from other
separate ascx usercontrols).
3. If we want the most flexibility and reusability, we can also consider
defining a base page class completely from scratch, the base page class
will purely use code to programmatically construct the UI (from some
external template files or usercontrols). However, in this approach, we'll
lose the convenience provided by the built-in features in ASP.NET 2.0 (such
as master page). Also, generally speaking, the more we provide on
flexibility, the more we'll lose in performance.

Here are some web articles I've searched over internet some of which have
mentioned some of the approach I mentioned:

#Building Re-Usable ASP.NET User Control and Page Libraries with VS 2005
http://weblogs.asp.net/scottgu/archi...28/423888.aspx

#Master Your Site Design with Visual Inheritance and Page Templates
http://msdn.microsoft.com/msdnmag/is...20MasterPages/

#Creating Usable Page Templates in ASP.NET
http://www.devx.com/dotnet/Article/18011

#Creating Reusable Content in ASP.NET
http://www.informit.com/articles/art...?p=173411&rl=1

In addition, I suggest you also have a look at some well-know 3rd party web
application framework such as the dotnetnuke. Maybe you can get some good
ideas from them.

Hope this helps some.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

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.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Jul 6 '06 #2
Joe
Hi Steven -

WOW! That was fast, must be a new record for a response.

Thanks for your response, it is appreciated.

Yes, it is ASP.Net 2.0.

If I understand you correctly, I am not sure if Master Pages will fit the
bill for what we need. Our problem isnt only that the pages should be
consistent, but we have to provide stock functionality through our 3 tier
implementation (ie, UI, Middle Tier, DB). Our general design philosophy is
to create user controls that deal with calling the M/T, and then we
aggregate these user controls into each page.

What we are looking for is a way to allow 3rd parties to use these pages
(with the embedded user controls) with slight modifications. Best example
of one of those modifications is to allow the 3rd party to specify the
destination page when the user hits "ok" on one of our pages. So we are
essentially giving them stock functionality, and allowing them to completely
integrate it into a new application seamlessly.

But our solution must be such that the 3rd party doesnt receive any source
code from us. Binaries only.

I hope this explains our problem a little better.

I have not yet read the links you pointed me to, but will in the morning.

Thanks again,

Joe

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:Nl**************@TK2MSFTNGXA01.phx.gbl...
Hello Joe,

Welcome to the ASPNET newsgroup.

From your description, you're going to develop an ASP.NET (2.0?) web
application framework which will provide the sufficient flexiblity and
reusablity so that other vendors or users will be able to customize it
easily, correct?

Based on my experience, here are some of my understanding and suggestions:

1. ASP.NET 2.0 has naturally support visual inheritance through the
MasterPage feature. Master page is somewhat like a page template where we
can define some common UI elements(such as logo, banner, side navigation
bar, etc...). Then, other concrete pages in our web application can apply
this master page so that those common UI elements will be inherited from
the master page(note that the implementation of masterpage is not class
level inheritance in OO, but the "aggregation" model). In another word,
visual inheritance is not actual OO inheritance. Such visual inheritance
can make our web site's pages be consistent in UI, and easy to modify it
(we only need to modify the master page when necessary). However, for your
scenario, it won't be quite easy to be further reused after
precompilation.
2. To make the #1 abit more flexible, you can consider constructing the
master page UI through code dynamically, e.g. the logo, banner or
navigatino bars in the master page can be loaded at runtime(from other
separate ascx usercontrols).
3. If we want the most flexibility and reusability, we can also consider
defining a base page class completely from scratch, the base page class
will purely use code to programmatically construct the UI (from some
external template files or usercontrols). However, in this approach, we'll
lose the convenience provided by the built-in features in ASP.NET 2.0
(such
as master page). Also, generally speaking, the more we provide on
flexibility, the more we'll lose in performance.

Here are some web articles I've searched over internet some of which have
mentioned some of the approach I mentioned:

#Building Re-Usable ASP.NET User Control and Page Libraries with VS 2005
http://weblogs.asp.net/scottgu/archi...28/423888.aspx

#Master Your Site Design with Visual Inheritance and Page Templates
http://msdn.microsoft.com/msdnmag/is...20MasterPages/

#Creating Usable Page Templates in ASP.NET
http://www.devx.com/dotnet/Article/18011

#Creating Reusable Content in ASP.NET
http://www.informit.com/articles/art...?p=173411&rl=1

In addition, I suggest you also have a look at some well-know 3rd party
web
application framework such as the dotnetnuke. Maybe you can get some good
ideas from them.

Hope this helps some.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

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.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Jul 6 '06 #3
Thanks for your response Joe,

Yes, you're right, MasterPage can not provide the ability for binary level
reusability, but only provide us visual inheritance(make page UI
consistent) at development time.

Actually I did notice your requirement as below
==============
But our solution must be such that the 3rd party doesnt receive any source
code from us. Binaries only.
=============
in your first message. Thereforce I've mentioned that masterpage will not
quite work if you want to further reuse your webproject at binary
(precompiled) level and delivered to other vendors. If you have looked at
the following article I mentioend:

http://weblogs.asp.net/scottgu/archi...28/423888.aspx

You'll find scottgu(the ASP.NET team's pm) have pointed out a way to reuse
precompiled ascx usercontrols or aspx pages. Frankly speaking, IMO I still
do not quite recommend this because ASP.NET is not naturally designed for
such reusability (like other normal class libraries). And the approach
Scott mentioned is just a trick rely on the new ASP.NET 2.0's
precompilation and dynamic comilation model. Anyway, you can have a look to
see whether it can help for your scenario.

Further more, just like #3 in my last message, another means is design a
complete dynamic (pluggable ) page framework ourselves. A common approach
is partition page form into several sections and each section will
dynamically load the UI element at runtime(such as load ascx usercontrols).
Thus, we can precompiled our web application(framework) as binary, and the
end user can customize them by replace some of the UI fragments (ascx
usercontrols) as they want.

Hope this help clarify some further. Also, please feel free to post here
if you have any other ideas or consideration. And any feedback is welcome:-)

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

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.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 7 '06 #4
Hi Joe,

How are you doing on this issue? Have you got any further progress or does
my last reply helps a little? If there is anything else we can help, please
feel free to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

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.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 11 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Hemraj Julha | last post by:
Hi (Sorry if this appears twice but I posted this yersterday and I can't see it in the forum today) I'm trying "Visual Inheritance" in C# and facing an issue which might be related to my...
1
by: Hemraj Julha | last post by:
Hi I'm trying "Visual Inheritance" in C# and facing an issue which might be related to my ignorance about namespaces and location of the source code within the folders so I'll try to explain my...
3
by: Peter Cresswell | last post by:
Hi guys/gals, I'm using VS.net 2003 and having trouble with the following: I am trying to inherit a base class into a web form, but VS will then not allow me to add any ASP.NET controls using...
0
by: Frnak McKenney | last post by:
I'm running into problems with VisualStudio.NET2003 and Windows Forms inheritance. It _feels_ like a bug, but it could just as well be a misunderstanding on my part regarding how the VS Designer...
11
by: PAul Maskens | last post by:
The form designer adds unnecessary code to the section when using a subclassed control. I've reproduced this in VS.NET 2002 and VS.NET 2003 so it's pretty fundamental. Outline steps: Create a...
13
by: Just Me | last post by:
I have two forms. Each contains a property, say Prop. I do Public FormBeingUsed as Form .. .. .. Then I do FormBeingUsed= Form1 or maybe
4
by: Alan T | last post by:
How do I create a form inherited from an existing form in the same project ?
4
by: Mikus Sleiners | last post by:
I can't seem to add new controls to form that is inherited from another form. I have BaseForm wich have table layout on it 2 panelsm and some buttons. Now i create InheritedForm : BaseForm and...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
7
by: ademirzanetti | last post by:
Hi there !!! I would like to listen your opinions about inherit from a STL class like list. For example, do you think it is a good approach if I inherit from list to create something like...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.