show all names found in table (tb) when click display button

Posted by Ahmedsa under jQuery on 7/21/2016 | Points: 10 | Views : 128 | Status : [Member] | Replies : 1
I need to show all names found in table tb and display as list when click button display
by jquery
by code below i can add success but how to take data from column name and show as list
this what i need actually

Layout = null;

<!DOCTYPE html>

<meta name="viewport" content="width=device-width" />
<script src="~/Scripts/jquery-1.10.2.js"></script>

$(function () {
$("#btn").click(function ()
var x = $("#txt1").val();
var y = $("#txt2").val();
var z = $("#mycountry").val();
$("#tb").append("<tr> <td>" + x + "</td> <td>" + y + "</td> <td>" + z + "</td><td> <input type='button'class='c' value='Delete'/></td><td> <input type='button' class='d' value='Edit'/></td></tr>");

$("#tb").on("click", ".c", function () {
$("#tb").on("click", ".d", function () {
var row = $(this).closest('tr').toggleClass("editing");
row.find("td").slice(0, 3).prop("contenteditable", row.hasClass("editing"));

.editing {
background: yellow;
ID<input type="text" id="txt1" /><br />
Name<input type="text" id="txt2" /><br />
Country: <select id="mycountry">
</select><br />
<input type="button" value="add" id="btn" />
<input type="button" value="display" id="btndis" />

<tbody id="tb"></tbody>


Posted by: Bhuvanesh6 on: 7/22/2016 [Member] Starter | Points: 25

I believe you are trying to bind the data from database to the UI.
Have you implemented any code to fetch the data from database and send to UI, a kind of service or CODE using entity framework.

Entity Framework:
which is responsible to get data from database and assign to model and which can be displayed in UI in entity frame work.

Web API/ Web Service
Service which will return you Json object of data from the database and assign to the UI.

Please share the C# code, if implemented.



Ahmedsa, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response