Oladotun Obileye

Oladotun Obileye

  • 2k
  • 98
  • 11.3k

Please how do I fix button click event using bootstrap theme

Apr 27 2019 6:20 PM
Good day everyone please i am having challenges to have a button click event in my asp.net project when ever i try to click on my bootstrap theme when designing button it does not take me to the asp.net webform eg(default.aspx.cs) instead it takes me to the default.aspx. so i am unable to write my code under the button without using the asp.net drag and drop button.
  1. <button ID="btnlogin" class="btn btn-primary btn-block btn-flat" type="submit" runat="server" oneserverclick="btnlogin_onClick" >Sign in </button>  
this code is not working. i want whereby whenever i click on the button it makes something like this
  1. protected void btnlogin_Click(object sender, EventArgs e)  
  2. {  
  3. where i can write code like this  
  4. protected void btnlogin_Click(object sender, EventArgs e)  
  5. {  
  6. SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["loginConnectionString1"].ToString());  
  7. con.Open();  
  8. string query = "select count (*) from log where username ='" + txtuser.Text + "' and password ='" + txtpass.Text + "' ";  
  9. SqlCommand cmd = new SqlCommand(query, con);  
  10. string output = cmd.ExecuteScalar().ToString();  
for registration and other codes

Answers (4)