分享一切

OK...

在静态页面中,通过asp.net页面调用数据库数据

<script language="javascript" src="../WEBUI/NOVEL/ShowChapterData.aspx?Cid=295" type="text/javascript">
</script>
</body>
</html>

在shtml模板得最下面加入以上类似代码~

注意shtml得 编码最好是utf=8

然后:

 

 [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
    protected override void Render(HtmlTextWriter writer)
    ...{
        if(chapter.Load())
        ...{
            StringBuilder sb = new StringBuilder();
            sb.Append("document.getElementById('name1').innerText = '" + chapter.ChapterTitle + "';");
            sb.Append("document.getElementById('ctitle1').innerText = '" + chapter.ChapterTitle + "'; ");
         }
       
    }
在ShowChapterData.aspx 中加入以上类似代码!

这样就可以在shtml中显示数据库中的数据了~

posted on 2008-10-30 00:25  小伟999  阅读(307)  评论(0编辑  收藏  举报

导航