Hi HoneyJo,
Please refer below sample And modify code for Visible true Or False as per your requirements.
HTML
<div class="pagewrap">
<div class="w3-container">
<div>
<h1 style="background-color: #FFFFFF; width: 100%; border: 3px solid #4A3C8C; text-align: center;" class="auto-style2">Outgoing Referral</h1>
</div>
<asp:Panel ID="Pnldataentry" runat="server" Height="1500px">
<asp:Panel ID="pnlformout" runat="server">
<asp:HiddenField ID="HFID" runat="server" />
<asp:HiddenField ID="HFsavestatus" runat="server" />
<asp:HiddenField ID="HiddenField1" runat="server" />
<br />
<table class="auto-style16">
<tr>
<td class="auto-style35" colspan="2">
<asp:Label ID="Label7" runat="server" Font-Bold="True" Font-Underline="True" Text="Referral Details"></asp:Label>
</td>
<td class="auto-style35" colspan="2" aria-haspopup="False">
<asp:Label ID="Label18" runat="server" Text="Actions" Font-Bold="True" Font-Underline="True"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style99">
<asp:Label ID="lblhnout" runat="server" Text="Hosp No:"></asp:Label>
<asp:TextBox ID="txthnout" runat="server"></asp:TextBox>
</td>
<td class="auto-style100">
<asp:Label ID="lbldobout" runat="server" Text="DOB:"></asp:Label>
<asp:TextBox ID="txtdobout" runat="server"></asp:TextBox>
</td>
<td class="auto-style35" aria-haspopup="False" colspan="2" rowspan="2">
<br class="auto-style34" />
<br />
<br />
<asp:GridView ID="gvActionout" runat="server" AutoGenerateColumns="False" DataKeyNames="EmployeeId" Width="670px" Visible="false" AllowPaging="True" DataSourceID="Actionsout">
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="EmployeeId" HeaderText="Employee Id" InsertVisible="False" ReadOnly="True" SortExpression="EmployeeId" Visible="False" />
<asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" />
<asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="Last Name" />
<asp:BoundField DataField="BirthDate" HeaderText="Birth Date" SortExpression="BirthDate" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="Actionsout" runat="server" ConnectionString="<%$ ConnectionStrings:constr %>" SelectCommand="SELECT EmployeeId, FirstName, LastName, BirthDate From Employees"></asp:SqlDataSource>
</td>
<tr>
<td class="auto-style101">
<asp:Label ID="lblsurnameout" runat="server" Text="Surname:"></asp:Label>
<asp:TextBox ID="txtsurnameout" runat="server"></asp:TextBox>
</td>
<td class="auto-style102">
<asp:Label ID="Label5" runat="server" Text="Referred By: "></asp:Label>
<asp:DropDownList ID="ddlrefbyout" runat="server" DataSourceID="refbyout" DataTextField="EmployeeId" DataValueField="EmployeeId">
</asp:DropDownList>
<asp:SqlDataSource ID="refbyout" runat="server" ConnectionString="<%$ ConnectionStrings:constr %>" SelectCommand="SELECT EmployeeId, FirstName, LastName, BirthDate From Employees"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td class="auto-style92">
<asp:Label ID="lblfirstnameout" runat="server" Text="Firstname:"></asp:Label>
<asp:TextBox ID="txtfirstnameout" runat="server"></asp:TextBox>
</td>
<td class="auto-style93">
<asp:Label ID="Label3" runat="server" Text="Research No:"></asp:Label>
<asp:TextBox ID="txtrnumout" runat="server"></asp:TextBox>
</td>
<td aria-haspopup="False" class="auto-style35" colspan="2">
<asp:Label ID="Label15" runat="server" Font-Bold="True" Font-Underline="True" Text="Samples"></asp:Label>
</td>
</tr>
<tr>
<td class="auto-style92"> <asp:Label ID="Label1" runat="server" Text="Referral Reason:"></asp:Label>
<br class="auto-style34" />
<asp:DropDownList ID="ddlrefreasonout" runat="server" CssClass="auto-style22" DataSourceID="Refreasonout" DataTextField="EmployeeId" DataValueField="EmployeeId">
</asp:DropDownList>
<asp:SqlDataSource ID="Refreasonout" runat="server" ConnectionString="<%$ ConnectionStrings:constr %>" SelectCommand="SELECT EmployeeId, FirstName, LastName FROM Employees"></asp:SqlDataSource>
</td>
<td class="auto-style93" rowspan="3"> <br />
<asp:Label ID="Label6" runat="server" Text="Description:"></asp:Label>
<asp:TextBox ID="txtdescout" runat="server" Height="380px" TextMode="MultiLine" Width="290px" Visible="false"></asp:TextBox>
</td>
<td aria-haspopup="False" class="auto-style35" colspan="2" rowspan="2">
<asp:GridView ID="gvSlideout" runat="server" AutoGenerateColumns="False" DataKeyNames="CustomerId" Width="672px" AllowPaging="True" Visible="false" DataSourceID="Samples">
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="CustomerId" HeaderText="Customer Id" InsertVisible="False" ReadOnly="True" SortExpression="CustomerId" Visible="False" />
<asp:BoundField DataField="CompanyName" HeaderText="Company Name" SortExpression="CompanyName" />
<asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
<asp:BoundField DataField="Country" HeaderText="Country" SortExpression="Country" />
<asp:BoundField DataField="PostalCode" HeaderText="PostalCode" SortExpression="PostalCode" />
<asp:BoundField DataField="Region" HeaderText="Region" SortExpression="Region" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="Samples" runat="server" ConnectionString="<%$ ConnectionStrings:constr %>" SelectCommand="SELECT TOP 10 CustomerId, CompanyName, ContactName, City, Country, PostalCode, Region From Customers"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td class="auto-style92">
<asp:Label ID="Label2" runat="server" Text="Ethics No:"></asp:Label>
<asp:TextBox ID="txtenumout" runat="server"></asp:TextBox>
<br class="auto-style34" />
</td>
</tr>
<tr>
<td class="auto-style92">
<asp:Label ID="Label4" runat="server" Text="Date Sent:" Visible="false"></asp:Label>
<asp:TextBox ID="txtdatesentout" runat="server" TextMode="Date" Visible="false"></asp:TextBox>
</td>
<td class="auto-style90">
<asp:HiddenField ID="HFID2" runat="server" />
<asp:HiddenField ID="HFsavestatus2" runat="server" />
<asp:HiddenField ID="HiddenField3" runat="server" />
<br />
<asp:Button ID="Btnrecordactionout" runat="server" Text="Record Action" Visible="True" OnClick="OnAction" />
<br class="auto-style34" />
</td>
<td class="auto-style94">
<asp:HiddenField ID="HFID1" runat="server" />
<asp:HiddenField ID="HFsavestatus1" runat="server" />
<asp:HiddenField ID="HiddenField2" runat="server" />
<br />
<asp:Button ID="Btnaddslidesout" runat="server" Text="Add Slides" Visible="False" />
</td>
</tr>
<tr>
<td class="auto-style101">
<asp:Label ID="lblreftoout" runat="server" Text="Referred To:"></asp:Label>
<asp:DropDownList ID="ddlreftoout" runat="server" AutoPostBack="True" DataSourceID="refto" DataTextField="CompanyName" DataValueField="CompanyName">
</asp:DropDownList>
<asp:SqlDataSource ID="refto" runat="server" ConnectionString="<%$ ConnectionStrings:constr %>" SelectCommand="SELECT CustomerId, CompanyName FROM Customers"></asp:SqlDataSource>
<asp:Label ID="Label16" runat="server" AssociatedControlID="ddlreftoout" EnableViewState="False" Text="Label"></asp:Label>
</td>
<td class="auto-style93" rowspan="2"> </td>
<td class="auto-style97">
<asp:Panel ID="Pnlactionout" runat="server" Visible="False">
<table class="auto-style2">
<tr>
<td>
<asp:Label ID="lblactionout" runat="server" Text="Action:"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ddlactionout" runat="server" DataSourceID="Actiontaken" DataTextField="Actiontaken" DataValueField="ActiontakenID">
</asp:DropDownList>
<asp:SqlDataSource ID="Actiontaken" runat="server" ConnectionString="<%$ ConnectionStrings:constr %>" SelectCommand="SELECT [CustomerId], [CompanyName] FROM [Customers] ORDER BY [CompanyName]"></asp:SqlDataSource>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblactiondateout" runat="server" Text="Date:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtactiondateout" runat="server" TextMode="Date"></asp:TextBox>
<br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblactiondetailout" runat="server" Text="Detail:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtactdetailout" runat="server" Height="88px" TextMode="MultiLine" Width="251px"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Btnactionoutsubmit" runat="server" Text="Submit" Width="90px" />
</td>
<td>
<asp:Button ID="Btnactionclearout" runat="server" Text="Clear" Width="90px" />
</td>
</tr>
</table>
</asp:Panel>
</td>
<td class="auto-style98">
<asp:Panel ID="Pnlslidesout" runat="server" Visible="False">
<table class="auto-style2">
<tr>
<td>
<asp:Label ID="lblrefnoslideout" runat="server" Text="Reference No:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtrefnoout" runat="server"></asp:TextBox>
<br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblblocknoslideout" runat="server" Text="Block No:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtblocknoout" runat="server"></asp:TextBox>
<br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblslidenoout" runat="server" Text="Slide No:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtslidenoout" runat="server"></asp:TextBox>
<br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lbltissuenoout" runat="server" Text="Tissue No:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txttissuenoout" runat="server" Height="16px" Width="117px"></asp:TextBox>
<br />
</td>
</tr>
<tr>
<td>
<asp:Label ID="lbldateslideout" runat="server" Text="Date Returned:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtdateretunout" runat="server" TextMode="Date"></asp:TextBox>
<br />
</td>
</tr>
<tr>
<td>
<asp:Button ID="Btnslideoutsubmit" runat="server" CssClass="auto-style72" Text="Submit" Width="90px" />
</td>
<td>
<asp:Button ID="Btnclearslidesout" runat="server" Text="Clear" Width="90px" />
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
<tr>
<td class="auto-style97" rowspan="2">
<asp:Button ID="Btnsaveout" runat="server" Text="Save" Width="90px" OnClick="OnSave" />
<asp:Button ID="Btncanout" runat="server" Text="Cancel" Width="90px" />
</td>
<td class="auto-style98" rowspan="2"> </td>
<td class="auto-style92"> <br class="auto-style34" />
</td>
</tr>
<tr>
<td class="auto-style84"> </td>
<td class="auto-style82"> </td>
</tr>
</table>
</asp:Panel>
<br />
<br />
</asp:Panel>
</div>
</div>
Code
C#
protected void OnAction(object sender, EventArgs e)
{
gvActionout.Visible = true;
txtdatesentout.Visible = true;
txtdescout.Visible = true;
}
protected void OnSave(object sender, EventArgs e)
{
gvSlideout.Visible = true;
}
VB.Net
Protected Sub OnAction(ByVal sender As Object, ByVal e As EventArgs)
gvActionout.Visible = True
txtdatesentout.Visible = True
txtdescout.Visible = True
End Sub
Protected Sub OnSave(ByVal sender As Object, ByVal e As EventArgs)
gvSlideout.Visible = True
End Sub