Monday, July 27, 2009
Create a sharepoint webpart
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
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 be required to put following java script in the login page.
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
- 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"/> |