Posts

Solution Struck Retracting in SharePoint 2010

Image
I have faced the below problem when am trying to retract the solution: Solution is here : You are struck up with retracting the solution,  do the following things  its worked for me : run the below command using PowerShell stsadm -o enumdeployments The above command will listed the solutions which are in In progress and pending status cancel the pending task Remove-SPSolution -Identity YOURSolution.wsp -force The above solution has gone now. But now you will most likely  get an error message when re-deploying your solution: "A feature with the ID has been already installed, use the force  attribute to re-install the solution" Install-SPSolution -Identity YOURSolution.wspp -AllWebApplications  -GACDeployment –force

Validate the People Editor Control using JavaScript

   if (document.getElementById( ' <% = PeopleEditor.ClientID  %> ' ).value == "" ) {                 alert( "Please enter the user name") ;                                  return false ;             }

Programmatically upload file to SharePoint Document Library

Method 1 : Stream fStream = upfile.PostedFile.InputStream;                             byte [] contents = new byte [fStream.Length];                             fStream.Read(contents, 0, ( int )fStream.Length);                             fStream.Close();                             string Filename = upfile.FileName;                    ...

Export Gridview to PDF

http://www.dotnetspider.com/resources/29759-Exporting-GridView-PDF.aspx

Using the SharePoint ‘Person or Group’ field in code

 string[] Groupname = PLPSurveyAttendees.CommaSeparatedAccounts.Split(',');                                     string Users = string.Empty;                                     foreach (string survueygroupname in Groupname)                                     {                                         SPGroup ogrp = oWeb.Groups[survueygroupname];                                                                            User...

Delete SharePoint Lists Programmatically

 using (SPSite osite = new SPSite("SiteURL"))             {                 using (SPWeb oweb = osite.OpenWeb())                 {                     SPListCollection olistcoll = oweb.Lists;                     Hashtable ht = new Hashtable();                     foreach(SPList olist in olistcoll)                     {                         if (olist.Title.StartsWith("Test"))                         {                             ht.Add(olist.ID, olist.Title);    ...

Bind the SharePoint List Values to DropDownList using SPDataSource

<SharePoint:SPDataSource runat ="server"  ID="spMaster"  DataSourceMode="List" SelectCommand="<Query><OrderBy><FieldRef Name='SortOrder' Ascending='true' /></OrderBy></Query>" >                                 <SelectParameters>                                 <asp:Parameter Name="WEbUrl" DefaultValue="/SiteName/" />                                 <asp:Parameter Name="ListName" DefaultValue="Your List Name Here" />                                 </SelectParameters>                                 </SharePoint:SPDa...