C#

Wrong content type with document template

Last time one of my Clients asked me for a possibility to extend document libraries with Excel template. The choice was obvious – a custom content type with Excel document template. I have created such a content type in few minutes, created a package, run deployment process and… Voilà! Site content type has been created. (continue reading…)


SharePoint 2013 custom login page for Form-Based Authentication

Some time ago I have written the post about creating custom login page for SharePoint 2010. Many visitors asked me whether it works also for SharePoint 2013. The answer is: probably yes :). I haven’t tested it, but it should not cause any problems.

This way or another, I’ve decided to rewrite the page to be 100% SharePoint 2013 comaptibile.

At the end of this post You will find everything what’s needed to implement the solution in Your environment. Enjoy!
(continue reading…)


Disable event firing outside an event receiver

Everybody, who at least once created a custom event receiver, knows property EventFiringEnabled(or DisableEventFiring method in SP2007). It allows to disable event firing, so SPListItem.Update() can be safely executed, without any other event receiver come in the way.

But what, when You want to disable event firing outside Your custom event receiver? There is a very simple way to do it. (continue reading…)


Add ribbon button to one list or library in SharePoint 2010

Sometimes You need to add a new button to the list’s/library’s ribbon – nothing more simple than that. You jut need to create a new SharePoint project, add a feature, add an empty element with an Elements.xml file and define in it XML structure that will represent the new bottom. (continue reading…)


Get selected items from SharePoint 2010 list

Fetching selected list items in SharePoint 2010 is very simple. To achieve such a functionality You can use Custom Ribbon Button. In this example I will use the code from my previous post on creating custom ribbon button. (continue reading…)


SharePoint and NHibernate – problem with NHibernate.ByteCode.Castle.dll

I often use NHibernate to work with SQL database. It’s a very mature ORM solution for .NET which allows You to freeley “talk” with any database. Although, this is very simple ORM, sometimes I have some challanges I have to face.

One of the first issue I had with this ORM was:

Could not load file or assembly ‘NHibernate.ByteCode.Castle’ or one of its dependencies. The system cannot find the file specified.

(continue reading…)


SharePoint 2010 Developer Dashboard

Developer dashboard is a new feature in SharePoint. It provides to developers and administrators performance and tracing information that can be used to debug and troubleshoot issues with a page rendering time. The dashboard is turned off by default but it can be enabled through C# code, stsadm or powershell command and it can have three states: On, Off, OnDemand. First two should be clear. Third one means that SharePoint will show an image button next to Your login name on a page with which You will be able to show or hide the developer dashboard.

(continue reading…)


SharePoint SPItemEventReceiver

Item event receivers are similar to triggers existing in databases. They are executed on certain moments(events) on a SharePoint lists, libraries etc. Thanks to the events You can control Your items content, perform necessary validation before commiting any changes to the item.

(continue reading…)


Preventing browser from cachning ASPX or ASCX content

Caching content by the browsers can be sometimes very annoying. I had problems with it,  mostly when I was developing some popup modal dialogs which showed aspx or ascx controls.

Thankfully, there is very simple solution how to disable content caching. You achieve it in two ways:

(continue reading…)


SqlMembershipProvider – Users management

In the previous post I showed You how to manage roles for forms authentication. Now I’ll explain how to manage users from the code side.

The main class which lets You manage users from provider is System.WebSecurity.SqlMembershipProvider class.

To get the SqlMembershipProvider object You have to use System.Web.Security.Membership class and pass the name of the provider You want to obtain: (continue reading…)


Copyright © 1996-2010 Tomasz Rabiński | zavaz Blog. All rights reserved.
Jarrah theme by Templates Next | Powered by WordPress