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?
Larry Bristersr. DeveloperAsked:
Who is Participating?
 
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
 
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
 
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.

All Courses

From novice to tech pro — start learning today.