protected void Button1_Click(object sender, EventArgs e) { int published = 0; if (drpPublish.SelectedIndex == 0) { published = 1; } //Session["userid"] = 1; ForumThread thread = new ForumThread(txtTitle.Text, txtContent.Text, drpSection.SelectedItem.Text, published, Convert.ToInt32(Session["userid"])); thread.CreateThreadintoDb(); }