[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.1

Javascript in a user web control ascx page

Asked by isaackhazi in Programming for ASP.NET, Microsoft Visual Basic.Net, Visual Studio

I am copying a menu from a PHP page and adding it as a user control in my ASp website. Since it is a rollover image menu it has some javascript in it. I managed to copy the HTML part to the ascx page but where do i copy the Javascript in the ascx page.

Below is he Menu which is basiclly in HTML and javascript. I copied the HTML part from it and it all works fine. But where do i put the javascript part of it . This is the ascx file:

<%@ Control Language="VB" ClassName="IncHeader" %>

<script  type="text/javascript" runat="server">

</script>
<table width="961" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><a href="index.htm"><img src="images/lg_lgcoolclub.jpg" alt="+I2A# LG Cool Club" width="306" height="71" border="0" /></a></td>
        <td align="right" valign="middle"><a href="http://www.lge.com/th/" target="_blank" onMouseOver="MM_swapImage('linkmain','','images/btn_link_main_2.jpg',1)" onMouseOut="MM_swapImgRestore()"><img src="images/btn_link_main_1.jpg" alt="@I2*9H@'GD L+%1- LG" name="linkmain" width="158" height="26" border="0" id="linkmain" /></a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr align="center">
        <td><a href="index.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_1','','images/menu_home_2.jpg',1)"><img src="images/menu_home_1.jpg" alt="+I2+%1" name="homemenu_1" width="156" height="48" border="0" id="homemenu_1" /></a></td>
        <td><a href="products.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_2','','images/menu_product_2.jpg',1)"><img src="images/menu_product_1.jpg" alt="I-!9%B#(1L LG" name="homemenu_2" width="194" height="48" border="0" id="homemenu_2" /></a></td>
        <td><a href="promotion.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_3','','images/menu_pro_2.jpg',1)"><img src="images/menu_pro_1.jpg" alt="B#B!
1H" name="homemenu_3" width="140" height="48" border="0" id="homemenu_3" /></a></td>
        <td><a href="news.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_4','','images/menu_news_2.jpg',1)"><img src="images/menu_news_1.jpg" alt="H2'*2# LG" name="homemenu_4" width="149" height="48" border="0" id="homemenu_4" /></a></td>
        <td><a href="register.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_5','','images/menu_regis_2.jpg',1)"><img src="images/menu_regis_1.jpg" alt="*!1#*!2
4" name="homemenu_5" width="164" height="48" border="0" id="homemenu_5" /></a></td>
        <td><a href="contact.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_6','','images/menu_contact_2.jpg',1)"><img src="images/menu_contact_1.jpg" alt="4H-@#2" name="homemenu_6" width="158" height="48" border="0" id="homemenu_6" /></a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><img src="images/space.gif" width="1" height="10" /></td>
  </tr>
</table>
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
} 
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
} 
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
} 
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<body onLoad="MM_preloadImages('images/btn_link_main_2.jpg','images/menu_home_2.jpg','images/menu_product_2.jpg','images/menu_pro_2.jpg','images/menu_news_2.jpg','images/menu_regis_2.jpg','images/menu_contact_2.jpg')"><table width="961" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><a href="index.htm"><img src="images/lg_lgcoolclub.jpg" alt="+I2A# LG Cool Club" width="306" height="71" border="0" /></a></td>
        <td align="right" valign="middle"><a href="http://www.lge.com/th/" target="_blank" onMouseOver="MM_swapImage('linkmain','','images/btn_link_main_2.jpg',1)" onMouseOut="MM_swapImgRestore()"><img src="images/btn_link_main_1.jpg" alt="@I2*9H@'GDL+%1- LG" name="linkmain" width="158" height="26" border="0" id="linkmain" /></a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr align="center">
        <td><a href="index.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_1','','images/menu_home_2.jpg',1)"><img src="images/menu_home_1.jpg" alt="+I2+%1" name="homemenu_1" width="156" height="48" border="0" id="homemenu_1" /></a></td>
        <td><a href="products.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_2','','images/menu_product_2.jpg',1)"><img src="images/menu_product_1.jpg" alt="I-!9%B#(1L LG" name="homemenu_2" width="194" height="48" border="0" id="homemenu_2" /></a></td>
        <td><a href="promotion.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_3','','images/menu_pro_2.jpg',1)"><img src="images/menu_pro_1.jpg" alt="B#B!
1H" name="homemenu_3" width="140" height="48" border="0" id="homemenu_3" /></a></td>
        <td><a href="news.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_4','','images/menu_news_2.jpg',1)"><img src="images/menu_news_1.jpg" alt="H2'*2# LG" name="homemenu_4" width="149" height="48" border="0" id="homemenu_4" /></a></td>
        <td><a href="register.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_5','','images/menu_regis_2.jpg',1)"><img src="images/menu_regis_1.jpg" alt="*!1#*!2
4" name="homemenu_5" width="164" height="48" border="0" id="homemenu_5" /></a></td>
        <td><a href="contact.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('homemenu_6','','images/menu_contact_2.jpg',1)"><img src="images/menu_contact_1.jpg" alt="4H-@#2" name="homemenu_6" width="158" height="48" border="0" id="homemenu_6" /></a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><img src="images/space.gif" width="1" height="10" /></td>
  </tr>
</table>
[+][-]11/04/09 01:59 AM, ID: 25737775Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 02:19 AM, ID: 25737882Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/04/09 05:19 AM, ID: 25738972Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Programming for ASP.NET, Microsoft Visual Basic.Net, Visual Studio
Sign Up Now!
Solution Provided By: govindarajan78
Participating Experts: 3
Solution Grade: A
 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625