locked
Site Page with code behind in Sandbox solution RRS feed

  • Question

  • Hi

     

    Is it possible to write a Web-part page with code-behind and deploy it as a Sandboxed solution?

    Which is the best approach?

    Thanks

    Thursday, June 9, 2011 4:12 PM

Answers

  • Hi leberns,

     

    For your issue, as far as I know it’s impossible to write a web-part page with code-behind and deploy it as a Sandboxed solution.

    More information:

    http://msdn.microsoft.com/en-us/library/ff872402.aspx

     

    Thanks,

    Porter Wang

    • Marked as answer by KeFang Chen Thursday, June 16, 2011 2:17 AM
    Tuesday, June 14, 2011 10:45 AM
  • For the sandbox and with web parts, you can use the project in visual studio that is named web part, you can use visual web part, so ofcourse can not create a page.

    Best approach is to create an application page in the layouts and that won't be in sandox solution, that's for the page.

    What if, you want to use a sandbox solution, then from SharePoint UI create a page with the webpart zones you want, then deploy your sandbox solution as a normal webpart in that page.


    Mai Omar Desouki | Software Consultant | Infusion | MCP, MCTS, MCPD, MCITP, MCT Microsoft Certified Trainer & MCC Microsoft Community Contributor | Email: mai_omar_86@live.com
    • Marked as answer by KeFang Chen Thursday, June 16, 2011 2:17 AM
    Tuesday, June 14, 2011 11:29 AM

All replies

  • Hi leberns,

     

    For your issue, as far as I know it’s impossible to write a web-part page with code-behind and deploy it as a Sandboxed solution.

    More information:

    http://msdn.microsoft.com/en-us/library/ff872402.aspx

     

    Thanks,

    Porter Wang

    • Marked as answer by KeFang Chen Thursday, June 16, 2011 2:17 AM
    Tuesday, June 14, 2011 10:45 AM
  • For the sandbox and with web parts, you can use the project in visual studio that is named web part, you can use visual web part, so ofcourse can not create a page.

    Best approach is to create an application page in the layouts and that won't be in sandox solution, that's for the page.

    What if, you want to use a sandbox solution, then from SharePoint UI create a page with the webpart zones you want, then deploy your sandbox solution as a normal webpart in that page.


    Mai Omar Desouki | Software Consultant | Infusion | MCP, MCTS, MCPD, MCITP, MCT Microsoft Certified Trainer & MCC Microsoft Community Contributor | Email: mai_omar_86@live.com
    • Marked as answer by KeFang Chen Thursday, June 16, 2011 2:17 AM
    Tuesday, June 14, 2011 11:29 AM