Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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 .
Posted

1 solution

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

ASP.NET
<div id="divDynamic" runat="server">
</div>


C#
string sValueTobeShowninDiv ="";

divDynamic.InnerHTML=sValueTobeShowninDiv;


You can put data from DB in the string variable and show it in the div.

Hope This Helps!!!
 
Share this answer
 
Comments
aimanbios 6-Jul-13 14:39pm    
thank you Siddhesh Patankar its work good but another qustion how can binding data from datatable to more than one div like grideview .
Mohamed Mitwalli 6-Jul-13 14:57pm    
Mark it as answer if it Solve your problem :D Then Post another Question
Mohamed Mitwalli 6-Jul-13 14:59pm    
5+ InnerHTML if you want apply some style already store in DataBase
, InnerText it will bind As it is .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900