Пример #1
0
    protected void btnAddGenre_Click(object sender, EventArgs e)
    {
        if (txtNewGenre.Text == "")
        {
            txtNewGenre.Focus();
            lblErro.Text = "Please Add Genre in Text box";
        }
        try
        {
            //calling addgenre method to add new genre into database
            BookCollection.AddGenre(txtNewGenre.Text);
            //lblErro.Text = x + " Genre Added";
            loadGenre();
            txtNewGenre.Text = "";
        }
        catch (Exception ex)
        {
            lblErro.Text = ex.ToString();
        }


        //ddGenre.Items.Add(new ListItem("NewGenre"));
    }