Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Referencing a property on the Site.Master?

Posted on 2011-03-16
5
Medium Priority
?
435 Views
Last Modified: 2012-05-11
I have added this line to my .aspx page:

MasterPageFile="~/Site.master"

Here is the start of the Site.Master.cs file:

    public partial class Site : System.Web.UI.MasterPage
    {
        public RDDBAdminDataStore RDDB { get; set; }

I get these squiggly lines in the Site.Master with the following error:
The name 'RDDB' does not exist in the current context.

When I compile, they go away, then shortly return.

Any idea what's wrong??

newbieweb
0
Comment
Question by:newbieweb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:newbieweb
ID: 35151685
Header:

<%@ Page Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="TableList.aspx.cs" Inherits="RDDBWebAdmin.TableList" %>
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 35151718
You either need to case "this.Master" to Site, as in:

RDDBAdminDataStore myVar = ((Site)this.Master).RDDB

Open in new window


or you can include the following directive in your content page:

<%@ MasterType TypeName="Nampespace.Site" %>

Open in new window



Then in code, you won't have to do the cast:

RDDBAdminDataStore myVar = this.Master.RDDB

Open in new window

0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 2000 total points
ID: 35151721
>>  You either need to case...

*cast
0
 

Author Closing Comment

by:newbieweb
ID: 35152002
Thanks!
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 35152050
NP. Glad to help  :  )
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

705 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