I am confused with the choice between several ways to get the result in ASP.NET.
For example, managing a web form SqlDataSource, you retrieve data from a database and display results in other controls, such as DataGridView, BulletedListetc. However, all these things can be written in C #, creating a line that will hold your HTML codes with the extracted data, then you paste your HTML code in divwith innerHTML. Who cares?
Example:
[ <div id='block1' runnat='server'></div]
and in CodeBehind
[ block1.innerHTML = myString;]
After writing C # SqlConnect, Loops, Datatable code, you put the value of your HTML string in myString.
Why not implement everything with C #?
source
share