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

When I am adding any application page(.aspx) to my Module in the Visual Studio Project of SandBox Solution, it is always adding that page in Layouts(Mapped) folder. And not adding that page in the Module.

That's why I am not able to open my page using JavaScript. Because it wants the Layout reference. And If Layout folder is their, then I am not able to create the Package or not able to deploy directly.

So How can I add .aspx page to Module in SandBox Solution ?

share|improve this question

2 Answers 2

What's good to do is, deploy your .aspx page within the module, define zones int he .aspx page, and create your logic and code into webparts, and in the module's definition, insert the webparts into the desired zones.

See this example: http://amalhashim.wordpress.com/2013/02/14/sharepoint-deploy-webpart-page-using-module/

Do as mentioned in the article, but ignore the .cs file, just insert a webpart zone in your .aspx file, and in the module connect the webpart to the page.

You can use only webpart project item, you won't be able to use the visual webpart, here is an extension for VS that will enable you to create visual webpart in Sandbox:

http://visualstudiogallery.msdn.microsoft.com/8e602a8c-6714-4549-9e95-f3700344b0d9/

share|improve this answer

You cannot directly add a .aspx page through visual studio. You will have to use a workaround for that. Its basically creating a Module, changing the name of the sample.txt file to the desired .aspx file. And then pasting the markup inside the new file.

Please see this link for more details:

http://www.wictorwilen.se/Post/Custom-application-pages-in-the-SharePoint-2010-Sandbox.aspx

share|improve this answer
    
I am able to display the webpart or some text using above mehtod, but I want to create some dynamic controls and have multiple lines of code in Code behind file. So using this I am not able to do this. So how can I do this ? –  Shahid Mar 14 '13 at 6:34

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.