Loading...

Saturday, July 9, 2011

Modal Popup with Content Editor Webpart

Open the sharepoint Site
In Ribbon,Find Insert Link-->Select Webparts-->In Media and Content Category-->Select Content Editor Webpart.-->Add/Edit the webpart

In SP 2010, Select Contents in CEWP, Format--> Html Source in the ribbon,
Add the javacript code
<script type="text/javascript">
     function OpenDialog(URL) {
         var NewPopUp = SP.UI.$create_DialogOptions();
         NewPopUp.url = URL;
         NewPopUp.width = 700;
         NewPopUp.height = 350;
         SP.UI.ModalDialog.showModalDialog(NewPopUp);
     }
 script>

=  "javascript:OpenDialog(‘../_layouts/MyAppPage/MyPage.aspx’)"--To Make it Server relative.
So that Dialog box opens anywhere in site collection

Monday, June 13, 2011

Debugging On Integration server

If you are not able to debug on Integration server
Do One thing,  Naviagate to
Central Admin Site -->Security -->configure Your service account here
reset IIS
when You attach to worker process you must me able to see w3p.exe on your user account.

Friday, June 10, 2011

Why the webpart dont get deployed even if added to solution?

In large Visual studio 2010 , if the webpart is note getting deployed to the site after successful build and deploy
try following
Check in the package designer , if your webpart name exists in package
if not then the feature designer and click on the Edit File Link,Add the webpart you are searching for.Package-->Build-->Deploy.

Thursday, June 2, 2011

How to Attach the EventReceiver to Particular List



1)Create  EventReceiver  ,Make sure that  Its  Feature  Scope  is Web Scoped,   Otherwise event will fire on all the Lists.

2)Make sure that ,Event receiver feature is deployed in the scope where List Exists.

3)In Element.xml , In receiver tag, modify the ListTemplateID to ListUrl="List/ListName"
Make sure that the path for ListUrl is correct, It is different for document libraries,Announcements and other list types
If its not correct then you will get Nativehr error


4)If still eventreceiver dont get  fired then Check SharePointProjectItem.spdata
In ProjectItem tag , check for Supported scope .It should be web only

4)Write the solutionValidator   to Validate above things before deploying the Event Receiver.

Thursday, May 26, 2011

Beauty Of Linq in Sharepoint

Linq Query to Get the ListItems for List in  One Step
Namespace:System.Linq, System.Collections.Generic    

IEnumerable results = lstMembershipList.Items.Cast().Where(item => item["EntityType"].ToString().Trim() == "Project" && item["Association"].ToString().Trim().ToUpper() == associationType

Monday, May 23, 2011

Search Architecture in Sharepoint 2010

While customizing the Search,Its very much important to understand the search Architecture

1)Create the metadata columns which gets values from Taxonomy term store
In background  Metadata property and Crawl properties are generated which requires crawl time
Now your task is to map  and index this properties for search.

2)Create the Search Scope

3)Use query object model  to query scope and to show  customize  metadata columns in grid

I will make this post more compehensive with Images and navigations . Happy Reading!!

Tuesday, May 17, 2011

Sharepoint 2010 Enhanced Event receivers

Following  event is called when site collection is created
public class EventReceiver1 :SPWebProvisioningProvider

{
public override void Provision(SPWebProvisioningProperties props)


{

throw new NotImplementedException();

}
 

}

Following event is called when subsite is created


public class EventReceiver2 : SPWebEventReceiver


{
public override void WebAdding(SPWebEventProperties properties)

{

base.WebAdding(properties);

}
}