3
votes

In one of the pages in my ASP.Net 3.5 site, I need to hide a specific webpart, as it is not applicable to that page (note: the webparts are defined in the master page). I basically have three webparts within the zonetemplate contained within the wpzGadgets web part zone. The webpart containing the google map control needs to be hidden.

How can I hide the webpart, in code?

I've tried the following:

wpzGadgets.WebParts["googleMap"].Visible = false;

But that presented me with the following error:

The Visible property cannot be set on Web Part 'gwpgoogleMap'. It can only be set on a standalone Web Part.

Is it even possible to hide individual webparts?

Thanks in advance.

1

1 Answers

4
votes

It turned out to be an easy one to solve... All I needed to do was set the webpart's Hidden property to true!