Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Good Day,

We're working on custom module (Information Management System) for SharePoint. The project file of this module is a Class Library which contains User Controls. The User Controls was based upon SmartPart and AJAX Extension Toolkit. The module has a separate database which has tables/views/stored procedure.

On development environment, we deploy the module in following steps:

  • Restore the backup copy of the module database on the pre-production or test environment
  • Install AJAX Extension Toolkit
  • Modify web.config of web application for connection string, safecontrol entry of AJAX Extension, enablesessionstate set to true of pages, add AJAX Extension tag entry, and uncomment the following line:

    <add name="Session" type="System.Web.SessionState.SessionStateModule"/>

  • Create a UserControls folder in web application root and copy all User Controls there. As SmartPart will (can only, I assume) locate User Controls

This is how we do. I sure this is not a good practice and there should be ways to do this in much better way.

One of my question is can we create a separate web.config file which will have all required tags and settings there so we won't need to change web application web.config? Just guessing!

As all WSPBuilder users are aware of this, that you cannot modify the manifest.xml file and no good integration with web application folder. I don't why SmartPart pick the web application root folder to locate User Controls. Is it possible that SmartPart can start picking User Controls from 12-Hive's TEMPLATE\CONTROLTEMPLATES folder?

We are looking for a more appropriate way of doing this. And for me, specific to this case, a good practice would be eliminate all the manual configuration/setup steps. The module user doesn't even need to do a single manual setup to make this thing up and running. I am sure there are many ways of doing this much better than this but what would be the best way to handle it.

Also, I would like to have suggestions on Custom Module development on SharePoint good (or best) practices.

We are using a set of tools like WSPBuilder, Visual Studio Extension for WSS, STSDEV, SPVisualDev, SharePoint Content Deployment Wizard, SharePoint Administration Tools, SharePoint Installer.

Thanks.

Have a Good Day!

share|improve this question
add comment

2 Answers 2

I havent worked alot with smartpart, but i think you can set the path for the user control in the webpart xml manifest. Also since the code is on codeplex, you should be able to create your own version of the smartpart that suits your needs. On a related note read Eli Robillard's blog post on pros/cons with smartpart here.

Regarding web.config changes these should if at all possible be handled automatically. You can use SPWebConfigModification class to deploy web.config modifications consistently across both environments and web frontend servers. This class can be very tricky and unforgiving, so i recommend that you never apply more than one modification at the time (if you deploy using batch or powershell collect all web.config modifications in one bulk update). Also read up on the pitfalls of this class here, here and here (note some of the pitfalls mentioned was solved in SP2). Setting up Ajax in web.config should definately also be done using this technique.

From reading your question i cant really tell if you are using solutions and features for deployment. If not, this is very much a best practice for consistent deployment.

share|improve this answer
    
The source of SmartPart available on codeplex is for 1.1 not for Return of SmartPart which is updated. Right? –  Anonymous Feb 17 '10 at 9:03
add comment

I have never used smart part myself. However, I use the VseWss 1.3 tools and can create my own webparts just fine. I can also put my .ascx files in a subfolder of the controltemplates folder. I have created several webparts this way. The .ascx file contains the html and controls and the class file does all the work. There are examples on the internet on using VseWss to create webparts. This also allows me to use solutions and features.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.