ASP.net page without a code behind

前端 未结 6 1849
小鲜肉
小鲜肉 2020-12-13 11:48

I have an ASP.Net page with a C# code behind.

However, I\'ve been asked to not use a code behind - so that it will be easier to deploy in SharePoint.

Is the

6条回答
  •  不思量自难忘°
    2020-12-13 12:32

    By default Sharepoint does not allow server-side code to be executed in ASPX files. See this for how to resolve that.

    However, I would raise that having a code-behind is not necessarily difficult to deploy in Sharepoint (we do it extensively) - just compile your code-behind classes into an assembly and deploy it using a solution.

    If still no, you can include all the code you'd normally place in a codebehind like so:

    
    

提交回复
热议问题