Web Forsms Inheritance

G

Gandalf

If there way to inherits a web form?

i want to do a Web form that is my base web forms for all
my applications
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi Marco,

If you mean inheriting code behind, this is easy. You can inherit the code
behind class for any Web form from any class directly or indirectly derived
from System.Web.Page. As for inheriting the aspx page itself (I mean all the
HTML and controls), this is much harder. I have seen articles on the net
that explain how to tap into the Render method to add custom HTML code
before and after the page contents, but the solutions suggested I believe do
not suit particular needs you might have.

Still, please do not take my reply as something "final" - I might be just
unaware of a better solution and would like to find out about it myself.
What I did once was putting page blocks into reusable ASCX controls and then
ASPX code duplication for each page would be relatively small.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top