Inherits multiple source?

T

tedqn

I've read quite a number of posts here and none seems to address my
situation..

Currently, I use this line to retrieve user's info, which will pretty
much be used in every single page that is password protected.
<%@Page Language="VB" Debug="true" Inherits="SessionVerify"
Src="/scriptfiles/SessionInfo.vb" %>

SessionInfo.vb contains the class SessionVerify which has the function
"Auth()" that I need to run in Page_Load of the parent page.

Now, I also plan to have another *.vb file that handles a particular
printable format rendering. How do in specify that so that I can call
both vb src pages and both Inherits ?

Seems like in order to accomplish this, I'd have to include the same
get session code info in every vb src that contain a specific set of
functionality? Is there a way to have a *.vb file reference another
*.vb file so that if I change something in the sessionverify code, I
don't have to update all other *.vb?
 
M

Marina Levit [MVP]

There is no multiple inheritence in .NET

If you have another class that some pages need to be inheriting from, then
have your printable rendering class inherit from SessionVerify, and then
have your page inherit from this new printable reading class. Pages that
don't need it can continue to use SessionVerify.

The other option is containment. Meaning, your page creates an instance of
the printable reading class (this class would not inherit Page), and calls
methods on this instance passing the appropriate arguments so this class can
correctly manipulate the page.
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top