SharePoint 2013: Hide Newsfeed / SkyDrive / Site Link

Scenario:

We need to hide Newsfeed / SkyDrive / Site link from the right top of the page.

Resolution:

Add the following CSS class in the style sheet of master page and we are done

.ms-core-suiteLinkList {

display:none;

}

Comments (1)

SharePoint 2013: After Upgrade, Images are not rendering

Scenario:

We have upgrade our SharePoint 2010 farm to SharePoint 2013. After upgrade, images stopped rendering in IE. Images are working fine in Chrome and Firefox but when opened in Internet Explorer, failed to render

Resolution:

It seems that SharePoint 2013 is adding two custom headers in HTTP request that are not recognized by IE. These custom headers were creating all the problem. Going into the web.config file of web application and commenting those custom headers solved the issue.

<customHeaders>

        <add name=”X-Content-Type-Options” value=”nosniff” />

        <add name=”X-MS-InvokeApp” value=”1; RequireReadOnly” />

</customHeaders>

A great post by Johan Olivier helped us a lot.

Leave a Comment

SharePoint: Create Dynamic SPQuery

Scenario:

We need to develop a webpart that searches a list in SharePoint. The search criteria are based upon user input. A simplified image of search criteria is as under:


Resolution:

After googling, we found a great solution:
http://sharepointcamlhelper.codeplex.com/

Suppose we have two checkboxes and two radio button, then our query should be like this:

SPQuery oQuery = new SPQuery();
CAMLManager mgr = new CAMLManager();
mgr.QueryGroups.Add(new QueryGroup("ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Eq, "ColumnValue"));
mgr.QueryGroups.Add(new QueryGroup(Types.JoinTypes.And, "ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Eq, "ColumnValue"));
if (chkSelectGroup.Checked == true)
{
mgr.QueryGroups.Add(new QueryGroup(Types.JoinTypes.And, "ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Eq, ddlSelectGroup.SelectedItem.Text));
}
if (chkSubject.Checked == true)
{
mgr.QueryGroups.Add(new QueryGroup(Types.JoinTypes.And, "ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Contains, txtSubject.Text));
}
if (rbAnnByEmail.SelectedIndex != -1)
{
if (rbAnnByEmail.SelectedItem.Text == "Yes")
{
mgr.QueryGroups.Add(new QueryGroup(Types.JoinTypes.And, "ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Eq, "ColumnValue"));
}
if (rbAnnByEmail.SelectedItem.Text == "No")
{
mgr.QueryGroups.Add(new QueryGroup(Types.JoinTypes.And, "ColumnName", Types.FieldTypes.Text, Types.QueryTypes.Eq, "ColumnValue"));
}
}
mgr.OrderBy.Add(new OrderBy("ColumnName", false));
string camlQuery = mgr.GetFullCAML();
oQuery.Query = camlQuery;

Issue:
One thing that doesn’t seems to be working is “ViewFields”. We have added following lines to restrict our query to specific fields, but it doesn’t seems to be working.

cmgr.ViewFields.Add(new ViewField("ColumnName"));
cmgr.ViewFields.Add(new ViewField("ColumnName"));
cmgr.ViewFields.Add(new ViewField("ColumnName"));
cmgr.ViewFields.Add(new ViewField("ColumnName"));
cmgr.ViewFields.Add(new ViewField("ColumnName"));


Update:
If we add following code, ViewFields seems to work

spQuery.ViewFieldsOnly = true;
spQuery.ViewFields = cmgr.GetViewFields().Replace("", "").Replace("", "");

Comments (1)

SharePoint:InputFormTextBox: Validation Issue after postback

Scenario:

We have placed a “SharePoint:InputFormTextBox” text control on our webpart and wanted to make it a “Required Field”. We added an ASP “RequiredFieldValidator” which works fine when we click submit.

We have other controls on the form as well. If an event is occurred and any other controls postback, then, the validation on “SharePoint:InputFormTextBox” fails to work if we try to submit.

Resolution:

We look into the issue and tried to resolve by adding implementing different solutions but nothing was working. In the end, found a reply on MS SharePoint forum that was buried in other replies. Suggested setting the initial property of “RequiredFieldValidator”.

Turned out the when webpart postback, somehow, “<DIV></DIV>” is added in “SharePoint:InputFormTextBox”. You can check it by editing the control “SharePoint:InputFormTextBox” after postback from some other control.

We set

RequiredFieldValidator3.InitialValue = “<DIV></DIV>”

in every control server-side code that postback.

Source: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopmentlegacy/thread/e9fbbd43-bef9-48fc-9a9f-0011514798e7/ Look at the last reply by “cschoenfeldt“.

Leave a Comment

SharePoint 2010 Best Practices

Leave a Comment

SharePoint Foundation 2013 Preview and SharePoint Server 2013 Preview – Download Links

SharePoint Foundation 2013 Preview:

Download @ http://www.microsoft.com/en-us/download/details.aspx?id=30345

Hardware & Software requirements @ http://technet.microsoft.com/library/cc262485(office.15)

SharePoint Server 2013 Preview:

Download @ http://technet.microsoft.com/en-us/evalcenter/hh973397

Hardware & Software requirements @ http://technet.microsoft.com/library/cc262485(office.15)

Deployment guide for SharePoint 2013 Preview @ http://www.microsoft.com/en-us/download/details.aspx?id=30384

SharePoint Designer 2013

Download @ http://www.microsoft.com/en-us/download/details.aspx?id=30346

Resources:

Install and deploy SharePoint 2013 (IT pros) @ http://technet.microsoft.com/en-US/sharepoint/fp142376

SharePoint 2013 training for IT pros @ http://technet.microsoft.com/en-US/sharepoint/fp123606

SharePoint 2013 Technical Library in Compiled Help @ http://www.microsoft.com/en-us/download/details.aspx?id=30382

Leave a Comment

Microsoft Security Bulletin – Vulnerabilities in SharePoint Could Allow Elevation of Privilege

Leave a Comment

« Newer Posts · Older Posts »