Can you use “user controls” to include file code in sharepoint 2010 web parts? If not, how do you include a .html file(located in project folder) inside a web part .ascx code?
Any help would be appreciated
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you have created a SharePoint project, like cicorias suggested, you can map the CONTROLTEMPLATES (where all UserControls and their referencing files goes to) folder by right-clicking the project -> Add -> SharePoint Mapped Folder -> TEMPLATES/CONTROLTEMPLATES.
Then it should automatically create a folder within, that is named like your SP project and in this folder you put your .html file. In your UserControl you’d reference it like this:
When you deploy your solution, the .html will also be deployed, so it’s always in the place where it’s supposed to be.