Load control once from MasterPage

Posted on 2010-09-24
Last Modified: 2013-11-26
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
            RadToolTip2.Enabled = True
            _intro = True
        End If


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

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

Any ideas?
Question by:lrbrister
  • 2
  • 2
LVL 23

Expert Comment

by:Jens Fiederer
ID: 33756080
You could set a session variable.

Or you could put the code into the appropriate page, rather than the shared master page.

Author Comment

ID: 33756306
What appropriate page?  There are 40+ possible pages.
LVL 23

Accepted Solution

Jens Fiederer earned 500 total points
ID: 33756378
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).


If Session("_intro") = True Then
            RadToolTip2.Enabled = False
            RadToolTip2.Enabled = True
            Session("_intro") = True
        End If

Author Closing Comment

ID: 33756450

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now