I have used a user control to get data from database and render it as MegaMenu anchors. In code-behind file I have got data and rendered it by using a literal.
The megamenu.js file (containging myMega.Init method) has been inserted into header element
I have added following script tag into .ascx file.
<script type="text/javascript">
myMega.Init("mer_id", "anchor_id", "click");
</script>
I have several .aspx files which have same master page. The master page registers the User Control and contains following tag exact before .
<uc:MegaMenu id="anchors" runat="server"></uc:MegaMenu>
the problem is the myMega.Init only invokes when I go to firstpage.aspx. I have debugged by hitting f12 and choosing debugg Script. the init file invokes only first time (firstpage) not other pages. thank you for your help.