zoukankan      html  css  js  c++  java
  • SharePoint:修改FormServer.aspx页面实现自定义逻辑

    有时候,我们需要在用户打开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" %>
    <script runat="server">
    protected override void OnPreInit(EventArgs e){
        Session["Test"]="chenxizhang";
        Response.Redirect("http://server2003:8080/Login.aspx");
    }
    </script>
    <html>
        <head runat="server">
        </head>
        <body style="margin: 0px;overflow:auto;">
        
            <form runat="server" id="HostingForm" method="post" enctype="multipart/form-data" style="100%;">
                    <InfoPath:XmlFormView id="FormControl" Style="100%;" runat="server"/>
            </form>
        </body>
    </html>
    
    
  • 相关阅读:
    模块三 GO语言实战与应用-条件变量sync.Cond(上)
    模块三 GO语言实战与应用-sync.Mutex与sync.RWMutex
    模块三 GO语言实战与应用-更多的测试手法
    模块三 GO语言实战与应用-测试的基本规则和流程(下)
    模块三 GO语言实战与应用-测试的基本规则和流程(上)
    模块二 GO语言进阶技术-PANIC函数、RECOVER函数以及DEFER语句(下)
    CentOS7 相关命令-sunziren
    Thymeleaf如何回填复选框?-sunziren
    Thymeleaf中如何判断字符串是否包含或者不包含某个子串?-sunziren
    MySQL Innodb Engine--修改数据时先写Buffer Pool还是先写Redo Log
  • 原文地址:https://www.cnblogs.com/chenxizhang/p/1640133.html
Copyright © 2011-2022 走看看