Calling a class object in my aspx page without using codebehind


G

Gerald

Hi, can anyone please solve this problem?

My main page is :WebForm2.aspx
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm2.aspx.vb" Inherits="Transactions.WebForm2"%>
<%@ Import Namespace="System" %>
<%@ Import Namespace="ReportComponents" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
....
....
....
<script src="scripts.js"></script>
<script runat="server">

Protected _styleSheet As String

Private _IdNumber As String = "IdNumber"

Private Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
BindList()
End If

Private Sub BindList()
ClientList.DataSource = DrillDownReport.GetClients()
ClientList.DataBind()
End Sub
....
...
....


My Class is : DrillDownReport.vb
Namespace ReportComponents
Public Class DrillDownReport
Private _IdNumber As String
 
Ad

Advertisements

G

Guest

Gerald:

That's because you have not instantiated your object yet.

Try this:

Private myDrillDownReport as New DrillDownReport
Protected _styleSheet As String
Private _IdNumber As String = "IdNumber"

Private Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
BindList()
End If
End Sub

Private Sub BindList()
ClientList.DataSource = myDrillDownReport.GetClients()
ClientList.DataBind()
End Sub

Venki
 
Ad

Advertisements

G

Gerald

Hi Wenk,

I did exactly as you said and it gave this error:
Compiler Error Message: BC30002: Type 'DrillDownReport' is not defined
 

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

Top