Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ScriptMethod(UseHttpGet:=False, ResponseFormat:=ResponseFormat.Json), WebMethod()> _
- Public Function LoginDB(ByVal user As String, ByVal pass As String) As String
- global.user = user
- global.pass = pass
- If (<<lots of code to check if user is valid>>) Then
- Return "1"
- Else
- Return "0"
- End If
- End Function
- <?xml version="1.0" encoding="utf-8"?>
- <string xmlns="http://tempuri.org/">"0"</string>
- $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- url: "Services/Autenticacao.asmx/LoginDB",
- data: "{'user':'ale','pass':'123'}",
- dataType: "json",
- success: function(data) {
- alert(data);
- },
- .....
- $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- url: "WebService.asmx/WebMethodName",
- data: "{}",
- dataType: "json"
- });
- $.getJSON('WebService.asmx/WebMethodName', function(data) {
- //Do something with JSON response (data)
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement