Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
function not getting call on vb.net page

.js code

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

                }
            }
        });
        $('#divPopUp').lightbox_me({
            lightboxSpeed: 1000,
            centered: true,
            closeClick: true,
            closeEsc: true
        })
    });

.vb code
XML
<WebMethod()> Public Shared Function FillData(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()
       End If
       Return dt
   End Function
Posted
Updated 29-Jan-13 22:34pm
v2
Comments
Jameel VM 30-Jan-13 4:17am    
is FillData is a webservice method?
Jameel VM 30-Jan-13 4:22am    
what is the URL while browsing?
sayed farhan 30-Jan-13 4:42am    
http://localhost:53427/User_Create_Update.aspx
sayed farhan 30-Jan-13 4:32am    
this is a url
http://localhost:53427/User_Create_Update.aspx
sayed farhan 30-Jan-13 4:33am    
yes FillData is webmethod

http://localhost:53427/User_Create_Update.aspx
 
Share this answer
 
Please go though the script and please put url like below
JavaScript
<script type="text/javascript">
$(function() {
$('input[id$=btnPull]').click(function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "../Services/EmployeeList.asmx/FetchEList",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
var orders = msg.d;
if (orders.length > 0) {
CreateTable(orders);
}
else {
$("#tbl").text("No records found");
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
}
});
});
});
function CreateTable(msg) {
$('#tbl').setTemplateURL('../Template/TemplateEmployee.htm',
null, { filter_data: false });
$('#tbl').processTemplate(msg);
}
</script><pre lang="Javascript">
 
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