Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

Load control once from MasterPage

I have a site that we allow peopel to set their own home page

All pages use a single Master file

In the MasterPage VB code I've declared a Protected Variable at the top
Partial Class MasterPagePep
    Inherits System.Web.UI.MasterPage
    Public _intro As Boolean

In the Page_Load event I have this...
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

        If _intro = True Then
            RadToolTip2.Enabled = False
        Else
            RadToolTip2.Enabled = True
            RadToolTip2.Show()
            _intro = True
        End If

etc...

However... the Tooltip shows every page I go to.

I just want it to load one time on the web site loading.

Any ideas?
0
Larry Brister
Asked:
Larry Brister
  • 2
  • 2
1 Solution
 
Jens FiedererTest Developer/ValidatorCommented:
You could set a session variable.

Or you could put the code into the appropriate page, rather than the shared master page.
0
 
Larry Bristersr. DeveloperAuthor Commented:
jensfiederer:
What appropriate page?  There are 40+ possible pages.
0
 
Jens FiedererTest Developer/ValidatorCommented:
If the 1st page the user comes to is always the same, as it is in many apps, set it on that one.

If the 1st page could be any of the 40+ possible pages, use a session variable rather than a variable on the page (these don't get saved between trips).


Example:

If Session("_intro") = True Then
            RadToolTip2.Enabled = False
        Else
            RadToolTip2.Enabled = True
            RadToolTip2.Show()
            Session("_intro") = True
        End If
0
 
Larry Bristersr. DeveloperAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now