Avatar of ZaDrizzle
ZaDrizzle

asked on 

Sharepoint Web Part sometimes causing left hand navigation menu to be hidden

I've created a web part in SharePoint 2007. I have had complaints from several users that sometimes the left hand navigation menu ("View All Site Conent", "Documents", "Lists", etc.) does not show. This behavior is not consistent. The user can load the page the first time and the panel is visible, then refresh the page and the panel disappears or vica versa. Any ideas on what might cause this behavior?
ASP.NETMicrosoft SharePoint

Avatar of undefined
Last Comment
Rainer Jeschor
Avatar of Uttam (Kukdai) Dhakal
Uttam (Kukdai) Dhakal
Flag of United States of America image

where does it happen is it happening in all browsers or just some particular browsers.
do you have any java script in your master pages.
try it in your own machine.
clear your cache and try again and see if you can reproduce the problem
Hi,
what is this web part doing?
Perhaps the web part does not create valid html (eg missing closing tags).
If possible post the html output.
Thanks.
Rainer
Avatar of ZaDrizzle
ZaDrizzle

ASKER

Thanks for the feedback and sorry for the slow response. It turns out that the masterpage and my webpart are both importing the same jquery library.

<script type="text/javascript" src="/_catalogs/masterpage/js/jquery/jquery-1.4.2.min.js"></script>

Open in new window


This is causing my jquery selector to fail when the page loads. I don't understand why this wouldn't throw an error everytime instead of only sometimes.
 $(function() {
 $("input[id$='usernameTxtBx']").autocomplete({
            source: function (request, response){
                $.ajax({
                type: 'POST',
                contentType: 'application/json; charset=utf-8', 
                url: '~/_layouts/UsernameAutoComplete.asmx/GetUsernames',
                data: "{ 'partialUsername': '" + request.term + "', 'maxResults': '10' }",
                dataFilter: function(data){return data;},
                success: function(data) {
                    response($.map(data.d, function (item){
                        return{
                            label: item,
                            value: item
                        }
                    }))
                }
            });
        },
        minLength: 1
        });
    });

Open in new window

I know I can just take the line to import the jquery library out of my webpart, but if the web part were to get loaded on a page that did not import the library, then the webpart would also fail. What would be an appropriate way to handle this?
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo