[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2011-03-10
3
Medium Priority
?
245 Views
Last Modified: 2012-05-11
seems simple...all I want to do is have an 'include' file for a set of common code in my vbscript code behinds.
0
Comment
Question by:d2fox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 60

Expert Comment

by:HainKurt
ID: 35097850
include is over :)

use a shared class and put all your shared code here and use them whenever you want...
0
 
LVL 60

Accepted Solution

by:
HainKurt earned 2000 total points
ID: 35097904
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
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35097964
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question