asp.net2005中,在shtml页面中,通过asp.net页面调用数据库数据~

来源:互联网 发布:中级程序员考试费用 编辑:程序博客网 时间:2024/05/03 23:41
<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中显示数据库中的数据了~

原创粉丝点击