Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
how to call webmethod from aspx.vb page in vb.net (i am unable to webmethod from codebehind )
$(document).ready(function () {
    $('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);
                }
            }
        });
        $('#divPopUp').lightbox_me({
            lightboxSpeed: 500,
            centered: true,
            closeClick: true,
            closeEsc: true
        })
    });
});
<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()
 
    End If
    Return dt
End Function
Posted 31-Jan-13 3:10am
Edited 31-Jan-13 5:09am
(no name)500.4K
v2
Comments
ryanb31 at 31-Jan-13 11:42am
   
This is a repost. Did you ever add <system.web.script.services.scriptservice> to the class?

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

  Print Answers RSS
0 OriginalGriff 476
1 Sergey Alexandrovich Kryukov 235
2 CHill60 195
3 Afzaal Ahmad Zeeshan 145
4 TheRealSteveJudge 120
0 Sergey Alexandrovich Kryukov 9,121
1 OriginalGriff 7,920
2 Peter Leow 4,774
3 Kornfeld Eliyahu Peter 3,210
4 Maciej Los 2,176


Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100