1

Is there a way I can use the sharepoint controls in a ASP.NET web application like any other controls that come out of box for ASP.NET? If yes, what are the pre-requisites I need to install?

Thank you, Harsha

4 Answers 4

3

Yes, you can use SharePoint "controls" in an ASP.NET application, as long as the application is running in SharePoint.

In other words, the prerequisite is SharePoint.

Sign up to request clarification or add additional context in comments.

1 Comment

There are so many nice controls in Sharepoint. It would be great if we can use them outside (in ASP.NET application alone)
1

Most controls have internal dependencies on SharePoint (i.e. they use SPContext or SPWeb internally). Also, since they are contained within the Sharepoint Assemblies, you can not just take the .dlls and put them in your app.

In short: In most cases, it will be better to re-build them using reflector. Which one are you looking at?

Comments

0

What specific controls are you referring to? Those that you find in SharePoint Designer?

If you are referring to Web Parts in WSS v3, those that are using the ASP.NET Web Part as the base web part (the recommended approach) may work fine in ASP.NET since the Web Part class inherits from Panel which inherits from Web Control (going from memory here) - all ASP.Net classes. It would just depend on whether the web part has any SharePoint specific code which is highly dependent upon the web part.

Comments

0

Host the application in SharePoint's _layouts directory (see this video for more details). Your ASP.NET app will then be "running in SharePoint" and have access to all SharePoint controls.

Note that some controls don't work unless they are running on an actual SharePoint page.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.