我想为我的菜单添加图像`item.Image.Url ="〜/ Images / BO_Users_Large.png&#34 ;;
什么时候可以创建文件夹图像并放置图像BO_Users_Large.png
这是菜单的代码:
@Html.DevExpress().Menu(settings => {
settings.Name = "HeaderMenu";
settings.ItemAutoWidth = false;
settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
settings.Styles.Style.Paddings.Padding = System.Web.UI.WebControls.Unit.Pixel(0);
settings.Items.Add("Client");
settings.Items.Add(item =>
{
item.Items.Add("Liste des clients").NavigateUrl = DevExpressHelper.GetUrl(new { Controller = "Client", Action = "ListeClients" });
item.Items.Add("Ajouter Nouveau client").NavigateUrl = DevExpressHelper.GetUrl(new { Controller = "Client", Action = "Ajouter" });
item.Text = "Client";
item.Image.Url = "~/Images/BO_Users_Large.png";
});
settings.Items.Add(item =>
{
item.Text = "Home";
item.Image.Url = "~/Images/ButtonHome.png";
item.Items.Add("News");
item.Items.Add("Contact Us");
}).GetHtml()
答案 0 :(得分:0)
将您的图片放入文件夹内容或在项目中创建另一个文件夹并输入以下代码:
settings.Items.Add(item =>
{
item.Text = "Commande";
item.Image.Url = "~/content/BO_Reports_Large.png";
});