Solved

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

Posted on 2015-02-05
2
478 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

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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 …

773 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