سؤال

I am using WSPBuilder. I want to create the package that includes the MenuItemList and MenuWebpart. Requirement is create the feature for MenuItemList which holds the menu items. Webpart should fetch the menu items from the sharepoint list. and display as per CSS applied.

What I have done: I have created the WSPBuilder Project in VS2010. Under the Feature I have added the Blank Feature. Named as MenuItemsFeature. also i have added the visual webpart feature.\

Confusion: I am confused how to start coding for this scenario. I means, If both features are in same package, and second is dependent on first (Webpart is dependent on List) then how to set execution sequence will be done? While writing the Webpart code, How it predicts there is list, name with "MenuItemFeature" ? If I want to make this MenuItemList generic (scalable: to add columns runtime) then what i have to do ? there are so many confusion still in my mind... but initially i need to resolve these one. I read about WSPBuilder. but there is no such link for dependent feature available so far, as per my search.

Can somebody guide me proper sequence , how can i achieve this.

هل كانت مفيدة؟

المحلول

I strongly recommend you look at some tutorials for introductory web part development in SharePoint 2010, and also look at how to create List Instances from Features. Both are pretty standard tasks when it comes to development.

Here's a full tutorial on creating a web part in Visual Studio 2010.

List Instances are standard, out of the box Visual Studio 2010 Project Items which you can easily add to a solution - but only if you are using the standard SharePoint Development tooling and not mixing with WSPBuilder.

If you are limited to not using the Visual Studio 2010 SharePoint features, then here's a tutorial for creating a list instance by hand, which is how it's done in SharePoint 2007.

Also, have a look at Feature Activation Dependencies, if you're Web Part requires that the List Instance be created first.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top