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,471
  • 17
  • 87
  • 173
Michael
  • 12,788
  • 49
  • 133
  • 253

1 Answers1

0

Use this two solution you might get your Answer:

Solution 1

Solution 2

Community
  • 1
  • 1