Posts

Showing posts from May, 2012

SharePoint 2010 : New CamlDesigner (CAML Builder)

Image
CAML Designer (Known as CAML Builder) is a great tool for generating CAML Query and some of the advanced CAML search result. This tool is created by SharePoint MVP Karine Bosch and Andy Van Steenbergen. You can download the tool from here.

Some of the feature contains by CAML Designer.
You can connect three ways: using the server object model using the client object model using the SharePoint web services UI support Ribbon UI support for LookupId='True' (filter on the ID of a lookup value)  UI support for QueryOptions UI support for Query all files and folders by using (ViewAttributes Property of the SPQuery Class) Code snippets The Server Object Model The .NET Client Object Model The web services Drag and drop functionality 
Problems  Not supported MOSS only works in SharePoint 2010. Design issue : Query main Screen Scroll-bars missing  ex. Files and folder Options not visible (Query Options from the ribbon)Code snippets Problems example : Server Object model (ViewFields missing…

Web Part Life Cycle

Web Part Life Cycle OnInit: Controls Initialization (happens earlier in the lifecycle - view state changes have not been done yet and tracking of it has not been turned on.)

OnLoad: Occurs when the controls are loaded by the page load event.

CreateChildElement: Create any child controls that controls contain.

EnsureChildElement : Ensure that CreateChildElement Event is complete. Use this to guarantee that control exist it before referencing it.

OnPreRender:  All controls are fully loaded on the page.

RenderContents: Render Content Inside the Control
OnPreRender All controls are fully loaded on the page.VewState is LoaedAll control values are currentViewState is not saved and can still be changedLast chance to change the property of the controlsOnPreRender Use Update any control property based on the other Professionalization properties.Get data from databaseMake web service callsConnect data bindingDo any stuff that depends on the state and values of child controls Registor  RegistorCli…

SharePoint 2010: Using “IN” Operator In CAML

CAML contains following operators: 
Eq: equal Geq: greater than or equal Gt: greatoer then Leq: lower than or equal Lt: lower than BeginsWith Contains IsNull IsNotNull Includes (new in SharePoint 2010) In (new in Sharepoint 2010)   I never tried to use the “IN” Operator. I thought most of my other friends do not know about this. So here is IN” Operator CAML Query.   <Where>       <In>          <FieldRef Name='ID' />          <Values>             <Value Type='Counter'>5</Value>             <Value Type='Counter'>6</Value>             <Value Type='Counter'>7</Value>          </Values>       </In>    </Where>
And My C# Window Application Code 
 private void button2_Click(object sender, EventArgs e)         {             using (SPSite _site = new SPSite("http://home"))             {                 using (SPWeb oWebsite = _site.OpenWeb())                 {                      SPList …

Implementing Ajax Tool Kit with SharePoint 2010

Image
Implementing Ajax Tool Kit


I used Ajax 3.0.30930.28736 dll for this project. Because as we know SharePoint 2010 working in .Net 3.5 Framework. Ajax dll 3.5 or more than that used .Net 4.0 framework.Custom Master Page contains Ajax Tool kit reference. When feature activated custom master page applied to your SharePoint site.Use Visual Web Part contains  Ajax Tab ValidatorCallout ControlFollowing Ajax reference already added to the Master page. First register the Ajax Control Toolkit namespace in the masterpage file by putting the following line at the top of the file: <%@ Register Assembly="AjaxControlToolkit, Version=3.0.30930.28736,
 Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"
Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> Then remove the ScriptManager registration from the master page by removing the following line:
<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false"
Enable…

SharePoint 2010: Three ways to change Home Page

Image
From Browser 

Open SharePoint SiteNavigate to page you are going set as Home page.Click to the home pageClick Make Home page from ribbon under Page Actions Group.
Property bag Feature
Open visual Studio 2010.Create new empty SharePoint Project “SetHomePage”.Add new empty element “HomePagePropertyBag”Copy the relative page URL that you want to set as home page.Write the following lines your Properbag features.  <?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<PropertyBag Url="" ParentType="Folder" RootWebOnly="false">
<Property Name="vti_welcomePage" Type="string"
Value="lib/TestWelcomePage.aspx"></Property>
</PropertyBag>
</Elements>
SharePoint Object model
Open visual Studio 2010.Create New Empty SharePoint Project “SetHomePageByCode”Add new featureAdd new feature recover.On feature activation…

SharePoint 2010 Calendar: Remove Custom Commands tab and Add new export event button in view tab

Image
To achieve this functionality we have to first hide the custom commands tab from event list.
Open Visual Studio. Create SharePoint Empty project.Add UserControl give it name CalendarFeature.Include dll in your project from Path : C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.Web.CommandUI.dllWrite the following lines of codes in ascx file. protectedvoid Page_Load(object sender, EventArgs e)         { SPRibbon ribbon = SPRibbon.GetCurrent(this.Page); if (ribbon != null)             {                 ribbon.TrimById("Ribbon.CustomCommands");             }         } Open SharePoint Designer edit calendar DispForm.Aspx(edit in advanced mode.)Add the following lines to register TrimCustomAction.ascx in your page. <%@Registersrc="/_ControlTemplates/CalendarFeature/TrimCustomAction.ascx"tagname="RemoveCalEvent"tagprefix="Trim"%> Then find "PlaceHolderMain" text from DispForm.aspx page after write the fo…