hi,
I define submit input in page:
<input type="submit" class="btn btn-primary" value="Send Message"/>
I want when users click on this input it inserts data into the database I did it with button control:
<asp:ImageButton ID="Imgsend" runat="server" ImageUrl="~/Image/main/sendmessage.png" CssClass="imgSeneMe" OnClick="Imgsend_Click"></asp:ImageButton>
protected void Imgsend_Click(object sender, ImageClickEventArgs e)
{
bool isValid = aspcap.Validate(Txtc.Text.Trim());
if (isValid)
{
using (SqlConnection conn = General.GetConnection())
{
using (SqlCommand _cmd = General.GetCommand("MessageNew_insertInfo", conn))
{
conn.Open();
_cmd.Parameters.AddWithValue("@Topic", Txttopic.Text);
_cmd.Parameters.AddWithValue("@Name", Txtname.Text);
_cmd.Parameters.AddWithValue("@Description", Txtdes.Text);
_cmd.ExecuteNonQuery();
}
}
}
}
now I want to do like above code for input
how I can do it?
Best regards
Neda