0

I am trying to use the JQueryUI Dialog feature as a login form i.e when the user will click the Login link(or button) this dialog box will be displayed which will ask the user to enter his username & pass with the Signin button..after filling the uname & pass when the user will click the Signin button inside the Dialog box, it'll carry out the btnSignin_onClick event..

I dont know whether this is possible or not..this is some mixture of client side + server side events i guess..I searched out the web but it was of no help..If you could give me some help regarding this..

thanx in advance..

0

1 Answer 1

1

yes it's possible...

starts with javascript:

$(function () {
    // handle the login button click event
    $('#myButton').click(function (e) {

        // prevents the page do post
        $(e).preventDefault();

        // call your login routine *Assync*
        $.ajax({
            url: 'YOUR_URL_HERE',
            type: 'POST',
            // this will serialize the user and password inputs...
            data: $('#myForm').serialize(), // or usr=root&pwd=123, 
            success: function (data) { /* you are logged! THEN DO SOMETHING! */ },
            error: function (error) { /* something is wrong (maybe your password is wrong)! DO SOMETHING! */ },
            complete: function () { /* ajax login was peform well! now you can redirect or show user's information. */ }
        });
    });
});

on asp.net application create a ASHX to handle the login like:

[WebMethod]
public bool Login(string usr, string pwd) { /* (...) */ }

This is the theory!

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.