<asp:Panel ID="Panel5" runat="server" >
</asp:Panel>
<asp:Panel ID="Panel6" runat="server" >
</asp:Panel>
<asp:Panel ID="Panel7" runat="server" >
</asp:Panel>
<asp:Button runat="server" ID="addButton" Text="Add More" OnClick="btnMore_click" AutoPostBack ="false" style="margin-left: 877px" Width="84px"/>
as above code , I have three asp panel for each button click ,visible one panel by btnMore_click function .
protected void btnMore_click(object sender, EventArgs e)
{
int count = this.Controls;
if(count == 1)
{
medPanel5.Visible = true;
this.Controls++;
}
if (count == 2)
{
medPanel6.Visible = true;
this.Controls++;
}
if (count == 3)
{
medPanel7.Visible = true;
this.Controls++;
}
}
but currently , when I click button one set visible true . I do not have any issues with it . but I face page reload , each and every time I need to scroll down to click add more button . is there amy way to stop page reload here ?