?
Solved

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

Posted on 2015-02-05
2
Medium Priority
?
565 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 2000 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

770 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