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

Discussion in 'ASP .Net' started by just_life, Aug 1, 2007.

  1. just_life

    just_life Guest

    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?
    just_life, Aug 1, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Garth17
    Replies:
    3
    Views:
    3,030
    Brock Allen
    Mar 18, 2005
  2. MK
    Replies:
    6
    Views:
    688
    noSpAm0000
    May 16, 2005
  3. K Gibbs
    Replies:
    1
    Views:
    345
    MiniDisc_2k2
    Jul 3, 2003
  4. mase
    Replies:
    11
    Views:
    1,220
    Michael Nemtsev
    Jul 4, 2007
  5. Saraswati lakki
    Replies:
    0
    Views:
    1,322
    Saraswati lakki
    Jan 6, 2012
Loading...

Share This Page