How to share common code among pages in asp.net 2.0

J

just_life

My main .aspx page has a page directive as follows:

"<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Question3.aspx.vb"
Inherits="Question3" CodeFileBaseClass="BasePage" %>"

My App_Code folder has a file named Class1.vb whose contents are:

Imports Microsoft.VisualBasic
Imports System.IO
Imports System.Text
Imports System.Data.OracleClient
Imports System
Imports System.Data

Public Class BasePage Inherits System.Web.UI.Page
Public Shared Function TrimComplete(ByVal sValue As String) As String
Return TrimComplete
End Function
End Class

My codebehind file has the following:

Imports System.IO
Imports System.Text
Imports System.Data.OracleClient
Imports System
Imports System.Data

Partial Class Question3
Inherits BasePage

And I get the error: Parser Error Message: Could not load type 'BasePage'.

Please Help. Whar am I doing wrong?
 

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,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top