jqury registration:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Registration.aspx.cs" Inherits="Registration.Registration" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="scripts/grid.addons.js"></script>
<script src="scripts/grid.base.js"></script>
<script src="scripts/grid.celledit.js"></script>
<script src="scripts/grid.common.js"></script>
<script src="scripts/grid.filter.js"></script>
<script src="scripts/grid.formedit.js"></script>
<script src="scripts/grid.grouping.js"></script>
<script src="scripts/grid.import.js"></script>
<script src="scripts/grid.inlinedit.js"></script>
<script src="scripts/grid.jqueryui.js"></script>
<script src="scripts/grid.locale-ar.js"></script>
<script src="scripts/grid.locale-bg.js"></script>
<script src="scripts/grid.locale-ca.js"></script>
<script src="scripts/grid.locale-cn.js"></script>
<script src="scripts/grid.locale-cs.js"></script>
<script src="scripts/grid.locale-de.js"></script>
<script src="scripts/grid.locale-dk.js"></script>
<script src="scripts/grid.locale-el.js"></script>
<script src="scripts/grid.locale-en.js"></script>
<script src="scripts/grid.locale-es.js"></script>
<script src="scripts/grid.locale-fa.js"></script>
<script src="scripts/grid.locale-fi.js"></script>
<script src="scripts/grid.locale-fr.js"></script>
<script src="scripts/grid.locale-gl.js"></script>
<script src="scripts/grid.locale-he.js"></script>
<script src="scripts/grid.locale-hr.js"></script>
<script src="scripts/grid.locale-hu.js"></script>
<script src="scripts/grid.locale-id.js"></script>
<script src="scripts/grid.locale-is.js"></script>
<script src="scripts/grid.locale-it.js"></script>
<script src="scripts/grid.locale-ja.js"></script>
<script src="scripts/grid.locale-kr.js"></script>
<script src="scripts/grid.locale-lt.js"></script>
<script src="scripts/grid.locale-me.js"></script>
<script src="scripts/grid.locale-nl.js"></script>
<script src="scripts/grid.locale-no.js"></script>
<script src="scripts/grid.locale-pl.js"></script>
<script src="scripts/grid.locale-pt-br.js"></script>
<script src="scripts/grid.locale-pt.js"></script>
<script src="scripts/grid.locale-ro.js"></script>
<script src="scripts/grid.locale-ru.js"></script>
<script src="scripts/grid.locale-sk.js"></script>
<script src="scripts/grid.locale-sq.js"></script>
<script src="scripts/grid.locale-sr-latin.js"></script>
<script src="scripts/grid.locale-sr.js"></script>
<script src="scripts/grid.locale-sv.js"></script>
<script src="scripts/grid.locale-th.js"></script>
<script src="scripts/grid.locale-tr.js"></script>
<script src="scripts/grid.locale-tw.js"></script>
<script src="scripts/grid.locale-uk.js"></script>
<script src="scripts/grid.locale-vi.js"></script>
<script src="scripts/grid.pivot.js"></script>
<script src="scripts/grid.postext.js"></script>
<script src="scripts/grid.setcolumns.js"></script>
<script src="scripts/grid.subgrid.js"></script>
<script src="scripts/grid.treegrid.js"></script>
<script src="scripts/grid.utils.js"></script>
<a href="scripts/index.html">scripts/index.html</a><a href="scripts/install.txt">scripts/install.txt</a><script src="scripts/jqDnR.js"></script><script src="scripts/jqModal.js"></script><script src="scripts/jquery-1.11.0.min.js"></script><script src="scripts/jquery-3.1.1.js"></script><script src="scripts/jquery-3.1.1.min.js"></script><script src="scripts/jquery-migrate-1.4.1.min.js"></script><link href="scripts/jquery-ui.css" rel="stylesheet" /><script src="scripts/jquery-ui.js"></script><link href="scripts/jquery-ui.min.css" rel="stylesheet" /><script src="scripts/jquery-ui.min.js"></script><link href="scripts/jquery-ui.structure.css" rel="stylesheet" /><link href="scripts/jquery-ui.structure.min.css" rel="stylesheet" /><link href="scripts/jquery-ui.theme.css" rel="stylesheet" /><link href="scripts/jquery-ui.theme.min.css" rel="stylesheet" /><script src="scripts/jquery.contextmenu.js"></script><script src="scripts/jquery.fmatter.js"></script><script src="scripts/jquery.jqGrid.js"></script><script src="scripts/jquery.jqGrid.min.js"></script><script src="scripts/jquery.searchFilter.js"></script><script src="scripts/jquery.sortable.js"></script><script src="scripts/jquery.tablednd.js"></script><link href="scripts/searchFilter.css" rel="stylesheet" /><link href="scripts/ui.jqgrid-bootstrap-ui.css" rel="stylesheet" /><link href="scripts/ui.jqgrid-bootstrap.css" rel="stylesheet" /><link href="scripts/ui.jqgrid.css" rel="stylesheet" /><link href="scripts/ui.multiselect.css" rel="stylesheet" /><script src="scripts/ui.multiselect.js"></script>
<script type="text/javascript">
$(function () {
$("#accordian").accordion({
heightStyle: "content",
active: 0,
collapsible: true
});
ShowGrid();
});
function save() {
var obj = new Object();
obj.name = $("#txtname").val();
obj.fname = $("#txtfathername").val();
PageMethods.SaveData(obj, onSucceess, onFailure);
function onSucceess(r) {
alert(r);
}
function onFailure(r) {
document.getElementById('NoDetails').innerHTML = '';
alert(r);
}
return false;
}
function ShowGrid() {
// jQuery("#tblregistration").GridUnload();
jQuery("#tblregistration").jqGrid({
url: '<%= ResolveUrl("~/Education.asmx/ShowEdu") %>',
contentType: "application/json; charset=utf-8",
datatype: "json",
height: '100%',
rowNum: 10,
width: 500,
cmTemplate: { sortable: false },
rowList: [10, 20, 30],
colNames: ['Click', 'Id', 'Name', 'Fname'],
colModel: [
{ name: 'Act', width: 20, index: 'Act', align: 'center', title: false },
{ name: 'txn_id', index: 'txn_id', width: 20, sorttype: "string", hidden: true },
{ name: 'name', index: 'name', width: 100, sorttype: "string" },
{ name: 'fname', index: 'fname', width: 100, sorttype: "string" }
],
pager: "#pager",
viewrecords: true,
rownumbers: true,
altRows: true,
caption: "Registration",
jsonReader: {
root: function (obj) { return obj.rows },
page: function (obj) { return obj.page },
total: function (obj) { return obj.total },
records: function (obj) { return obj.records },
id: "0",
cell: "",
repeatitems: false
},
gridComplete: function () {
var ids = jQuery("#tblregistration").jqGrid('getDataIDs');
if (ids.length == 0) {
//document.getElementById('NoDetails').innerHTML = 'No Education(s)';
}
else {
for (var i = 0; i < ids.length; i++) {
var cl = ids[i];
se = "<span tittle='Edit' style='display:inline-block' class='ui-icon ui-icon-pencil' onclick='EditRecords(" + cl + ")'></span> ";
ce = "<span tittle='Delete' style='display:inline-block' class='ui-icon ui-icon-trash' onclick='DeleteRecords(" + cl + ")'></span>";
jQuery("#tblregistration").jqGrid('setRowData', ids[i], { Act: se + ce });
}
//document.getElementById('NoDetails').innerHTML = '';
}
}
});
return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="scriptMg" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
<div id="accordian" style="height: 15px;">
<h3>REGISTRATION
</h3>
<table>
<tr>
<td>
<table>
<tr>
<td>
<table>
<tr>
<td>Name:
</td>
<td>
<input type="text" id="txtname" />
</td>
</tr>
<tr>
<td>Father Name
</td>
<td>
<input type="text" id="txtfathername" />
</td>
</tr>
</table>
<table>
<tr>
<td>
<button id="btnsave" onclick="return save();">Saves</button>
</td>
</tr>
<tr>
<td>
<table id="tblregistration">
</table>
<div id="pager">
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
No comments:
Post a Comment