SharePoint:修改FormServer.aspx页面实现自定义逻辑

来源:互联网 发布:实时数据库 开源 编辑:程序博客网 时间:2024/05/18 13:23

有时候,我们需要在用户打开Infopath表单的时候进行一些判断。 例如,我现在遇到一个问题就是,某些用户登陆SharePoint的时候使用的是公用帐号,但是在填写表单时肯定要有所区分。那么如何在表单打开的时候进行干预呢?答案是重写OnPreInit事件。

注意:不能在OnLoad中做,已然来不及了。 

<%@ Page     inherits="Microsoft.Office.InfoPath.Server.Controls.FormServerPage,Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"    EnableSessionState="true"    AutoEventWireup="false"    EnableViewState="false"    LinePragmas="false"    Language="C#"    ValidateRequest="true"%><%@ Register Tagprefix="InfoPath" Namespace="Microsoft.Office.InfoPath.Server.Controls" Assembly="Microsoft.Office.InfoPath.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>    "server">        "margin: 0px;overflow:auto;">            
"server" id="HostingForm" method="post" enctype="multipart/form-data" style="width:100%;"> "FormControl" Style="width:100%;" runat="server"/>
.csharpcode, .csharpcode pre{font-size: small;color: black;font-family: consolas, "Courier New", courier, monospace;background-color: #ffffff;/*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt {background-color: #f4f4f4;width: 100%;margin: 0em;}.csharpcode .lnum { color: #606060; }.csharpcode, .csharpcode pre{font-size: small;color: black;font-family: consolas, "Courier New", courier, monospace;background-color: #ffffff;/*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt {background-color: #f4f4f4;width: 100%;margin: 0em;}.csharpcode .lnum { color: #606060; }
原创粉丝点击