Hide\Show group text in ASP.NET

Bill Johnson 11 Reputation points
2023-02-02T12:08:21.46+00:00

Hi,
I want to show & Hide group box according to certain condition:
ASP.net:

<div id="MyDiv" runat="server" visible="true" style="margin-top: 10px; margin-bottom: 10px;">
<asp:Panel runat="server" ID="pnlTest" GroupingText="My Group"

Then in code behind do this:
If true
MyDiv.visible := true
else
myDiv.visible := false;
Is this the best way to achieve that ?
Thank you

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,288 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 112.5K Reputation points
    2023-02-02T13:41:24.45+00:00

    I think that you can use an <asp:Panel> instead of <div>. Or maybe you can delete the <div>, adjust the style of panel and use pnlTest.Visible = false.

    0 comments No comments