hi
I used the below code to show and hide the modal in behind code:
ClientScript.RegisterStartupScript(this.GetType(), "Popup", "$('#myModal2').modal('show')", true);
I want to use this code for show and hide <div>
How I can do it?
<asp:UpdatePanel ID="UpdatePanel13" runat="server">
<ContentTemplate>
<div id="DaddMainM" runat="server">
<asp:Label ID="Lbltell" runat="server" CssClass="tellC1M">12345</asp:Label>
<asp:Label ID="Lblmobile" runat="server" CssClass="tellC3M">4568</asp:Label>
<asp:Label ID="Lblemail" runat="server" CssClass="tellC6M"></asp:Label>
<asp:Label ID="Lbladd" runat="server" CssClass="tellC9M"></asp:Label>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel9" runat="server">
<ContentTemplate>
<div id="DaddMain2M">
<asp:TextBox ID="TxtnameS" runat="server" CssClass="txtnameCM"></asp:TextBox>
<div id="DaddMain3M">
<asp:TextBox ID="TxtmobileS" runat="server" CssClass="txtmobCM"></asp:TextBox>
<asp:TextBox ID="Texthome" runat="server" CssClass="txthomeCM"></asp:TextBox>
</div>
</div>
<div id="DaddMain2M1">
<asp:TextBox ID="Txttopic" runat="server" CssClass="txtEmailTM"></asp:TextBox>
<asp:TextBox ID="TxtdesS" runat="server" CssClass="txtdesCoM" TextMode="MultiLine" ForeColor="#4e4e4e" onblur="WaterMark(this, event,'متن پیام خود را به صورت مختصر تایپ نمایید');" onfocus="WaterMark(this, event,'متن پیام خود را به صورت مختصر تایپ نمایید');" Text="متن پیام خود را به صورت مختصر تایپ نمایید" onpaste="return false;"></asp:TextBox>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DnameC6M" runat="server">
<asp:UpdatePanel ID="UpdatePanel5" runat="server">
<ContentTemplate>
<asp:ImageButton ID="Imgsend" runat="server" ImageUrl="~/Image/main/sendifoC.png" CssClass="imgSeneMeM" OnClick="ImgsendMessage_Click"></asp:ImageButton>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel10" runat="server">
<ContentTemplate>
<div id="cap3DM">
<asp:Label ID="lblStopSpamS" runat="server" CssClass="CpassM"></asp:Label>
<asp:TextBox ID="txtStopSpamS" runat="server" CssClass="CtxtM"></asp:TextBox>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
protected void ImgsendMessage_Click(object sender, ImageClickEventArgs e)
{
if (Txttopic.Text == ""|| TxtnameS.Text == ""|| TxtdesS.Text == ""|| TxtmobileS.Text == ""|| Texthome.Text == "")
{
messageC.Visible = true;
captchaES.Visible = false;
ClientScript.RegisterStartupScript(this.GetType(), "Popup", "$('#DaddMainM').hide();", true);
}
else
{
messageC.Visible = false;
DsendCS.Visible = true;
captchaES.Visible = false;
}
}
Best regards
Neda