hi
how to catch data without refreshing page
I use the below codes in page:
<div id="captchaE" class="attenCC1M" runat="server" visible="false">
<asp:Label ID="Label24" runat="server" CssClass="lblattenCC1M">خطا:  <span style="font:13px Mj_Dinar Two Light;color:#c6b85e">پاسخ سوال امنیتی اشتباه می باشد.</span></asp:Label>
<asp:Image ID="Image7" runat="server" CssClass="imgattenMD1" ImageUrl="~/Image/main/attenm.png"></asp:Image>
</div>
here <div id=captchaE visible="false"> and in else condition that will be true:
else
{
captchaE.Visible = true;
DsendC.Visible = false;
ClientScript.RegisterStartupScript(this.GetType(), "Popup", "$('#myModal2').modal('show')", true);
}
when I click the button it will refresh the page and do if or else conditions I want doesn't refresh the page and do if or else condition
protected void ImgsendMessage_Click(object sender, ImageClickEventArgs e)
{
if (txtStopSpam.Text == ViewState["spam"].ToString())
{
captchaE.Visible = false;
DsendC.Visible = false;
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.Parameters.AddWithValue("@Tell", Txtmobile.Text);
_cmd.Parameters.AddWithValue("@email", "");
_cmd.ExecuteNonQuery();
}
}
DsendC.Visible = true;
ClientScript.RegisterStartupScript(this.GetType(), "Popup", "$('#myModal3').modal('show')", true);
generateStopSpamText();
}
else
{
captchaE.Visible = true;
DsendC.Visible = false;
ClientScript.RegisterStartupScript(this.GetType(), "Popup", "$('#myModal2').modal('show')", true);
}
}
how I can do it?
Best regards
Neda