<div runat="server" id="addquestion" style="border-style: solid; border-width: 5px;"
visible="false">
<div class="has-feedback col-sm-12">
<label class="control-label">
Question</label>
<asp:TextBox ID="txtquestion" runat="server" required="required" class="form-control"
placeholder="Enter The Question"></asp:TextBox>
</div>
<div class="has-feedback col-sm-12">
<label class="control-label">
Answer</label>
<asp:TextBox ID="txtanswer" runat="server" required="required" class="form-control"
placeholder="Enter The Answer "></asp:TextBox>
</div>
<div class="has-feedback col-sm-12 row">
<div class="col-sm-3">
<label class="control-label">
Easy</label>
<asp:CheckBox ID="checkbox1" runat="server" required="required" class="form-control"
Text=" First Level"></asp:CheckBox>
</div>
<div class="col-sm-3">
<label class="control-label">
Inter Medium</label>
<asp:CheckBox ID="checkbox2" runat="server" required="required" class="form-control"
Text="Second Level"></asp:CheckBox>
</div>
<div class="col-sm-3">
<label class="control-label">
Advance</label>
<asp:CheckBox ID="checkbox3" runat="server" required="required" class="form-control"
Text="Third Level"></asp:CheckBox>
</div>
</div>
<div class="col-sm-12">
<asp:Button ID="Submitquestion" Style="background-color: midnightblue; border-radius: 3px;"
OnClick="Submitquestion_Click" runat="server" class="btn btn-group btn-default btn-sm"
Text="Submit" />
</div>
</div>
protected void Submitquestion_Click(object sender, EventArgs e)
{
obj.CreateConnectionsql();
string query = "insert into Question(Question , Answer, Chapter_name, Question_type_id,Level ) values('" + txtquestion.Text + "','" + txtanswer.Text + "','" + ddlchaptername.SelectedIndex + "','" + ddlquestionlevel.SelectedIndex + "','" + checkbox1.Checked + "," + checkbox2.Checked + "," + checkbox3.Checked + "')";
SqlCommand cmd = new SqlCommand(query, clsDataAccess.Conn);
cmd.ExecuteNonQuery();
txtquestion.Text = string.Empty;
txtanswer.Text = string.Empty;
checkbox1.Text = string.Empty;
checkbox2.Text = string.Empty;
checkbox3.Text = string.Empty;
obj.CloseConnection();
}