I can think of two solutions for this:
1- using ajax, since you cannot change the code, you can only update .aspx files and add an AJAX call after loading the page to load your switch using the same procedure you mentioned earlier .. this solution is completely isolated since you do not need any changes to the vb.net code
2- Remove the Inheritance tag from .aspx and add:
<script runat="server> rewrite the whole page code here </script>
In fact, you are redoing the whole page in the second solution.
source share