hi
I refer below thread
Keep Bootstrap modal open if validation error is raised using jQuery in ASP.Net
I did it and it just worked for requiredfieldvalidator but I use captcha code in page too
here in this div visible= false if users enter security code wrong it will show message in this div but here when I enter security code wrong and click button it closes Modal.
below are codes:
<div id="captchaE" class="attenCC1M" runat="server" visible="false">
<asp:Label ID="Label46" runat="server" CssClass="lblattenCC1M">please enter sequrity code correctly</asp:Label>
<asp:Image ID="Image11" runat="server" CssClass="imgattenM" ImageUrl="~/Image/main/atten.png"></asp:Image>
</div>
protected void Imgsend_Click(object sender, ImageClickEventArgs e)
{
if (txtStopSpam.Text == ViewState["spam"].ToString())
{
captchaE.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();
}
}
generateStopSpamText();
}
else
{
captchaE.Visible = true;
}
}
could you help me?
Best regards
Neda