how do I use an include file in vb code behind in asp.net

seems simple...all I want to do is have an 'include' file for a set of common code in my vbscript code behinds.
d2foxAsked:
Who is Participating?
 
HainKurtSr. System AnalystCommented:
or create a base page and put all your shared code into this base page
then all your web pages will inherit from this base, so they can use the sahred codes...

right now you are inheriting them from

    Inherits System.Web.UI.Page

see sample code
Partial Class myBasePage
    Inherits System.Web.UI.Page

    public function f1()...
    public sub s1()...
End Class

Partial Class Page1
    Inherits myBasePage
...
End Class

Partial Class Page2
    Inherits myBasePage
...
End Class

Open in new window

0
 
HainKurtSr. System AnalystCommented:
include is over :)

use a shared class and put all your shared code here and use them whenever you want...
0
 
Paul JacksonSoftware EngineerCommented:
Was going to comment but then noticed you have already been given the perfect answer.
Shared Classes are the way to go.
If you do decide to go for the basepage option just an addition to Hain Kurt's excellent answer is that your basepage.vb file would go in your web sites app_code folder at the root of the website as putting it in here will mean it gets precompiled.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.