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?

1 Answer 1

0

Use this two solution you might get your Answer:

Solution 1

Solution 2

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.