InfoPath 浏览器中弹出对话框

修改XmlFormView控件增加NotifyHost事件

<InfoPath:XmlFormView id="FormControl" Style="width:100%;" runat="server" onnotifyhost="FormControl_NotifyHost"/>

<script runat="server">
    protected void FormControl_NotifyHost(object sender, NotifyHostEventArgs e)
    {
        string jsCode = String.Format("alert('{0}');", e.Notification);
        ClientScript.RegisterStartupScript(typeof(string), "AlertScript", jsCode, true);
    }
</script>

在InfoPath中调用

public void CTRL1_5_Clicked(object sender, ClickedEventArgs e)
{
        this.NotifyHost("String");
}

posted on 2014-04-28 14:30  MySPS  阅读(251)  评论(0)    收藏  举报

导航