Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:

$('table').delegate('td.EditRow','click',function () {
var $row = this;
var userid = $row.id;
$('#hdnUserId').val(userid);
$.ajax({
type: "POST",
url: "User_Create_Update.aspx/FillUserDetails",
data: "{'userid': " + userid + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
if (msg.d != '') {
$('#txtUserCode').val(msg.d.USRM_USER_CD);
$('#txtUserName').val(msg.d.USRM_USER_NAME);
$('#txtUserPswd').val(msg.d.USRM_PASSWORD);
$('#txtExpiryDate').val(msg.d.USRM_EXPIRY_DT);

}
//alert(msg.d);
}
});

$('#divPopUp').lightbox_me({
lightboxSpeed: 500,
centered: true,
closeClick: true,
closeEsc: true
})
});
XML
<System.Web.Services.WebMethod()> _
   <ScriptMethod(ResponseFormat:=ResponseFormat.Json)> _
   Public Shared Function FillUserDetails(ByVal userid As String) As DataTable

       Dim dt As DataTable = clsUSRM.GetAllById(userid)
       If dt.Rows.Count > 0 Then
           clsUSRM.USRM_USER_CD = userid
           clsUSRM.USRM_USER_NAME = dt.Rows(1).ToString()
           clsUSRM.USRM_PASSWORD = dt.Rows(2).ToString()
           clsUSRM.USRM_EXPIRY_DT = dt.Rows(3).ToString()
       End If
       Return dt
   End Function
Posted
Updated 31-Jan-13 1:50am
v3
Comments
Sandesh M Patil 30-Jan-13 7:22am    
Dont post same question multiple times
sayed farhan 30-Jan-13 7:51am    
my subject was not correct so that's why i have posted again
can u please help me
Kschuler 31-Jan-13 11:51am    
If something is wrong with your question, you should click the Improve Question link and edit it. Not post again.
ZurdoDev 30-Jan-13 8:39am    
Is there an error? Do you have [System.Web.Script.Services.ScriptService] on your webservice class?
sayed farhan 30-Jan-13 8:56am    
hi ryan i am new to all this can u please tell me from where to check webservice class

i have Imports System.Web.Services in my .vb page

1 solution

Make sure that you have properly used ScriptManager tags inside forms tag in your aspx code.
 
Share this answer
 

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