刘政道 - 应用程序框架

《31天学会CRM项目开发(C#编程入门及项目实战)》作者,IT经理,程序员
  博客园  :: 新随笔  :: 联系 :: 管理

SharePoint Designer 开发 Aspx表单

Posted on 2008-10-08 13:30  刘政道  阅读(562)  评论(0编辑  收藏  举报

转载:http://ceapet.com/blog/?p=363

 

SharePoint Designer 开发 Aspx表单
目标,在pages目录下开发test.aspx,要求该页面能使用网站集的母版页,实现页面与其它网站页面布局一致。

使用SharePoint Designer打开http://moss,打开pages文件夹,右键新建aspx页,删除默认内容,将以下内容复制到页面中。

<%@ Page Language=”C#”  MasterPageFile=”../_catalogs/masterpage/default.master”%>
<%@ Import Namespace=”Microsoft.SharePoint”%>
<%@ Import Namespace=”System.Collections” %>
<%@ Import Namespace=”Microsoft.SharePoint” %>
<%@ Import Namespace=”Microsoft.SharePoint.WebControls” %>
<%@ Import Namespace=”Microsoft.SharePoint.WebPartPages” %>

<asp:Content ContentPlaceHolderId=”PlaceHolderMain” runat=”server”>
<script type=”text/c#”  runat=”server” >
在服务器上运行的脚本
</script>

<asp:Label ID=”LabelMsg” runat=”server” ForeColor=”#339933″ Font-Size=”13px”></asp:Label>

</asp:Content>

通过SharePoint Designer 2007的代码自动提示功能,你会发现<script 标签下没有提供runat=”server”这个选项,导致以为<script不支持runat=”server”的误解,其实,这是必须的。

你可能还要设web.config

<SafeMode MaxControls=”200″ CallStack=”false” DirectFileDependencies=”10″ TotalFileDependencies=”50″ AllowPageLevelTrace=”false”>
<PageParserPaths>
<PageParserPath VirtualPath=”test.aspx” CompilationMode=”Always” AllowServerSideScript=”true” />
</PageParserPaths>
</SafeMode>