BreadCrumbExtender
It hooked up on label and create from it ajax style breadCrumb
Using
  • web.config
<?xml version="1.0"?>
    <configuration>
        <system.web>
            <pages>
	        <controls>
			<add tagPrefix="asp" namespace="AjaxControlToolkit" assembly="ControlToolkitExtended"/>
		</controls>
	    </pages>
        </system.web>
    </configuration>
  • asp.net page
<asp:Panel ID="nPathHolder" runat="server">
    <asp:LinkButton ID="nGUPathLink" runat="server" Text="Україна" />
</asp:Panel>
<asp:BreadCrumbExtender id="nGUPathEx" runat="server"
      ServicePath="~/WebServices/GeographicUnitsWS.asmx" 
      ServiceMethod="GetPath"
      TargetControlID="nGUPathLink" 
      CompletionListItemCssClass ="BreadcrumbItem"
      CompletionListHighlightedItemCssClass="BreadcrumbMenuItem_Hiligth"
      CompletionListCssClass="BreadcrumbMenuPanel"
      CompletionListHoverCssClass="BreadcrumbMenuPanelHover"
      DropArrowBackColor="Transparent"
      MinSelectableLevel="1"/>
  • codebehind

protected override void OnInit(EventArgs e)
{
//setup start path
//CurrentBreadCrumbPath  is Dictionary<string, string>. First key is item identity, second - text presentation
            nGUPathEx.CurrentBreadCrumbPath = GeographicUnit.GetPath(GeographicUnit.GeographicUnitGet(88343));
}

  • web-service method

    [WebMethod]
    [ScriptMethod]
    public string[] GetPath(string contextKey)
    {
        int goID;
        if (!int.TryParse(contextKey, out goID))
            guID = (int)GeographicUnitIDs.NotSet;
        List<string> list = new List<string>();
        string cacheKey = "get_gu_path_"+contextKey;
        list = Context].Cache[cacheKey] as List<string>;
        if (list == null)
        {
            list = new List<string>();
            List<GeographicUnit> guList = DBRepository.GetList<GeographicUnit>(guID)
            for(int i = 0; i < guList.Count; i++)
            {
                //using standart AutoComplereExtender method to generate serialized item
                list.Add( *AutoCompleteExtender.CreateAutoCompleteItem(guList[i].ID.ToString(),guList[i].ShortName)* );
            }
            Context.Cache.Add(cacheKey, list, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(5), CacheItemPriority.Default, null);
        }
        return list.ToArray();
    }

BreadCrumbPreview.bmp
UpdatePanelExtender
UpdatePanelExtender is provides long operations execution without full page update in Comet style.

Last edited May 5, 2010 at 5:53 AM by e_korneychuk, version 8

Comments

No comments yet.