0

Here is my JavaScript block:

  <script>
    var u;
    var p;

    function login() {
        u = $("#userNameID").val();
        p = $("#passwordID").val();

        $.ajax({
            type: "POST",
            url: "Login.aspx",
            data: { username: u, password: p},
            success: function () { alert("success!!!") }
        });
    }
</script>

At server side after the post call I try to retrive values this way:

    protected void Page_Load(object sender, EventArgs e)
    {
        string user = Request.QueryString["username"];
        string pswrd = Request.QueryString["password"];
    }

But both values are null.

What I am missing here?

halfer
  • 19,824
  • 17
  • 99
  • 186
Michael
  • 13,950
  • 57
  • 145
  • 288

1 Answers1

0

Use this two solution you might get your Answer:

Solution 1

Solution 2

Community
  • 1
  • 1
Mahavirsinh Padhiyar
  • 1,299
  • 11
  • 33