/Default.aspx Secret
Created
June 28, 2018 04:25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Webform.Default" %> | |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<title></title> | |
</head> | |
<body> | |
<form id="form1" runat="server"> | |
<div> | |
<table border="1" style="border-collapse: collapse"> | |
<thead> | |
<tr> | |
<th>Product Id</th> | |
<th>Product Name</th> | |
<th>Price</th> | |
<th>Stock</th> | |
<th>Status</th> | |
</tr> | |
</thead> | |
<tbody> | |
</tbody> | |
</table> | |
</div> | |
</form> | |
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> | |
<script> | |
$(function () { | |
$.ajax({ | |
url: "Default.aspx/GetData", | |
type: "GET", | |
contentType: "application/json;charset=utf-8", | |
dataType: "json", | |
success: function (result) { | |
var data = JSON.parse(result.d); | |
$.each(data, function (i, v) { | |
$("tbody").append( | |
"<tr>" + | |
"<td> " + v.ProductID + "</td > " + | |
"<td> " + v.ProductName + "</td > " + | |
"<td> " + v.Price + "</td > " + | |
"<td> " + v.StockQty + "</td > " + | |
"<td> " + v.Status + "</td > " + | |
"</tr>" | |
); | |
}) | |
} | |
}); | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment