suggested enhancment

Last post 05-27-2006 2:45 AM by jminond. 2 replies.

Sort Posts:

  • suggested enhancment

    05-27-2006, 1:08 AM
    • Contributor
      2,898 point Contributor
    • jminond
    • Member since 07-21-2003, 2:33 PM
    • New York
    • Posts 608

    I found that when i have a menu item with a value, but no nav link, in my table version it all worked fine,becuase i had post backs, but with the css adapter, i dont.

    i propose, adding in the menuadapter.cs file begining at line 106

    if

    (item.NavigateUrl.Length > 0 || item.Value.Length > 0)

    {

    writer.WriteBeginTag(

    "a");

    if (item.NavigateUrl.Length > 0)

    writer.WriteAttribute(

    "href", Page.ResolveUrl(item.NavigateUrl));

    else

    writer.WriteAttribute(

    "href", string.Format("javascript:{0};", Page.ClientScript.GetPostBackEventReference(menu, item.Value)));

     

    the key here is that now i am checking for item.Value and if its there, and there is no nav url, i can assign a postbackreference.... perhaps this can be hanced to support some sort of clientscript control, currenlty, i just have it post back he value.

    this creates a post back reference with the contronl, menu and a value.

    then, i have several controls that use menu's in one way or another, and in each i attach to the page_load method, and put in something like

    string evtTarget = HttpContext.Current.Request.Form["__EVENTTARGET"];

    string evtArg = HttpContext.Current.Request.Form["__EVENTARGUMENT"];

    string menuClick = this.TabMenu.ClientID.Replace("_", "$");

    if(menuClick == evtTarget)

       this._tabMultiView.ActiveViewIndex = Convert.ToInt16(evtArg);

     

    in this example, i am setting a view on a multiview control.

     

    what i meant about more client script control, was in this case... it leaves a lot of responsibilty on the decloper to put that handler in for the event match, plus value.....

    i am not sure how i would extend the menu adapter, to say... have an event i can attach to to let me know the link that was fired for example. then in the server controls instead of doing something like myMenu.ItemClick += .....my method.

    i would have something like ((MenuAdapter)myMenu).ItemClick += ... my event.....

    i don't know, im sure there is a cleaner solution, any thoughts?

     

    Jonathan Minond
    http://www.Jonavi.com
    http://www.jonavi.com/Default.aspx?pageID=21
    http://RainbowBeta.com
    http://community.rainbowportal.net/blogs/jonathans_rainbow_blog/default.aspx
    http://dotnetslackers.com/community/blogs/jminond/default.aspx
  • Re: suggested enhancment

    05-27-2006, 1:43 AM
    • Contributor
      3,298 point Contributor
    • Russ Helfand
    • Member since 09-14-2005, 6:22 PM
    • Groovybits.com
    • Posts 741
    You might want to review this thread, http://forums.asp.net/thread/1273102.aspx, and the solution proposed therein.  Again, thanks for contributing to this project with your feedback.  It's terrific to see folks using these adapters... and finding the flaws in this initial rev!  Ha ha.
    Russ Helfand
    Groovybits.com
  • Re: suggested enhancment

    05-27-2006, 2:45 AM
    • Contributor
      2,898 point Contributor
    • jminond
    • Member since 07-21-2003, 2:33 PM
    • New York
    • Posts 608
    great, item.Selectable is exatcly what was needed.
    Jonathan Minond
    http://www.Jonavi.com
    http://www.jonavi.com/Default.aspx?pageID=21
    http://RainbowBeta.com
    http://community.rainbowportal.net/blogs/jonathans_rainbow_blog/default.aspx
    http://dotnetslackers.com/community/blogs/jminond/default.aspx
Page 1 of 1 (3 items)