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

We are developing a custom module for SharePoint. The custom module is based upon SmartPart which means we have created UserControls. There was a problem with SmartPart deployment method as it requried to have a UserControls folder on web application root which we handled with a SharePoint Web Application Feature.

This custom module also required a separate database. We could setup the database manually but we also want to automate the database deployment and setup procedure.

Thanks to Alex. We decided to create an Application page where we are taking the following parameters:

  • Database Server
  • Database Name
  • Authentication Mode

Behalf of above provided information, we update the web.config with a connectionString. We are working on creating a database. After this we'll almost done.

The question I want to ask here is: The Application page we have how can we show this on Feature activation and when this custom module database successfully created we set the feature activated otherwise it will remain deactivate?

Thanks.

share|improve this question
    
It's not really clear from your question what you are trying to achieve. Am I right in thinking that you want to display a link to an application page when a feature is activated? If so then where do you want this link to appear? –  Charles Lee Mar 1 '10 at 16:54
    
@Charles There are two ways in my assumptions: 1) When you click on feature activation button that will redirect you to the application page and where I do the database setup thingy and once it is done successfully I'll activate the feature. 2) When you click on feature activation button feature activated and add up a link in Site Administration for an example "Configuration and Setup" on which I click it takes to the application page. If both are possible then which one should be preferred? –  Anonymous Mar 1 '10 at 17:13

1 Answer 1

up vote 2 down vote accepted

you cannot redirect to an application page when a feature is activated (what would happen if it is activated using STSADM for example or through feature dependencies...).

An alternative approach is to add a Web Part to the default page in the site that contains the configuration options or even better a delegate control that redirect the user to the configuration page if the site is not configured. (I would go for the second one...)

You can also add a link in Sites Settings to your configuration page using Custom Actions.

share|improve this answer
2  
Good point on the STSADM issue Wictor. I answered this question on another thread and I said there would be serious issues with this approach. This is just one of them. –  Charles Lee Mar 4 '10 at 9:43

Your Answer

 
discard

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