Posts Tagged ‘SharePoint’

Sharepoint: Reserved Keyword id in QueryString

October 27th, 2011

This is a caveat which may save you hours of pulling your hair out and/or banging your head against the wall.

When passing paramaters via the querystring in any sharepoint webpart user control , the term “id” is reserved, and any functionality depending on this querystring parameter will break.

» Read more: Sharepoint: Reserved Keyword id in QueryString

Sharepoint: Maintain Scroll Position on Postback

January 24th, 2011

Problem: Sharepoint does not maintain Scroll Position on Postback

Solution:

Step 1: Navigate to your Default.Master Page in Sharepoint Designer and add the following Line:

<%@ Page Language=”C#” AutoEventWireup=”true” MaintainScrollPositionOnPostback=”true” %>

Step 2: Save and publish your Default.Master Page, you will notice that Sharepoint Designer has modified the above line to something like the following (Depending on your Sharepoint Version):

<%@ Page Language=”C#” AutoEventWireup=”true” MaintainScrollPositionOnPostback=”true” inherits=”Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>

Step 3: Add # anchor tags as per normal HTML to your Web Part Pages and your Scroll Position will be maintained on Postback


Change the days to display the !new icon in SharePoint 2007

June 28th, 2010

In SharePoint 2007, when a new item is added to a list or document library, the !new icon is displayed. By default, this is visible for two days. Using the stsadm commands below, you can change the number of days to display this, or not to display it at all.

Get the current value of days
stsadm -o getproperty -propertyname days-to-show-new-icon -url http://site.company.com
A value of “2″ should be returned.

Set the new value of days
stsadm -o setproperty -propertyname days-to-show-new-icon -propertyvalue 7 -url http://site.company.com
Change the value after -propertyvalue to your required number of days.

Source

w3wp.exe unable to authenticate on target name

May 12th, 2010

We installed SharePoint 2010 on a Windows Server 2008 R2 server with IIS 7. A new web application was created and set to use NTLM authentication. When browsing to this web application using the local hostname, authentication was successful, and the web site displayed as normal. But due to multiple web sites that will be used on this web server, we wanted to use a different host name for this particular web site.

For example: Hostname = MOSSSERVER; website hostname = WEBSITENAME.

WEBSITENAME was added to the Internal DNS server and the local hosts file, and we attempted to browse to http://WEBSITENAME, but the web site would not authenticate using that hostname. The following event appeared in Windows Event Viewer:

Source: LsaSrv
Event ID: 6037

The program w3wp.exe, with the assigned process ID, could not authenticate locally by using the target name HTTP/WEBSITENAME. The target name used is not valid. A target name should refer to one of the local computer names, for example, the DNS host name.

Try a different target name.

No problem. » Read more: w3wp.exe unable to authenticate on target name

SharePoint: Use query string to set the view on Site Manager

October 27th, 2009

The different views on Site Manager is useful for quickly filtering and finding the content you are interested in. However, Site Manager does not show the actual URL when you change the view, which makes it difficult to restrict or redirect the user to a view (either the default one or a custom one you created).

This can actually be achieved by specifying the query string parameter “rptmode” (without the quotes) with the index of the view you wish to see.

For example, the default “Pending Approval” view has the index 3, so the URL would be: http://[site]/_layouts/sitemanager.aspx?rptmode=3

The index is the ID of the view (CAML query) in the Content and Structure Reports list (under View All Site Content).

A quick way to find out the view index is via Site Actions -> View Reports -> [select the report you want], and you will be redirected to Site Manager with the full URL displayed.