在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="width:100%;">
                <InfoPath:XmlFormView id="FormControl" OnNotifyHost="XmlFormView1_NotifyHost" Style="width:100%;" runat="server"/>
        </form>
    </body>
</html>

 

 

posted on 2012-07-28 15:56  gzh4455  阅读(275)  评论(0编辑  收藏  举报