GSCustomMenuSection

Contents for SharePoint, ReactJS, C#, ASP .Net, JavaScript, JQuery, SQL

Friday, May 27, 2016

Hide default "There are no items to show in this view of the list." message using Jquery


While working with SharePoint's OOTB list view webpart, certain times we come accross a situation where there are no records in that particular view. Requirement wants not to display the OOTB message "There are no items to show in this view of the list. To add a new item, click "New"." to end user. In that scenario you can do following to get rid of OOTB message.


  • Open your webpart page in edit mode.

  • Add a content editor webpart to the page.

  • You can either put below javascript in a file and add its reference/ put the code in content editor webpart



  • < script type="text/javascript"> $(document).ready(function(){ $(".ms-vb").css("display","none"); }); < /script>

    Save the page and there you go. OOTB message is hidden in all webparts in page where there are not items to show.


    Failed to load expression host assembly. Details: Could not load file or assembly


    Failed to load expression host assembly. Details: Could not load file or assembly 'expression_host_f7d608c0ebb24f48bac018b81c6ff665, Version=11.2.30319.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)



    This error occurs if we are trying to use report viewer and local reports.

    Explanation:
    By design assembly need full trust to read local reports, else they throws above error. Error itself states that "Failed to grant permission to execute." Which means the local rdlc file is not accessible due to permission.

    Resolution:
    You need to provide full trust permissions. To do so, you need to add/update an entry in web.config of your site where report viewer is used.


    < system.web > < trust level="Full" /> < /system.web >