I have created a server control which uses recursion to create a menu. It essentially outputs nested lists with anchors inside them.
Now, this works perfectly, however, since the control is calling itself to render the child menus, it is also rendering multiple identical WebResource.axd javascript file references in .
Any idea how to stop this from happening? I just want the one reference in my tag.
I ended up solving my own problem by making a private constructor of the form:
The public constructor looked like:
Then, when outputting the client scripts in the OnInit method, I checked whether _Level == 1, only outputting the client scripts if _Level == 1, like so:
I'm not sure if this was the best way, but it worked for me.