Hello, I'm doing a college project where I have to use web forms. By default in my project I have a div that is like none by default in css, and inside this div is a small form, as follows:
NOTE: I forgot to mention that this form is opened by a button, that using javascript does the same change of display: none, for display: inline-block.
<div class="x_panel" id="div1">
<div class="x_title">
<h2>Cerâmicas X <small>cadastro de produto</small></h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<br/>
<form class="form-horizontal form-label-left input_mask">
<div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">
<asp:TextBox ID="txt_prod_modelo" runat="server" class="form-control has-feedback-left" Text="Modelo do produto"></asp:TextBox>
<span class="fa fa-user form-control-feedback left" aria-hidden="true"></span>
</div>
<div class="col-md-6 col-sm-6 col-xs-12 form-group has-feedback">
<asp:TextBox ID="txt_prod_quantidade" runat="server" class="form-control has-feedback-left" Text="Quantidade de produto"></asp:TextBox>
<span class="fa fa-user form-control-feedback right" aria-hidden="true"></span>
</div>
<asp:Label ID="msg" runat="server" Text="Label" ></asp:Label>
<asp:Button ID="Button1" runat="server" Text="Button" Onclick="Cadastrarproduto_Click" />
</form>
</div>
</div>
Well, when I click on the button, it executes the method Register product through the onclick, and this onclick of a reload on the page, causing the form to return to none. I have tried to create a javascript function and put it inside the button in an OnclientClick but also did not work. I do not know if I could express myself very well, but I would like help so that either this reload does not occur or to be able to display my div again. Thanks for your attention and help.