Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

How to get Ajax values in C#

$
0
0
//Javascript Code

var userName ="Some Name";
var password="Some Password";$.ajax({
     type: "post",
     url: "loginCheck.aspx/getData",
     data: "userName=" + userName + "&password=" + password,
     success: function (data) {
         console.log(data);
         //returns true or false
         if (data == TRUE) {
         //Rederict to Profile
         } else {
            //some alert 
         }

     },
     error: function (error) {
         console.log(error);
         alert(0);
     }
 });


//C#
/*
Below i am trying to get those ajax values ,but i am not getting it .
*/ public bool getData(){ String userName=Request.Params["userName"]); String password=Request.Params["userName"]); /* User details checking */ //finally return true or false return true; }

I want to get those ajax values in getData() Method At LoginCheck.aspx, but i am not getting values .

Please provide solution for my issue ,thanks in advance. 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>