|
-
Jan 28th, 2013, 02:04 AM
#3
Re: Internal server error in jquery /json webmethod
This should be in the ASP.NET Forum (mods?).
Your method signature is
Code:
Records(string loginid,string pass)
but you are trying to call it as
Note the missing parameters that aren't being sent from your jQuery code.
You are currently sending a single unnamed string as the data, and so jQuery has no idea what to do with it. When the request reaches ASP.NET, that also has no idea what to do with it as the request is for
and nothing matches that request, hence the Internal Server Error. You would have picked this up if you had run the project in debug mode from Visual Studio.
If you check the relevant jQuery documentation for $.ajax(), you will see that the data parameter can be a string or an object. The string parameter would only apply if your string is already in query-string format. It isn't, so you will want to send an object as the data parameter value which will then get converted by jQuery into the appropriate query-string format. An object would be specified with braces (as you already had), but without the surrounding quotes that turn it into a string.
The "Records" method is expecting two strings in the querystring, "loginid" and "pass", so you will need to specify them both in the data parameter.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|