Hello,
On page 52 (pg 40 in print PDF) "Context Menus", I'm doing the lesson on pages 53 - 55, however the context menu does not expand to show all the various options as shown on page 55.
I copied and pasted the code in my project, but I kept getting a compilation error targeting "Imports Telerik.Web.UI (in red):
"Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl)."
Once I deleted the "Namespace Multipage" keyword structure. I don't understand why I was getting a compilation error just by using the namespace. ???
Here is the code per the lesson (as well as in my project):
On page 52 (pg 40 in print PDF) "Context Menus", I'm doing the lesson on pages 53 - 55, however the context menu does not expand to show all the various options as shown on page 55.
I copied and pasted the code in my project, but I kept getting a compilation error targeting "Imports Telerik.Web.UI (in red):
"Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl)."
Once I deleted the "Namespace Multipage" keyword structure. I don't understand why I was getting a compilation error just by using the namespace. ???
Here is the code per the lesson (as well as in my project):
Protected Sub RadContextMenu1_ItemClick(ByVal sender As Object, ByVal e As |
Telerik.Web.UI.RadMenuEventArgs) |
' look only at child items |
If e.Item.Level = 1 Then |
' find child items under "Colors" parent item |
If (TryCast(e.Item.Parent, RadMenuItem)).Text.Equals("Colors") Then |
' set the color picker preset to the selected preset |
RadColorPicker1.Preset = DirectCast([Enum].Parse(GetType(ColorPreset), e.Item.Text), |
ColorPreset) |
End If |
End If |
End Sub |
End Class |
So my two questions would be:
1. Why is deleting the "Namespace" keyword eliminating the compilation error? I thought creating and using Namespaces is a way to
"package" classes. Thus, making them more unique.
2. Why is the RadContextMenu control working correctly in my application for the RadColorPicker control? (All I see when I right-click is the word "Color". No subitems as shown on page 43.
Thanks,
R2