Wednesday, September 12, 2012

Hide Advanced Search button on Users page

Here's how you can hide the Advanced Search button on the default Users page in the FIM portal.



There are a few things to keep in mind:
  • You have to edit the ASPX page in Sharepoint designer.  This is not a supported change!
  • You can hide the ASP control by inserting some Javascript on the page.
  • You must call the Javascript upon load as well as upon AJAX response.
And here are the steps to accomplish it:
  • Open the IdentityManagement site in Sharepoint Designer.
  • Make a backup of aspx/users/AllPersons.aspx.
  • Add the following javascript:
    • Note that it's very important that the Javascript code go inside the tags.
<%@ Page masterpagefile="~masterurl/custom.master" language="C#" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document"  UICulture="auto" Culture="auto" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceHolderID="PlaceHolderTitleBar" runat="server">
<script type="text/javascript">
<!--
    function hideElementByClass(matchClass) {
        var elems = document.getElementsByTagName('*'), i;
        for (i in elems) {
            if ((" " + elems[i].className + " ").indexOf(" " + matchClass + " ") > -1) {
                elems[i].style.display = 'none';
            }
        }
    }
    function hideAdvancedSearch() {
        hideElementByClass('newListViewSearchMode');
        hideElementByClass('searchModeToggleImage');
    }
    window.onload = function () {
        hideAdvancedSearch();
    }
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(hideAdvancedSearch);
// -->
</script>
</asp:Content>
 
<asp:Content id="content1" ContentPlaceHolderID="PlaceHolderMain" runat="server">
 <IdentityManagement:PersonList id="PersonList"  width="100%" height="100%" runat="server"/>
</asp:Content>

References

10 comments:

  1. Your content is nothing short of brilliant in many ways. I think this is engaging and eye-opening material. Thank you so much for caring about your content and your readers.
    Search Button

    ReplyDelete
  2. I recently found many useful information in your website especially this blog page. Among the lots of comments on your articles. Thanks for sharing. psd to responsive html

    ReplyDelete
  3. Engineering as a subject combines mathematics, logic and science to find solutions to our daily life problems. Over the last few decades, engineering as a profession has seen vast expansion.friv jogos online
    jogos online 2019
    friv jogos 4 school online

    ReplyDelete
  4. AtozTopNews is the most prestigious technology site where they write on the latest and most innovative technology. AtoztopNews is renowned for writing reviews of the latest technology to the latest technological advancements. In addition, the articles they write about the most cutting-edge technology is something you can trust, and their comments are interesting.

    ReplyDelete
  5. Your Site is very nice, and it's very helping us this post is unique and interesting, thank you for sharing this awesome information. and visit our blog site also. Satta King

    ReplyDelete
  6. สำหรับผู้ที่ชื่นชอบภาพยนตร์ และผู้ชมทุกท่าน ที่ชื่นชอบ หนังออนไลน์ฟรี ซีรีย์ที่ชื่นชอบในการรับชมภาพยนตร์ ซีรีย์ ดูซีรีย์ออนไลน์ อัพเดทใหม่ตลอดทั้งเดือน

    ReplyDelete
  7. วันนี้จะมาแนะนำ ทดลองเล่นสล็อต megagame กับเว็บไซต์เราได้เเล้ววันนี้ที่ MEGA GAME ทุกท่านจะพบ กับเกมสล็อตออนไลน์ รูปแบบใหม่มีมากกว่า 1000 เกมที่เราได้คัดสรรมาให้นักเสี่ยงโชค

    ReplyDelete
  8. อยู่กับโลกออนไลน์ โดยเฉพาะแบรนด์ ดังอย่างเช่น betflix285 ของเรา Betflix เว็บคาสิโนออนไลน์ และ สล็อตออนไลน์ ที่ดีที่สุด ในเวลานี้ เพราะเรา betflix คือเว็บผู้ให้บริการเกม

    ReplyDelete