Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 337125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:18:23+00:00 2026-05-12T10:18:23+00:00

In my default.aspx page, I have some ESRI tools (and some commands) in a

  • 0

In my default.aspx page, I have some ESRI tools (and some commands) in a toolbar, so something like this.

<ToolbarItems>
    <esri:Tool ClientAction="MapPoint('Map1','%toolbarItem%',false,'crosshair') DefaultImage="~/images/default_tool.gif" 
    EnablePostBack="True" JavaScriptFile="" Name="TestTool" SelectedImage="~/images/selected_tool.gif" DisabledImage="~/images/disabled_tool.gif"
    ServerActionAssembly="Test.Web.Mapping" ServerActionClass="Test.Web.Mapping.TestTool"
    Text="It's a tool!" ToolTip="Use it." />
</ToolbarItems>

Now, I have some code which is used to disable the tool, effectively changing it’s image. The code basically loops over the toolbar to find the tool that needs to be disabled and does it’s deed.

After the code runs, everything works beautifully. The proper tool has been disabled and the image has changed accordingly.

The problem is, if I select, say, the magnify tool, the image for the tool which I just disabled immediately changes back to the default image.

It seems like there must be some block of Javascript running somewhere that resets the state of all tools to there defaults as defined in the Default.aspx page. I’m having trouble finding it though. Any ideas?

EDIT: The code for disabling the button is C# code that is something like the following…

foreach (InteractiveImageToolbarItem toolbarTool in toolbar.ToolbarItems)
{
    // First check to see if the dictionary even contains the tool, if not we assume the tool is enabled for all themes, so enable it and
    // move to the next iteration.
    if (!enabledTools.Keys.Contains(toolbarTool.Name))
    {
        toolbarTool.Disabled = false;
        continue;
    }

    // So the tool is in the list, this loop checks to see if the tool is enabled for the current theme, meaning the theme is in the list
    // associated with the tool.
    foreach (string themeFromConfig in enabledTools[toolbarTool.Name])
    {
        if (currentTheme != themeFromConfig)
        {
            toolbarTool.Disabled = true;
        }
        else
        {
            toolbarTool.Disabled = false;
            break;
        }
    }
} 

It can see what should be enabled by looking at config values. Once again I’ll mention, this part works fine.

Update 9/3/09: Ok, so I think I know what the problem is. In the Web ADF the method that gets called, ToolbarMouseDown, has a call at the end of it…

Toolbars[toolbarName].refreshGroup();

If a tool is clicked in any toolbar that is part of the same group as my toolbar, the image will be reset. I’m not sure I get the logic behind it, it makes it impossible to disable tools or change there images and have it persist. Whatever…

Anyway, this is all on the Javascript side of things, is there any way that I can tell when that refreshGroup call has been made or something? What I think needs to happen is when the image is reset to being enabled I need to immediately set it back to being disabled.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:18:24+00:00Added an answer on May 12, 2026 at 10:18 am

    When WebADF controls render to the page, they reference the ADF javascript libraries. It’s quite possible that there is something in the default library that is overwriting your image settings.

    I would suggest using Firebug to add a javascript breakpoint to the onclick function of one of your tools, and stepping through the WebADF javascript and seeing what is happening.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have something like this: <%If (Request.Url.ToString = default.aspx) Then %> <li><a href=url>Link</a></li>
on some of my aspx page I am checking session like this if (bool.Parse(Session[YourAssessment].ToString())
In my aspx page I have a tr which is set visible=false by default.
In my .aspx page I have; <%@ Page Language=VB AutoEventWireup=false CodeFile=Default.aspx.vb Inherits=_Default AspCompat=True %>
I have an ASPX Page: <%@ Page Language=C# MasterPageFile=~/site.Master AutoEventWireup=true CodeBehind=Default.aspx.cs Inherits=myProject.Presentation.Web.Default src=Default.aspx.cs %>
I have an ASP.Net Page, aspx with its default form. I have a Submit
I have GridView on my page: <%@ Page Language=C# AutoEventWireup=true CodeFile=Default.aspx.cs Inherits=_Default %> <!DOCTYPE
I'm trying to analyze some running times for various methods in my default.aspx.cs page.
I have a default.aspx page that needs to be refresh every 10 sec. My
I'm using VS 2010, vb.net and asp 3.5. I have a simple default.aspx page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.