TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Cassie Mod
NA
488
70.5k
how to create a submenu under Extra
Oct 17 2017 6:02 AM
HI ive got the following question, now we have a menu bar above the page containing a vew items. Underneeth extra i need a submenu item. How can i realize that ? here are some part the codes.
public
class
PortalMenuItemList: List<PortalMenuItem>
{
private
PortalMenuItem _Owner =
null
;
public
PortalMenuItemList(PortalMenuItem menuItem)
{
_Owner = menuItem;
}
public
new
void
Add(PortalMenuItem menuItem)
{
if
(menuItem.Parent!=
null
)
menuItem.Parent.Children.Remove(menuItem);
base
.Add(menuItem);
menuItem.Parent =
this
._Owner;
}
/*
public PortalMenuItem GetCommandByName(string commandName)
{
foreach(PortalCommand command in this)
{
PortalCommand temp = command.GetCommandByName(commandName);
if (temp != null)
return temp;
}
return null;
}*/
}
}
public
class
PortalMenuItem
{
public
string
Target;
private
PortalMenuItemList _Children;
public
PortalMenuItem()
{
Visible =
true
;
_Children =
new
PortalMenuItemList(
this
);
}
public
string
Title {
get
;
set
; }
public
PortalMenuItem Parent {
get
;
set
; }
public
string
Command {
get
;
set
; }
public
string
Class {
get
;
set
; }
public
bool
Visible {
get
;
set
; }
public
Dictionary<
string
,
string
> CommandArguments {
get
;
set
; }
public
PortalMenuItemList Children {
get
{
return
_Children; } }
}
public
override
void
InitMenu()
{
if
(UserLoggedIn)
{
var features =
new
Features(User);
switch
(User.loginType)
{
case
UserLoginType.User:
AddMenuItem(
new
PortalMenuItem
{
Command = ApplicationCommands.UserPhoneManagement,
Title =
"Mijn Toestel"
,
Class =
"phone"
,
Visible = (features.CallingDeliveryBlock || features.DoNotDisturb || features.CallForwardingAlways),
CommandArguments =
new
Dictionary<string, string>
{
{
"userId"
, User.username}
}
});
AddMenuItem(
new
PortalMenuItem
{
Command = ApplicationCommands.ReceptionistView,
Title =
"Receptionist"
,
Class =
"contacts"
,
Visible = features.Receptionist && (AuthorizeUser(User.username, null, ServicePacks.DeanReceptionistEnterprise) || AuthorizeUser(User.username, null, ServicePacks.DeanReceptionistSmallBusiness)),
Target =
"_blank"
});
AddMenuItem(
new
PortalMenuItem
{
Command = ApplicationCommands.HelpPage,
Title =
"Help"
,
Class =
"help"
,
Visible =
true
});
break
;
case
UserLoginType.Group:
case
UserLoginType.Partner:
case
UserLoginType.DeanOne:
AddMenuItem(
new
PortalMenuItem
{
Command = ApplicationCommands.UsersView,
Title =
"Gebruikers"
,
Class =
"phone"
,
Visible = features.ReadUsers
});
AddMenuItem(
new
PortalMenuItem
{
Command = ApplicationCommands.AutoAttendantsView,
Title =
"Keuzemenu"
,
Class =
"help"
,
Visible = features.AutoAttendentBasic
});
AddMenuItem(
new
PortalMenuItem
{
Command = ApplicationCommands.ExtraSettings,
Title =
"Extra"
,
Class =
"balloon"
,
});
break
;
}
}
}
// Topmenu.aspx
<%@ Control Language=
"C#"
AutoEventWireup=
"true"
CodeBehind=
"TopMenu.ascx.cs"
Inherits=
"OneXS.Orion.FrontOffice.Compleet.Portal.Controls.Topmenu"
%>
<%@ Import Namespace=
"OneXS.Orion.FrontOffice.Compleet.PortalBase"
%>
<%
if
(Repeater1.Items.Count != 0)
{%>
<div id=
"main_menu_wrap"
>
<div
class
=
"main_menu"
>
<ul>
<asp:Repeater ID=
"Repeater1"
runat=
"server"
EnableViewState=
"false"
>
<ItemTemplate>
<asp:PlaceHolder ID=
"PlaceHolder1"
runat=
"server"
Visible=
"<%# (Container.DataItem as PortalMenuItem).Visible %>"
>
<li
class
=
"<%# ComputeCssClass(Container.DataItem as PortalMenuItem) %>"
>
<a href=
"<%#ComputeMenuitemDocumentUrl(Container.DataItem as PortalMenuItem)%>"
title=
"<%#(Container.DataItem as PortalMenuItem).Title %>"
target=
"<%#(Container.DataItem as PortalMenuItem).Target %>"
>
<span
class
=
"icon icon-24 <%#(Container.DataItem as PortalMenuItem).Class %>"
></span>
<span
class
=
"label"
><%# ComputeMenuItemTitle(Container.DataItem as PortalMenuItem)%></span></a></li>
</asp:PlaceHolder>
</ItemTemplate>
</asp:Repeater>
</ul>
</div>
</div>
<% } %>
Reply
Answers (
1
)
How implement Authentication in mvc
How to learn MVC framework in asp.net