By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,795 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,795 IT Pros & Developers. It's quick & easy.

Not accessible ERROR!

P: n/a
Can someone please tell me why I'm getting the following error! I have
absolutely no idea why this error keeps appearing!

Thanks for any help!

Compiler Error Message: BC30390: 'cpncms_v1.evtCalendar.Private Sub
Calendar1_DayRender(sender As Object, e As
System.Web.UI.WebControls.DayRenderEventArgs)' is not accessible in this
context because it is 'Private'.

Source Error:

Line 56: <td class="pgContent">
Line 57: <!-- Start Calender -->
Line 58: <asp:calendar id="Calendar1" OnDayRender="Calendar1_DayRender"
OnSelectionChanged="Calendar1_SelectionChanged" 'error
Line 59:OnVisibleMonthChanged="MonthChanged" DayStyle-Height="100"
DayStyle-Width="75" DayStyle-HorizontalAlign="Left"
Line 60:DayStyle-verticalalign="Top" DayStyle-Font-Name="Arial"
DayStyle-Font-Size="12" NextPrevFormat="FullMonth"

...:: CODE
Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As
DayRenderEventArgs)
Dim Item As MyDates '//Temporary storage for looping through the
collection
Dim TextColor As String

Dim DayHold As DateTime = "01/01/1900" '//Temporary date to check
for multiple items per day

Dim MultipleItemDay As Boolean = False

'// Set to true if the date is in the collection and needs to be
displayed
Dim DayTextHasChanged As Boolean = False

'//To build the string for the contents of the table cell
'//I'll use the stingbuilder class instead of concatenation
Dim temp As StringBuilder

If IsNothing(MyCollection) = True Then
Get_DBItems()
End If

For Each Item In MyCollection
'//The collection is loaded in date order. So, if the date is
different than the DayHold variable
'//And I've already found the right day in the collection, I can
exit the for loop
If DayHold <> Item._Date Then
If DayTextHasChanged = True Then
Exit For
End If
MultipleItemDay = False
DayHold = Item._Date
Else
MultipleItemDay = True
End If

'//If I've found a date matching the current date...I need to
create the appropriate text
If e.Day.Date = Item._Date.ToString("d") Then
Select Case Item._Type
Case 1 : TextColor = "Blue"
Case 2 : TextColor = "Red"
Case 3 : TextColor = "Orange"
Case 4 : TextColor = "Green"
Case 5 : TextColor = "Brown"
Case 6 : TextColor = "Gray"
Case 7 : TextColor = "#408080"
Case Else : TextColor = "Black"
End Select
If MultipleItemDay = False Then
temp = New StringBuilder '//Create a new stringbuilder
object
Else
temp.Append("<br>") '//add a seperator to the
stringbuilder
End If
temp.Append("<span style=""font-family:Arial;
font-weight:bold;font-size:12px; color:")
temp.Append(TextColor)
temp.Append("""><br>")
temp.Append(Item._Title.ToString())
temp.Append("</span>")
DayTextHasChanged = True '//Set the flag
End If
Next

'//If there was an Item for this day, add the stringbuilder text to
the table cell
If DayTextHasChanged = True Then
e.Cell.Controls.Add(New LiteralControl(temp.ToString()))
End If

End Sub
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
What happens if you change Private to Public?

"Tim::.." <myatix_at_hotmail.com> wrote in message
news:84**********************************@microsof t.com...
Can someone please tell me why I'm getting the following error! I have
absolutely no idea why this error keeps appearing!

Thanks for any help!

Compiler Error Message: BC30390: 'cpncms_v1.evtCalendar.Private Sub
Calendar1_DayRender(sender As Object, e As
System.Web.UI.WebControls.DayRenderEventArgs)' is not accessible in this
context because it is 'Private'.

Source Error:

Line 56: <td class="pgContent">
Line 57: <!-- Start Calender -->
Line 58: <asp:calendar id="Calendar1" OnDayRender="Calendar1_DayRender"
OnSelectionChanged="Calendar1_SelectionChanged" 'error
Line 59:OnVisibleMonthChanged="MonthChanged" DayStyle-Height="100"
DayStyle-Width="75" DayStyle-HorizontalAlign="Left"
Line 60:DayStyle-verticalalign="Top" DayStyle-Font-Name="Arial"
DayStyle-Font-Size="12" NextPrevFormat="FullMonth"

..:: CODE
Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As
DayRenderEventArgs)
Dim Item As MyDates '//Temporary storage for looping through the
collection
Dim TextColor As String

Dim DayHold As DateTime = "01/01/1900" '//Temporary date to check
for multiple items per day

Dim MultipleItemDay As Boolean = False

'// Set to true if the date is in the collection and needs to be
displayed
Dim DayTextHasChanged As Boolean = False

'//To build the string for the contents of the table cell
'//I'll use the stingbuilder class instead of concatenation
Dim temp As StringBuilder

If IsNothing(MyCollection) = True Then
Get_DBItems()
End If

For Each Item In MyCollection
'//The collection is loaded in date order. So, if the date is
different than the DayHold variable
'//And I've already found the right day in the collection, I
can
exit the for loop
If DayHold <> Item._Date Then
If DayTextHasChanged = True Then
Exit For
End If
MultipleItemDay = False
DayHold = Item._Date
Else
MultipleItemDay = True
End If

'//If I've found a date matching the current date...I need to
create the appropriate text
If e.Day.Date = Item._Date.ToString("d") Then
Select Case Item._Type
Case 1 : TextColor = "Blue"
Case 2 : TextColor = "Red"
Case 3 : TextColor = "Orange"
Case 4 : TextColor = "Green"
Case 5 : TextColor = "Brown"
Case 6 : TextColor = "Gray"
Case 7 : TextColor = "#408080"
Case Else : TextColor = "Black"
End Select
If MultipleItemDay = False Then
temp = New StringBuilder '//Create a new
stringbuilder
object
Else
temp.Append("<br>") '//add a seperator to the
stringbuilder
End If
temp.Append("<span style=""font-family:Arial;
font-weight:bold;font-size:12px; color:")
temp.Append(TextColor)
temp.Append("""><br>")
temp.Append(Item._Title.ToString())
temp.Append("</span>")
DayTextHasChanged = True '//Set the flag
End If
Next

'//If there was an Item for this day, add the stringbuilder text to
the table cell
If DayTextHasChanged = True Then
e.Cell.Controls.Add(New LiteralControl(temp.ToString()))
End If

End Sub


Nov 18 '05 #2

P: n/a
I din't slog through all the code you posted, but I can tell you this: That
error occurs when a private member of a class is referenced outside the
class. Private members are not accessible by other classes, nor by inherited
classes.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Tim::.." <myatix_at_hotmail.com> wrote in message
news:84**********************************@microsof t.com...
Can someone please tell me why I'm getting the following error! I have
absolutely no idea why this error keeps appearing!

Thanks for any help!

Compiler Error Message: BC30390: 'cpncms_v1.evtCalendar.Private Sub
Calendar1_DayRender(sender As Object, e As
System.Web.UI.WebControls.DayRenderEventArgs)' is not accessible in this
context because it is 'Private'.

Source Error:

Line 56: <td class="pgContent">
Line 57: <!-- Start Calender -->
Line 58: <asp:calendar id="Calendar1" OnDayRender="Calendar1_DayRender"
OnSelectionChanged="Calendar1_SelectionChanged" 'error
Line 59:OnVisibleMonthChanged="MonthChanged" DayStyle-Height="100"
DayStyle-Width="75" DayStyle-HorizontalAlign="Left"
Line 60:DayStyle-verticalalign="Top" DayStyle-Font-Name="Arial"
DayStyle-Font-Size="12" NextPrevFormat="FullMonth"

..:: CODE
Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As
DayRenderEventArgs)
Dim Item As MyDates '//Temporary storage for looping through the
collection
Dim TextColor As String

Dim DayHold As DateTime = "01/01/1900" '//Temporary date to check
for multiple items per day

Dim MultipleItemDay As Boolean = False

'// Set to true if the date is in the collection and needs to be
displayed
Dim DayTextHasChanged As Boolean = False

'//To build the string for the contents of the table cell
'//I'll use the stingbuilder class instead of concatenation
Dim temp As StringBuilder

If IsNothing(MyCollection) = True Then
Get_DBItems()
End If

For Each Item In MyCollection
'//The collection is loaded in date order. So, if the date is
different than the DayHold variable
'//And I've already found the right day in the collection, I can exit the for loop
If DayHold <> Item._Date Then
If DayTextHasChanged = True Then
Exit For
End If
MultipleItemDay = False
DayHold = Item._Date
Else
MultipleItemDay = True
End If

'//If I've found a date matching the current date...I need to
create the appropriate text
If e.Day.Date = Item._Date.ToString("d") Then
Select Case Item._Type
Case 1 : TextColor = "Blue"
Case 2 : TextColor = "Red"
Case 3 : TextColor = "Orange"
Case 4 : TextColor = "Green"
Case 5 : TextColor = "Brown"
Case 6 : TextColor = "Gray"
Case 7 : TextColor = "#408080"
Case Else : TextColor = "Black"
End Select
If MultipleItemDay = False Then
temp = New StringBuilder '//Create a new stringbuilder object
Else
temp.Append("<br>") '//add a seperator to the
stringbuilder
End If
temp.Append("<span style=""font-family:Arial;
font-weight:bold;font-size:12px; color:")
temp.Append(TextColor)
temp.Append("""><br>")
temp.Append(Item._Title.ToString())
temp.Append("</span>")
DayTextHasChanged = True '//Set the flag
End If
Next

'//If there was an Item for this day, add the stringbuilder text to the table cell
If DayTextHasChanged = True Then
e.Cell.Controls.Add(New LiteralControl(temp.ToString()))
End If

End Sub

Nov 18 '05 #3

P: n/a

Try redeclaring the Calendar1_DayRender procedure as

Public

eg.

Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As
DayRenderEventArgs)

should read

Public Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As
DayRenderEventArgs
-
spaldin
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.