Exemplo n.º 1
0
    protected void btnCheckUserName_OnClick(object sender, EventArgs e)
    {
        if (txtUsername.zIsNullOrEmpty())
        {
            lblErrorUserName.Text = "Please Enter Username.";
            txtUsername.Attributes.Add("style", "border-color:transparent transparent #ff0b0b");
            txtUsername.Focus();
            return;
        }

        int?UsersId = null;

        if (LoginUtilities.IsValidUserName(ref UsersId, txtUsername.Text))
        {
            Session["CheckUsersId"] = UsersId.ToString();
            SetControl(true);
        }
        else
        {
            lblErrorUserName.Text = "Sorry, We doesn't recognize " + txtUsername.Text + ".";
            txtUsername.Attributes.Add("style", "border-color:transparent transparent #ff0b0b");
            txtUsername.Focus();
        }
    }