Hello. I am a newbie to programming. I'm working on a web form in asp.net. So my files are set up so that I have a Master page and aspx pages that look like this.
<%@ Page Title="" Language="VB" MasterPageFile="~/Layout.master" AutoEventWireup="false" CodeFile="delete.aspx.vb" Inherits="Appointment_Online_delete" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<asp:Content ID="Content2" ContentPlaceHolderID="wide" Runat="Server">
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
I have everything built. But on the form I want a collapsible panel. I've tried all the basic tricks I know and nothing works. I have no problem doing this on a page with only 1 button but this page will have 2. One button to submit the form and the other button to expand a content div or panel. No matter what I've tried when I click the button to expand the panel or div it doesn't do anything but jump to the top of the page and trigger all my form validators. It seems like it tries to submit the form also. Like I said, I've tried several different way to do it but this is the way I would like to do it if I can get it to work.
Here is the panel
<asp:Panel id="pnlfaq_content" runat="server" Visible="false">
As you see I start off with the visibility of false because I want the user to click the button to see the FAQ information.
This is my button. I've tried different types of buttons but I think a asp linkbutton is what I need. Let me know if there is something better.
<asp:LinkButton ID="btnFAQ" runat="server" onclick="btnFAQ_Click" CssClass="btn b_g" Style="width: 80px;"><span>FAQ</span></asp:LinkButton>
I was hoping it would be so simple as to just add this in my code file .aspx.vb
Protected Sub btnFAQ_Click(sender As Object, e As EventArgs) Handles btnFAQ.Click
pnlfaq_content.Visible = True
But this doesn't work. It only sends to focus to the top of the page and triggers my form validators as if I was submitting the form.
I would like some help in how to make this work. Thank you.