This is a migrated thread and some comments may be shown as answers.

Testing Selected URL to Stop Linking

1 Answer 37 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 18 Apr 2008, 03:13 PM
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

1 Answer, 1 is accepted

Sort by
0
Doug
Top achievements
Rank 1
answered on 20 Apr 2008, 05:06 PM
UPDATE:

Problem resolved by utilizing NavigateUrl instead of LinkElement.
Tags
PanelBar
Asked by
Doug
Top achievements
Rank 1
Answers by
Doug
Top achievements
Rank 1
Share this question
or