Hi all,
Interesting little problem that I am not sure about.
Typically in a web app I will create some form of table in a db that allows user access control - typically tabs that when clicked load a page or embed a container. The tabs are generated on the fly from a web container, having a property called “myvalue” which was assigned a value while iterating through a loop from the returned recordset. The action event of the dynamic control passes myvalue to a method in the main webpage. I then use select case to identify the container I wish to interact with. No issues there and it works well, except for the fact it takes others working on my projects some time to come up to speed.
It became clear that the code was fairly spread out and I went to see if I could make things easier. I created an array on the main webpage in the hopes I could add all the containers and reference them through the array when required - removing the need for embed methods. Initially they were all set as not visible and I would pass a value to a method “ShowContainers” as such;
for i as Integer = 0 to 2
if i = val then
ccArray(i).ZIndex = 10
ccArray(i).Visible = True
else
ccArray(i).ZIndex = 0
ccArray(i).Visible = False
end if
next
So if I passed the value 1 it would hide all others and set zindex to 0 except for the required page.
This was so much easier than a huge select case with 15 options.
The problem is this does not work. When I click the tab it shows a page but that’s it, subsequent clicks on other buttons results in nothing being shown.
I think this has something to do with creating an array of containers that have different supers?
Maybe its a zindex issue?
Maybe its right in front of me and I am stupid?
Maybe I need new devs!
Also interested in ways others load dynamic content and or show different webpages.
(Just realized I cannot attach - email me from the test example)