function createuser() {

    let username = $("#txtUserName").val();
    let password = $("#txtPassword").val();
    let repssword = $("#txtRePassword").val();
    let name = $("#txtName").val();
    let surname = $("#txtSurname").val();

    if (username == "" || password=="" || repssword=="") {
        alert('Please input information!');
        $("#txtUserName").focus();
        $("#txtUserName").select();
    }

    else if (password != repssword) {
        alert('Password is not match!');
        $("#txtRePassword").focus();
        $("#txtRePassword").select();

    }
    else {
        $.ajax({
            type: "POST",
            url: "CreateUser.aspx/saveuser",
            data: "{username:'" + username + "',password:'" + password + "',repassword:'" + repssword + "',name:'" + name + "',surname:'" + surname + "'}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {

                if (response.d == "") {
                    alert('Successfully created a new user.');
                    $("#txtUserName").val("");
                    $("#txtPassword").val("");
                    $("#txtRePassword").val("");
                    $("#txtName").val("");
                    $("#txtSurname").val("");
                    $("#txtUserName").focus();
                    $("#txtUserName").select();
                }
                else {
                    alert(response.d);

                }

            },
            failure: function (response) {
                alert(response.d);
            },
            error: function (response) {
                alert(response.d);
            }
        });

    }
}