您的位置:首页 > 编程语言 > ASP

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

2007-01-12 14:47 639 查看

<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中显示数据库中的数据了~
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐