Using HTTP Module for SharePoint 2007 (MOSS/WSS) site using FBA And RSA

Requirement: I am using WSS site with Form Based Authentication (FBA) with a custom login page which reads username from RSA cookie and calls the FormsAuthentication.RedirectFromLoginPage method. So that user does not have to re-enter the credentials.   Problem comes up when the user clicks the “Sign Out” or “Sign in as a Different User” links…

8

Adding user control to SharePoint 2007 (MOSS/WSS) Web Part and handling events in there

View the updated one: Part 2 – Adding user control to SharePoint 2007 (MOSS/WSS) Web Part and handling events in there – Step by Step with task pane properties.   Requirement: I have a Web User Control where I added one textbox and a button. Now I wanted to add this user control into a…

30

Issue with XMLFormView.Uri Property in Browser based InfoPath Forms and Work-around

XMLFormView.Uri property of a InfoPath Form should return the URL of the Form itself. But it works if you open the form in InfoPath client and does not work if you open it in browser. When you open it in browser, this property gives you output like: “New Form” instead of the actual URL.  …

2

SharePoint 2007 (MOSS/WSS) how to change the template link within a InfoPath Form under a Form Library to point it to a New Form Template – Part 2 (few findings)

If you keep the fields (text field, drop down list etc) in separate sections within the Form Templates, then the previously mentioned changing link to the template does not work properly. It only works if you keep the fields directly in the form without using any group/section in all the templates. The previous code given…

2

SharePoint 2007 (MOSS/WSS) Custom BDC Web Part Example

Here is an example of a simple Custom Business Data Catalog (BDC) Web Part. I have used a BDC Metadata file which connects to Northwind database. It has reference of both Categories and Products table. But in this example I have only listed all Category ID and Category Name from Categories table. Here is the…

7

SharePoint 2007 (MOSS/WSS) how to change the template link within a InfoPath Form under a Form Library to point it to a New Form Template

Requirement:  You have designed an InfoPath Form Template and published it as a Content Type.  You have a Form Library where you have made this Content Type as the Default Content Type. You have added few Forms which are associated with this Form Template or Content Type. Now you want to add few more fields into…

6

A SharePoint 2007 (MOSS/WSS) WebPart showing the list of users of a site with a link to corresponding MySite

Add a reference of Microsoft.Office.Server.dll. Here is the Code: using System; using System.Runtime.InteropServices; using System.Web.UI; using System.Web.UI.WebControls.WebParts; using System.Xml.Serialization;   using Microsoft.SharePoint; using Microsoft.SharePoint.WebControls; using Microsoft.SharePoint.WebPartPages; using Microsoft.Office.Server.Administration; using Microsoft.Office.Server.UserProfiles; using Microsoft.Office.Server; using System.IO;   namespace UserProfileWP {     [Guid(“e36b58a7-fbe9-4ecf-b545-831929545ebf”)]     public class UserProfileWP : System.Web.UI.WebControls.WebParts.WebPart     {         string output = “<table border=\”0\”>”;         protected…

9

Complete Code of SharePoint 2007 (MOSS/WSS) Connected Web Parts using IWebPartField Interface

Here is an example of connectable Webparts using IWebPartField interface. In the Provider Web Part, I have a drop down list box. This Web Part contains a list of categories from Northwind Database-Categories table. In the Consumer Web Part I have enlisted associated products from Products table. Connection Provider Part: using System; using System.Runtime.InteropServices; using System.Web.UI; using System.Web.UI.WebControls.WebParts; using…

13

How to Add a Task in a SharePoint 2007 (MOSS/WSS) Site Programmatically

Here is a piece of code (a function) to add a task. You can use it as a Web Method in a custom Web Service. This method can be used from Applications outside of SharePoint, provided the user using this application has sufficient privilege to update Tasks Lists. public string CreateTask(string SitePath, string TaskName, string AssgnTo,…

10

A SharePoint 2007 (MOSS/WSS) WebPart to show up all subsites under a site

Here is the code for the WebPart:   using System; using System.Runtime.InteropServices; using System.Web.UI; using System.Web.UI.WebControls.WebParts; using System.Xml.Serialization;   using Microsoft.SharePoint; using Microsoft.SharePoint.WebControls; using Microsoft.SharePoint.WebPartPages;   namespace ListSubSites {     [Guid(“e96ea212-f44b-4d16-886d-e8fe7d389a7a”)]     public class ListSubSites : System.Web.UI.WebControls.WebParts.WebPart     {           string output = “<table border=\”0\”>”;               protected override void CreateChildControls()         {            …

3