Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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);

}
Posted
Comments
Jameel VM 25-Jul-13 4:18am    
what is the problem now? did you got the json result in ajax success method?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900