Not Working Asp.net C# button Event
hi all,Am using asp.net c# button. In my local system button event working good but after publishing server button event not working...
My Code:
connection();
con = new SqlConnection(con_str);
con.Open();
string query = "insert into TourPlace values(@Category,@locationId,@location)";
using (SqlCommand Cmd = new SqlCommand(query, con))
{
Cmd.Parameters.AddWithValue("@Category", Drpcategory.Text);
Cmd.Parameters.AddWithValue("@locationId", txtlocId.Text);
Cmd.Parameters.AddWithValue("@location", txtlocation.Text);
Cmd.ExecuteNonQuery();
con.Close();
Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Added Successfully.');</script>");
clearAll();
}