Click here to Skip to main content
12,512,515 members (28,531 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET
$('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
})
});
<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 >
Posted 30-Jan-13 0:17am
Updated 31-Jan-13 1:50am
v3
Comments
SChristmas 30-Jan-13 7:22am
   
Dont post same question multiple times
sayedfarhan 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.
ryanb31 30-Jan-13 8:39am
   
Is there an error? Do you have [System.Web.Script.Services.ScriptService] on your webservice class?
sayedfarhan 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
ryanb31 30-Jan-13 9:05am
   
after your imports statement will be a declaration of your class. You need [System.Web.Script.Services.ScriptService] right above your class declaration, as an attribute of the class. If you created the webservice with the "Add new" webservice option it likely is already there but commented out.
sayedfarhan 30-Jan-13 8:59am
   
there is no error but still i am unable to access webmethod which i have return in .vb page also i have checked my syntax in .js page for ajax it is right
ryanb31 30-Jan-13 9:06am
   
So, what does msg come back as?
sayedfarhan 30-Jan-13 9:50am
   
ryan can we use teamviewr
ryanb31 30-Jan-13 9:53am
   
No, sorry, I'm in the middle of work.
sayedfarhan 30-Jan-13 10:02am
   
ok
we have to import webservices.dll and where to write webmethod code in vb.net
ryanb31 30-Jan-13 10:21am
   
Your code should be something like this

' Visual Basic
<system.web.script.services.scriptservice>
Public Class Service1
Inherits System.Web.Services.WebService
<system.web.services.webmethod()> _
Public Function GetBigData() As DataSet
'implementation code
End Function
End Class

Notice the first line, right about the name of the class. This tells the webmethod that it can be called from script.

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160929.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2016
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