Monday, July 27, 2009

Create a sharepoint webpart

Steps:
1. Create a simple webusercontrol . Put necessary code and controls in it.(For ex, datagrid and code to connect database.) Do not maintain separate code file (ascx.cs) for web user control. Put code in same ascx file only.
2. Put the webusercontrol (.ascx file) in layout folder of sharepoint site where you want to deploy the webpart.
3. Go to VS2008. (Please install VSSWSE.exe before that.)
4. Create new Project -> Select webpart from Visual C# -> sharepoint
5. Add following code :
protected override void CreateChildControls()
{
base.CreateChildControls();
// TODO: add custom rendering code here.
Control objControl = Page.LoadControl("/_layouts/WebUserControl.ascx");
this.Controls.Add(objControl);
}
6. Build and deploy the solution.
7. Go to the sharepoint site -> Site Actions -> EditPage ? Add Web Part.
8. Select your webpart from the list.

Saturday, July 25, 2009

Learning Resources for sharepoint

Learning Resources for sharepoint
1. http://manish-sharepoint.blogspot.com/2009/04/training-material-on-microsoft-office.html

2. http://sharepointdevtest.blogspot.com/

3. http://qmoss.blogspot.com/

Thursday, July 23, 2009

Check "Sign In Automatically" checkbox in Login.aspx of sharepoint

You will required to hide sign in me automatically checkbox.

You will be required to put following java script in the login page.

Wednesday, July 22, 2009

FBA with LDAP in Sharepoint

Configure FBA with AD
=================

http://www.codedigest.com/Articles/Sharepoint/94_Active_Directory_for_FBA_in_SharePoint_using_LDAP.aspx
http://msdn.microsoft.com/en-us/library/bb975136.aspx#MOSS2007FBAPart1_BasicSetup
http://msdn.microsoft.com/en-us/library/bb975136.aspx

Thursday, July 16, 2009

Monday, July 13, 2009

Sharepoint Installation

http://www.pptspaces.com/sharepointreporterblog/Lists/Posts/Post.aspx?ID=28

Tuesday, May 19, 2009

Wednesday, April 29, 2009

Lookup fields processing in custom activity

If you are using SharepointWorkflows with some custom activities you might face this problem.

In your custom activities, you might need dynamic content input from user while creating workflows.

Mail text would be the best example for the same.

In custom activity such as mail send with attachments, needs dynamic content.

For example,

Hi [%List:Username%]

.....

......

Thanks,

[%List:Sender%]

This kind of dynamic content will not be parse if you directly use the input parameter without Helper.ProcessStringField.

Without this processing custom activity will treat it as a string. and and in mail you will get Hi [%List:Username%] text. (instead of Hi Indrajeet..)

So to fix of the problem, 

before using the input in mailsend function you should procees it by using Helper.ProcessStringField(stringFromUserInput, objActivity, this.__Context))

Ex. String retValue = Helper.ProcessStringField(stringFromUserInput, objActivity, this.__Context))


Virtual paths for layouts and theme folders

For themes :

/_Themes/Folder1/test.css

For Layouts :

/_Layouts/Folder2/Page1.aspx

Wednesday, April 1, 2009

Hide sharepoint Contextmenu(ECB)/ Remove sharepoint Contextmenu(ECB)

Core.Js findings:

  1. In Core.Js, under path C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033

function AddSharedNamespaceMenuItems creates following context menu items.

View Item,

Edit Item,

Manage Permissions

You can override the functions in MasterPage to modify the context menu.

  1. To Hide context Menu in sharepoint. Override following function of core.js.

    AddListMenuItems -- Hides Context Menu from list.


 

For more details mail me at indrajitk@gmail.com


 

Steps to hide Context menu for list items:


 

1. Just go to core.js file(C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033)

2. find AddListMenuItems function.

3. You will find following code in this function, if (typeof(Custom_AddListMenuItems) !="undefined") { if (Custom_AddListMenuItems(m, ctx)) return; }

4. You can override AddListMenuItems function by Implementing Custom_AddListMenuItems(m, ctx) function in any global place(I did it in master page.). Do not put any code in this function except return false True;

5. No context menu will be displayed for list items.

Monday, January 5, 2009

Catch the exception caused by massive file size upload in asp.net 2.0

Put the code in Global.asax under c:\Inetpub\wwwroot\wss\VirtualDirectories\80

void Application_Error(object sender, EventArgs e)

{

//To catch the error caused by masssive file size upload more than 4MB.

HttpException httpEx = Server.GetLastError() as HttpException;

if(httpEx.ErrorCode == -2147467259)

{

HttpContext.Current.Server.ClearError ();

HttpContext.Current.Server.Transfer("ErrorMessage.aspx");

}

}

Friday, January 2, 2009

Few Interesting Things about IIS6

  1. While uploading, IIS6 never returns any error until it completely absorbs the uploaded file.

Tuesday, November 25, 2008

Enable Session in SharePoint

In Web.Config file, modify the following string.

<pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" />


<!--<add name="Session" type="System.Web.SessionState.SessionStateModule"/> -->
Change into:

<add name="Session" type="System.Web.SessionState.SessionStateModule"/>