C#

SqlMembershipProvider – Roles management

In the previous post I showed You how to create custom log in page for forms authentication. Now I’ll explain how to manage roles from the code side.

The main class which lets You manage roles from provider is System.Web.Security.SqlRoleProvider class.

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


SharePoint 2010 custom login page

UPDATE
If Your interested in custom login page for SharePoint 2013, check this post.

In SharePoint 2010(like in previous versions) You can enable forms authentication along with standard AD authentication. Thanks to that the internal users can log in to SharePoint using theirs domain accounts and external users can use prepared accounts which are kept in the database. Here is very good instruction step by step how to enable this funcionality. (continue reading…)


SPSecurity.RunWithElevatedPrivileges – the way to become a god

Permission levels in SharePoint are very important thing. They define actions which specified users can perform on sites, lists etc. But, in vast amount of applications, there is a way to bypass permission checking and become a “god” who can do almost everything. I’m talking about SPSecurity.RunWithElevatedPrivileges method. This method lets’ You get a reference to the SPSite object and with it You can access any of the site collection elements with administrator rights.

(continue reading…)


log4net and EventLogAppender

Lately in my projects I’ve been using log4net library which enables great way of logging messages and errors in many different ways and on different levels. I won’t describe exatcly how it works, but if You’re interested You can read about it here http://logging.apache.org/log4net/.

(continue reading…)


VSTO Part 2 – Excel Add-In

Second part of the Excel tutorial. In this lesson I will show You how to add a custom task pane to the add-in and how to write information to desired cell in a Excel worksheet.

I will continue to develop solution from Part 1.

(continue reading…)


VSTO Part 1 – Excel Add-In

Have You ever wondered how to create AddIns for Microsoft Office Applications? In this tutorial I’ll show You how to create an Microsoft Office Excel 2007(although, I think there’s no difference with 2010) AddIn with ribbon  and custom task panes with variuos funcionality. This post, as Part 1 of the tutorial, will describe how to create a solution and ribbon with one button.

(continue reading…)


SharePoint 2010 MasterPages

MasterPages have been available since WSS 3.0 and MOSS 2007. SharePoint 2010 also has it’s own MasterPages which We can use to integrate the visual layout of our application with the latest Microsoft product. The most important ones are:

(continue reading…)


SharePoint Web Services

WSS 3.0 and MOSS 2007 give developers ability to manage it’s resources by Web Services. With their help You can do things like add attachment to the specified list item or add a new user to the site collection. Full list of Web Services can be found here. Exception is SharePoint 2010 which doesn’t provide Web Services(asmx), but it enables communication through WCF(details here).

(continue reading…)


SharePoint Quota and Storage Usage

Have You ever wondered how to check quota miniumum and warning level values or current storage usage?

It’s very simple and it can be done with few lines of code.

Below You can find a sample how to get mentioned values in mega bytes unit:

(continue reading…)


SPGroup.ContainsCurrentUser is always false

SPGroup object has a grat property named ContainsCurrentUser. As the name says it tells us if the current user is a member of a group from which property is called. For example, if we want to check if a current user is a member of a “SharePoint Owners” Group we can easily do it like this:

(continue reading…)


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