Solved

Error: "is not declared. It may be inaccessible due to its protection level."

Posted on 2015-02-05
2
445 Views
Last Modified: 2015-02-05
There is a 3rd-party calendar up and working on the web site.  The name of the page is EventsCalendar.aspx.vb.  See code below.

I copied the code and pasted it into another page named Daily_Living.aspx.vb, made the necessary changes, but get the error message "hlEditCalendar' is not declared. It may be inaccessible due to its protection level."  I must have overlooked something.

EventsCalendar.aspx.vb

Imports DHTMLX.Scheduler
Imports DHTMLX.Scheduler.Controls
Public Class EventsCalendar
    Inherits System.Web.UI.Page
    Public Scheduler As DHXScheduler

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Scheduler = New DHXScheduler
        'Scheduler.InitialDate = New DateTime(2011, 11, 24)
        Scheduler.Config.first_hour = 8
        Scheduler.Config.last_hour = 19
        Scheduler.Config.time_step = 30
        Scheduler.Config.isReadonly = True
        Scheduler.Config.limit_time_select = True
        Scheduler.DataAction = Me.ResolveUrl("~/Data.ashx")
        Scheduler.SaveAction = Me.ResolveUrl("~/Save.ashx")
        Scheduler.LoadData = True
        Scheduler.EnableDataprocessor = True

        If (Context.User.Identity.IsAuthenticated) Then
            hlEditCalendar.Visible = True

        Else
            hlEditCalendar.Visible = False
        End If


    End Sub
End Class

Open in new window


EventsCalendar.aspx

<%@ Page Title="Event Calendar" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EventsCalendar.aspx.vb" Inherits="EventsCalendar" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">
<br />
     <div class="Colored-background" >
        <div style="height:700px; width: 100%; margin-top:50px;">
            <%= Me.Scheduler.Render() %>
            <asp:HyperLink runat="server" ID="hlEditCalendar" NavigateUrl="~/EditCalendar">Edit Calendar</asp:HyperLink>
        </div>
    </div>
    
</asp:Content>

Open in new window


Daily_Living.aspx.vb

Imports DHTMLX.Scheduler
Imports DHTMLX.Scheduler.Controls
Public Class Daily_Living
    Inherits System.Web.UI.Page
    Public Scheduler As DHXScheduler

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Scheduler = New DHXScheduler
        'Scheduler.InitialDate = New DateTime(2011, 11, 24)
        Scheduler.Config.first_hour = 8
        Scheduler.Config.last_hour = 19
        Scheduler.Config.time_step = 30
        Scheduler.Config.isReadonly = True
        Scheduler.Config.limit_time_select = True
        Scheduler.DataAction = Me.ResolveUrl("~/Data.ashx")
        Scheduler.SaveAction = Me.ResolveUrl("~/Save.ashx")
        Scheduler.LoadData = True
        Scheduler.EnableDataprocessor = True

        If (Context.User.Identity.IsAuthenticated) Then
            hlEditCalendar.Visible = True  <---------------------- ERROR

        Else
            hlEditCalendar.Visible = False  <---------------------- ERROR
        End If


    End Sub
End Class

Open in new window


Daily_Living.aspx

<%@ Page Title="Daily Living" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Daily_Living.aspx.vb" Inherits="Daily_Living" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <%--<img src="images/willow-tree.jpg" id="bg" alt="" style="z-index: -1">--%>
    <br />
    <div class="Colored-background" >
        <div style="height:700px; width: 100%; margin-top:50px;">
            <%= Me.Scheduler.Render() %>
            <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="~/EditCalendar">Edit Calendar</asp:HyperLink>
        </div>
    </div>
</asp:Content>

Open in new window

0
Comment
Question by:rrhandle8
2 Comments
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 40592607
hlEditCalendar does not exist in your Daily_Living.aspx mark-up:
Replace ID in your current page: (HyperLink1)
 <asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="~/EditCalendar">Edit Calendar</asp:HyperLink>

Open in new window


with: (hlEditCalendar)
 <asp:HyperLink runat="server" ID="hlEditCalendar" NavigateUrl="~/EditCalendar">Edit Calendar</asp:HyperLink>

Open in new window

0
 

Author Closing Comment

by:rrhandle8
ID: 40592641
Thanks for the second set of eyes.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
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: …

759 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

19 Experts available now in Live!

Get 1:1 Help Now