Solved

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

Posted on 2015-02-05
2
540 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
[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
2 Comments
 
LVL 36

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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

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…
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 …
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

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