I am trying to passing a panel id to to a sub routine with a onclick on a button with VB.Net
I have several panels that I want to make visible or invisible, I want to create one sub to the same routine.
ex.
sub runIt(a as object, e as eventargs, pnlName as string)
if a.text="+" then
pnlName.visible=true
' pnlTravel.visible=true This works fine
a.text="-"
else
pnlName.visible=false
' pnlTravel.visible=false this works fine
a.text="+"
end if
End sub
<asp:Button id="btnAdd2" onclick="runIt('pnlTravel')" runat="server" Font-Size="XX-Small" BorderStyle="Solid" Text="+" BackColor="White" BorderColor="DarkGray" />
<aspanel id="pnlTravel" runat="server">My code goes here</aspanel>
Please help I'm new to .NET
James
I have several panels that I want to make visible or invisible, I want to create one sub to the same routine.
ex.
sub runIt(a as object, e as eventargs, pnlName as string)
if a.text="+" then
pnlName.visible=true
' pnlTravel.visible=true This works fine
a.text="-"
else
pnlName.visible=false
' pnlTravel.visible=false this works fine
a.text="+"
end if
End sub
<asp:Button id="btnAdd2" onclick="runIt('pnlTravel')" runat="server" Font-Size="XX-Small" BorderStyle="Solid" Text="+" BackColor="White" BorderColor="DarkGray" />
<aspanel id="pnlTravel" runat="server">My code goes here</aspanel>
Please help I'm new to .NET
James