Testing Selected URL to Stop Linking

2 posts, 0 answers
  1. Doug
    Doug avatar
    73 posts
    Member since:
    Mar 2008

    Posted 18 Apr 2008 Link to this post

    Hello,

    In Sharepoint, all Quick Launch entries must have an associated URL.  I use a false URL for items that are top-level categories.  Sometimes the top-level is a proper URL.  Thus, I want to test on any selected URL to see if it contains my false URL before allowing the event to proceed.  Unfortunately, I cannot figure out how to get the selected URL as text.  The LinkElement displays as the URL, but testing on it does not work.  Here's a sample of what I am trying to do:

    <script type="text/javascript">
       function OnClientItemClickingHandler(sender, eventArgs)
       {
           if(eventArgs.Item.Expanded == true)
           {
             eventArgs.Item.Collapse();
           }
           else
           {
             eventArgs.Item.Expand();
           }
           if(eventArgs.Item.LinkElement.indexOf("go_nowhere")>-1)
          {
           return false;
           }
       }
    </script>

    My Panelbar has an OnClientItemClicking event that calls this function.

    Any help would be appreciated.

    Thank you,

    Doug
  2. Doug
    Doug avatar
    73 posts
    Member since:
    Mar 2008

    Posted 20 Apr 2008 Link to this post

    UPDATE:

    Problem resolved by utilizing NavigateUrl instead of LinkElement.
Back to Top