Solved

Referencing a property on the Site.Master?

Posted on 2011-03-16
5
429 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
  • 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 500 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 500 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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