Solved

Load control once from MasterPage

Posted on 2010-09-24
4
342 Views
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
        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
Comment
Question by:lrbrister
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:Jens Fiederer
Comment Utility
You could set a session variable.

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

Author Comment

by:lrbrister
Comment Utility
jensfiederer:
What appropriate page?  There are 40+ possible pages.
0
 
LVL 23

Accepted Solution

by:
Jens Fiederer earned 500 total points
Comment Utility
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
 

Author Closing Comment

by:lrbrister
Comment Utility
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

14 Experts available now in Live!

Get 1:1 Help Now