Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


How to hide and show webpart

Posted on 2009-12-17
Medium Priority
Last Modified: 2012-05-08
I want to hide and show the search core results webpart based on the scope user choose in the Advanced Search page.
For example in the Advanced Search page I have multiple scopes
1) Scope1
2) Scope2
3) Scope3

When user choose Scope1 then the searchcore reullts1 webpart should show and hide the two other search core results webparts. How is it possible.

Question by:vmandem
  • 2
LVL 15

Assisted Solution

dp_expert earned 248 total points
ID: 26079484
As I understand you would like to hide specific web parts depending on the scope passed in the URL of the search, right?
If so you can do it 2 ways - either code it (for ex create a web part that will read the query string and will hide the selected web parts, or use a javascript to check the URL, find the scope and use the style.display='none' for the selected web parts
LVL 11

Accepted Solution

thman earned 252 total points
ID: 26081479
Load your page in browser and then view source. You will find how SharePoint renders the page into HTML, such as the tags it generates for each web parts, etc. Then you just need to add javascripts into your page to hide and show the web parts.
LVL 15

Expert Comment

ID: 26081965
One remark to thman comment - web part ID's are generated dynamicaly and can change when you for example change layout, web part order or even save the page, so you might brake your solution by simply moving the web part.

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question