c# - pull data from the database with the aspx div -
i want data database div structure in below code. example, when there 5 records in database composed of 5 pieces of panel. using sql , aspx.
panel structure;
<div class="panel panel-default text-center"> <div class="panel-heading"> <span class="fa-stack fa-5x"> <a href="#"><img src="/images/aa.png" width="100" height="125" /></a> </span> </div> <div class="panel-body"> <h4><a href="#">yayın adı</a></h4> <p>0. sayı</p> <p>0 görüntülenme</p> <a href="#" class="btn btn-primary">oku</a> </div> </div>
if want use jquery, it's pretty simple:
- create web service exposes function perform database query
- add scriptmethod attribute function , scriptserivce tag class
add following code page:
$(document).ready(function() { $.ajax({ type: 'post', url: '/url/to/your/service', success: function(data) { //the data object contain data returned web service }, error: function() { /*take care of errors here*/ } }); });
you use ajax without jquery, that's i'm familiar with.
Comments
Post a Comment