我如何使用c#,css将数据绑定到div [英] how i can binding data to div using c# , css
本文介绍了我如何使用c#,css将数据绑定到div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我需要有关将数据从sql server数据库直接发布到div的帮助,而无需使用c#和css等文本工具来使用Web工具.
hi every body
i need help about posting data from sql server database to div directly without using web tools like textbox by c# and css .
推荐答案
在.aspx页面中,使用以下方法创建div属性设置为runat ="server"并为其指定一个ID.
然后,在后面的代码中,可以使用div标记的InnerHtml属性将数据插入数据库中.
例如
In your .aspx Page create a div with attribute as runat="server" and give an ID to it.
Then in the code behind you can use the InnerHtml property of the div tag to insert data into database
e.g
<div id="divDynamic" runat="server">
</div>
string sValueTobeShowninDiv ="";
divDynamic.InnerHTML=sValueTobeShowninDiv;
您可以将DB中的数据放在字符串变量中,并在div中显示.
希望对您有帮助!
You can put data from DB in the string variable and show it in the div.
Hope This Helps!!!
这篇关于我如何使用c#,css将数据绑定到div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文