Without actually seeing your pages, I'm assuming that you have one or more pages (these we will represent as the 'top' page(s)) that can bring in the code from your post via the ajaxpage function. The code from your post then in turn brings in yet another page via the ajaxpage function based upon the get or post value of p.
If I have that right, now you know where the top page is.
Incidentally, this:
Code:
<%
Dim P As String
P = Trim(Request("p"))
%>
and this:
is server side code, asp or something similar. It runs on the server side as the page is served. The rest of the script code is javascript and runs only as parsed by the browser on the client side.
The tricky part is, a script like so:
Code:
<script type="text/javascript">
function redir(MyD) {
switch (MyD)
{
case '': ajaxpage('Main.aspx.vb', 'D1'); break;
case 'Main': ajaxpage('Main.aspx.vb', 'D1'); break;
case 'WhoWeAre': ajaxpage('WhoWeAre.aspx.vb', 'D1'); break;
case 'Products': ajaxpage('Products.aspx.vb', 'D1'; break;
case 'Services': ajaxpage('Services.aspx.vb', 'D1'); break;
case 'Distributors': ajaxpage('Distributors.aspx.vb', 'D1'); break;
case 'Offers': ajaxpage('Offers.aspx.vb', 'D1') break;
case 'HowToOrder': ajaxpage('HowToOrder.aspx.vb', 'D1');break;
case 'ContactUs': ajaxpage('ContactUs.aspx.vb', 'D1'); break;
default: ajaxpage('ERR.aspx.vb', 'D1');
}
}
</script>
will not run on either side. If it is run by the server, there is no function ajaxpage() so there would be an error. And, due to the way that the ajaxpage function works, if this code itself is imported via the ajaxpage function (which I'm just guessing that it is) it just won't run or be seen as javascript. But if it was on what I'm calling the top page, it will be accessible to events on imported content.
Now, there are other possibilities as to how your site is organized in this regard, so I may be misunderstanding what's happening. So if you want more help on this:
Please post a link to the page on your site that contains the problematic code so we can check it out.
Bookmarks