<script src="../../../Common/Scripts/Order/popup.js" type="text/javascript"></script>
    <script type="text/javascript">
        function ShowHtmlString() {

            var strHtml = document.getElementById("details").innerHTML;
            var pop = new Popup({ contentType: 2, isReloadOnClose: false, width: 640, height: 300 });
            pop.setContent("contentHtml", strHtml);
            pop.setContent("title", "html字符串示例");
            pop.build();
            pop.show();
        }
    </script>

<div id="details" style="display: none;font-size:medium;" runat="server">
        
    </div>
复制代码


后台代码:

复制代码
string rOrderId = e.CommandArgument.ToString();
                DataSet dsDetail= bf.GetDetailByRorderId(rOrderId);
                string html = "<table ><tr><td>冻结时间</td><td>失败信息</td></tr>";
                if (dsDetail != null && dsDetail.Tables != null && dsDetail.Tables[0].Rows.Count>0)
                {
                    for(int i=0;i<dsDetail.Tables[0].Rows.Count;i++)
                    {
                        DataRow dr=dsDetail.Tables[0].Rows[i];
                        html += "<tr ><td>" + dr["flCreateDate"] + "</td><td>" + dr["flLogInfo"] + "</td></tr>";
                    }
                }
                html += "</table>";
                details.InnerHtml = html;
                Page.RegisterStartupScript("ww", "<script>ShowHtmlString();</script>");
复制代码

首先要下载 popup.js,上面有很多例子。下载地址:http://pan.baidu.com/s/1f8qlu

posted on 2013-12-11 16:48  王洪洪  阅读(159)  评论(0编辑  收藏  举报