Infopath Notify 弹出提示信息

在InfoPath里弹出窗口,可以用Notify(message)就可以实现,不过要修改layouts文件夹里面一个FormServer文件

修改后的代码为

    
        
    
<%@ 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 void XmlFormView1_NotifyHost(object sender, NotifyHostEventArgs e)
    {   
        string jsCode = String.Format("alert(\"{0}\");", e.Notification); 
        ClientScript.RegisterStartupScript(typeof(string), "AlertScript",jsCode, true);
        }
    

</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" OnNotifyHost="XmlFormView1_NotifyHost" Style="100%;" runat="server"/>
        </form>
    </body>
</html>
原文地址:https://www.cnblogs.com/gzh4455/p/2613239.html