What happed is when you clicked on button the Page_load gets called, Which will fill your dropdownlist again and selected item gets reset.
To avoid such behavior, Put PageLoad code in
!isPostBack
e.g.
protected void Page_Load(object sender, EventArgs e)
{
if (!isPostBack)
{
ddlCategory.DataSource = DBCategory.GetAllCategory();
ddlCategory.DataValueField = "CategoryId";
ddlCategory.DataTextField = "CategoryName";
ddlCategory.DataBind();
}
}