The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientNavBarItem.SetImageUrl(value) Method

Specifies the URL which points to the image displayed within the item.


SetImageUrl(value: string): void


Name Type Description
value string

A string value that specifies the URL to the image displayed within the item.


All graphic file formats which can be interpreted by internet browsers are supported. The image's URL can represent either an absolute or relative path.


If a navigation bar item image is not initialized on the server side (the item's NavBarItem.Image.Url and control's ASPxNavBar.ItemImage.Url properties are not specified), the corresponding DOM element is not created. In this case, the SetImageUrl property is not in effect.


This example demonstrates how specific item characteristics (the text, visibility, availability to end-users, checked state) of a control (the ASPxMenu in this case) can be changed on the client side using available JavaScript methods.

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="DevExpress.Web.v8.3" Namespace="DevExpress.Web.ASPxMenu" 
TagPrefix="dxm" %>
<%@ Register Assembly="DevExpress.Web.v8.3" Namespace="DevExpress.Web.ASPxEditors" 
TagPrefix="dxe" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

<script runat="server">

<html xmlns="" >
 <head id="Head1" runat="server">
     <title>Client methods that affect an item's visibility, 
    text, navigation location and associated image</title>
     <form id="form2" runat="server">
         <table border="0" cellpadding="2" cellspacing="0"><tr>
             <td><dxe:ASPxCheckBox ID="cbVisible" Checked="True" runat="server" Text="Visible">
                 <ClientSideEvents CheckedChanged="function(s, e) {
 }" />
             <td><dxe:ASPxCheckBox ID="cbEnabled" Checked="True" runat="server" Text="Enabled">
                 <ClientSideEvents CheckedChanged="function(s, e) {
 }" />
             <td><dxe:ASPxCheckBox ID="cbChecked" Checked="False" runat="server" Text="Checked">
                 <ClientSideEvents CheckedChanged="function(s, e) {
 }" />
             <td><dxe:ASPxButton ID="bText" runat="server" Text="SetText()" AutoPostBack="False">
                 <ClientSideEvents Click="function(s, e) {
    myMenu.GetItem(0).SetText('Text is changed');
 }" />
             <td><dxe:ASPxButton ID="bNavigateUrl" runat="server" 
            Text="SetNavigateUrl()" AutoPostBack="False">
                 <ClientSideEvents Click="function(s, e) {
 }" />
             <td><dxe:ASPxButton ID="bImageUrl" runat="server" 
            Text="SetImageUrl()" AutoPostBack="False">
                 <ClientSideEvents Click="function(s, e) {
 }" />
         <dxm:ASPxMenu ID="ASPxMenu1" runat="server" ClientInstanceName="myMenu" 
                 <dxm:MenuItem Text="Menu Item" GroupName="SingleGroup" 
                     <Image Url="Images/User.gif" 
                    UrlDisabled="../Images/Images/UserDisabled.gif" />
                 <dxm:MenuItem Text="Menu Item">
                     <Image Url="Images/User.gif" />
See Also