Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 742421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:44:46+00:00 2026-05-14T08:44:46+00:00

Lets say I have a class like this in class1.vb: Public Class my_class Public

  • 0

Lets say I have a class like this in class1.vb:

Public Class my_class
  Public Sub my_sub()
   Dim myvar as String
   myvar = 10
   Session("myvar") = myvar
  End Sub
End Class

Then I have a ASP.NET page with a code-behind file, default.aspx and default.aspx.vb and I want to call my_class. I’m doing the following, but it doesn’t work:

Imports my_app.my_class
Partial Public Class _default
   Inherits System.Web.UI.Page
 Protected Sub Page_Load(ByVal sender as Object, ByVal e as System.EventArgs) Handles Me.Load
   my_class()
 End Sub
End Class

I get a “Reference to a non-shared member requires an object reference”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:44:47+00:00Added an answer on May 14, 2026 at 8:44 am
    Imports my_app.my_class
    Partial Public Class _default
       Inherits System.Web.UI.Page
     Protected Sub Page_Load(ByVal sender as Object, ByVal e as System.EventArgs) Handles Me.Load
           Dim myClass as new my_class()
        myClass.my_sub()
     End Sub
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have a class, which implements a generic interface public interface IItem
For simplicity's sake, lets say I have the following Abstract Base Controller Class: public
Simple question: Part of my repository looks like this public class CustomerRepository : IRepository<Customer>
I think my question is a long shot. Lets say I have an attribute:
Lets say I have three DropDownList controls in a web user control and they
Guys, I have got a slightly different problem with Java Dynamic class loading. I
I have a problem in my UserRepository in which I want to update a
I have been learning C# for the past few days for use with ASP.NET
My goal is very simple today, I am trying to work out the proper
I am new to the JNA infrastructure but I think that the gist is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.