1.this is my j query which is incomplete which i am try to click a row by using jquery i am getting row id when i click on particular row by using alert method after how to bind particular row data to text boxes
<script>
$(function () {
$('#grid tr').live('hover', function () {
$(this).toggleClass('clickable');
}).live('click', function () {
//alert($(this).find('td:first').text());
$(this).find('td').text()
var id = ($(this).find('td:first').text());
alert(id);
$.ajax({
url: '@Url.Action("BindUser", "Home")',
type: 'post',
data: { id: id }
});
})
});
</script>
2)After Getting the id by using url action redirecting to controller Method by using the id iam retreving the data but i cant get the data to textboxes.
public ActionResult BindUser(int id)
{
UserDb tbl = new UserDb();
SelectUserAccByPersonID_Result result1 = new SelectUserAccByPersonID_Result();
var UserSelect = db.SelectUserAccByPersonID(id).ToList();
ViewBag.txtFatherSurname = UserSelect.Select(j => j.txtFatherSurname).Single();
ViewBag.txtUserName = UserSelect.Select(j => j.txtUserName).Single();
ViewBag.txtPassword = UserSelect.Select(j => j.txtPassword).Single();
return View(tbl);
//UserDb tbl = new UserDb();
//var UserSelect = db.SelectUserAccByPersonID(id).ToList();
//return Json(UserSelect);
}