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 665287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:41:29+00:00 2026-05-13T23:41:29+00:00

I have a class includes.vb that holds some variables (sharing them with other pages)

  • 0

I have a class includes.vb that holds some variables (sharing them with other pages) like:

Public Shared pageid As Integer = 0

I then have a function that does some work with these variables returning them with values;

Return pageid

When I step through the code, the variables have values (while stepping through the function), but when they are returned to the page, they come back null.

Do they loose value everytime a page is loaded?
Can you suggest an alternative method?

Thanks a lot.

  • 1 1 Answer
  • 1 View
  • 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-13T23:41:30+00:00Added an answer on May 13, 2026 at 11:41 pm

    You should use probably Session variables.

    Session("PageID") = 0
    

    and access it every time you need.

    Not a best practice but if you want to be even stricter, you can use specific application variable for every session so that if the user returns after a day to the website, it still not lost (as long as you haven’t done an iisreset).

    To overcome iisreset will be an even bigger overkill, you can save the value to a file/DB and retrieve it everytime you want. (Please don’t do that!!)

    Maybe this can explain further:
    http://codeforeternity.com/blogs/technology/archive/2007/12/19/handling-asp-net-session-variables-efficiently.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that includes a std::list and wish to provide public begin()
I have a State class that includes configuration as well as some state-specific methods.
My problem: require_once '/includes/aws-sdk-1.5.2/sdk.class.php'; My environment: I have a pretty standard PHP site that
My understanding is that the PermGen (in some sense) holds the class code in
I have a simple class that includes 2 properties, one String and one a
So I have a model that includes: class Place(models.Model): .... created_by = models.ForeignKey(User) My
I have a simple reference counted class that holds a memory buffer. It looks
Support I have a Java Bean class that strictly holds instance fields: class College
I have a class that I want to include in a GWT module. Unfortunately,
I have a DAL class library that is included in my program as a

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.