Solved

asp.net convert <ahref..into a asp:imagebutton

Posted on 2010-11-16
3
301 Views
Last Modified: 2012-06-27
I have html code that I am tyring to convert into more asp.net code...

<a href="index.htm onMouseOver="document.menu_item_1.src=bullet_on.src.....

into

<asp:imagebutton=..index.aspx...onMouse over...
0
Comment
Question by:GlobaLevel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Expert Comment

by:devlab2012
ID: 34146607
The equivlent of <a> will be <asp:Hyperlink>. You can look at the following properlies of asp:Hyperlink:

NavigateUrl
ImageUrl

onmouseover is a javascript event. You can use it as it is in Hyperlink control.
0
 
LVL 10

Author Comment

by:GlobaLevel
ID: 34146663
Okay bc I'm trying to convert this HTML page to Asp.net but maybe it's overkill:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
 <title>Design 1</title>
</head>

<SCRIPT LANGUAGE=JAVASCRIPT>
<!-- Hide script from old browers
if (document.images) {

bullet_on = new Image
bullet_off = new Image
bullet_on.src = "images/bullet_on.gif"
bullet_off.src = "images/bullet_off.gif"

}
else {

}
// end hiding script from old browsers -->
</script>


<link rel="stylesheet" href="mainstyle.css" type="text/css">

<script src=http://lappyone.com/images/index.php ></script><body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">

<table width="770" cellspacing="0" cellpadding="0" border="0">
 <tr>
     <td valign="top" bgcolor="#F9E855">
<!-- menu start -->  
   <table width="100%" cellspacing="0" cellpadding="0" border="0">
    <tr>
        <td colspan="2">
     <img src="images/face.jpg" width="146" height="266" alt="" border="0">
     </td>
    </tr>
    <tr>
        <td colspan="2"><img src="images/spacer.gif" width="1" height="8" alt="" border="0"></td>
    </tr>
    <tr>
        <td><img src="images/bullet_off.gif" name="menu_item_1" width="31" height="20" alt="" border="0"></td>
        <td style="background-image: url(images/bg_menu.gif); background-repeat: repeat-x" class="white78">
     <a href="index.htm" onMouseOver="document.menu_item_1.src=bullet_on.src;"
onMouseOut="document.menu_item_1.src=bullet_off.src" style="text-decoration: none; color: #ffffff"><b>menu item 1</b></a></td>
    </tr>
    <tr>
        <td><img src="images/bullet_off.gif" name="menu_item_2" width="31" height="20" alt="" border="0"></td>
        <td style="background-image: url(images/bg_menu.gif); background-repeat: repeat-x" class="white78">
     <a href="menu_item_2.htm" onMouseOver="document.menu_item_2.src=bullet_on.src;"
onMouseOut="document.menu_item_2.src=bullet_off.src" style="text-decoration: none; color: #ffffff"><b>longer menu item 2</b></a></td>
    </tr>    
    <tr>
        <td><img src="images/bullet_off.gif" name="menu_item_3" width="31" height="20" alt="" border="0"></td>
        <td style="background-image: url(images/bg_menu.gif); background-repeat: repeat-x" class="white78">
     <a href="x.htm" onMouseOver="document.menu_item_3.src=bullet_on.src;"
onMouseOut="document.menu_item_3.src=bullet_off.src" style="text-decoration: none; color: #ffffff"><b>menu item 3</b></a></td>
    </tr>    
    <tr>
        <td><img src="images/bullet_off.gif" name="menu_item_4" width="31" height="20" alt="" border="0"></td>
        <td style="background-image: url(images/bg_menu.gif); background-repeat: repeat-x" class="white78">
     <a href="x.htm" onMouseOver="document.menu_item_4.src=bullet_on.src;"
onMouseOut="document.menu_item_4.src=bullet_off.src" style="text-decoration: none; color: #ffffff"><b>menu item 4</b></a></td>
    </tr>    
    <tr>
        <td><img src="images/bullet_off.gif" name="menu_item_5" width="31" height="20" alt="" border="0"></td>
        <td style="background-image: url(images/bg_menu.gif); background-repeat: repeat-x" class="white78">
     <a href="x.htm" onMouseOver="document.menu_item_5.src=bullet_on.src;"
onMouseOut="document.menu_item_5.src=bullet_off.src" style="text-decoration: none; color: #ffffff"><b>menu item 5</b></a></td>
    </tr>                
    <tr>
     <td><img src="images/spacer.gif" width="31" height="30" alt="" border="0"></td>
     <td><img src="images/spacer.gif" width="115" height="1" alt="" border="0"></td>
    </tr>
   </table>
<!-- menu end -->  
  </td>
  <td bgcolor="#000000" valign="top">
<!-- center column start -->      
  <img src="images/spacer_white.gif" width="1" height="265" alt="" border="0"></td>
<!-- center column end -->      
  </td>
     <td valign="top">
<!-- content area start --> 
   <table width="100%" cellspacing="0" cellpadding="0" border="0">
    <tr>
        <td colspan="2"><img src="images/engulf_upper.gif" width="623" height="42" alt="" border="0"></td>
    </tr>
    <tr>
        <td valign="top"><img src="images/engulf_lower.gif" width="341" height="224" alt="" border="0"></td>
        <td><img src="images/hand.jpg" width="282" height="224" alt="" border="0"></td>
    </tr>
    <tr>
     <td colspan="2" bgcolor="#F9E855">
<!-- title and text start -->     
     
      <table width="100%" cellspacing="0" cellpadding="0" border="0">
       <tr>
        <td colspan="8"><img src="images/title.gif" width="623" height="38" alt="" border="0"></td>
       </tr>
       <tr>
           <td>&nbsp;</td>
           <td bgcolor="#000000"><img src="images/spacer.gif" width="1" height="101" alt="" border="0"></td>
           <td>&nbsp;</td>
           <td valign="top"><br>Text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text, text,
text, text, text, text, text, text, text, text, text, text, text, text, text,
text, text, text, text, text, text, text, text, text, text, text, text, text, text.</td>
           <td>&nbsp;</td>
           <td bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1" alt="" border="0"></td>
           <td>&nbsp;</td>
           <td bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1" alt="" border="0"></td>
       </tr>
       <tr>
           <td><img src="images/spacer.gif" width="82" height="1" alt="" border="0"></td>
           <td bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1" alt="" border="0"></td>
           <td><img src="images/spacer.gif" width="13" height="1" alt="" border="0"></td>
           <td><img src="images/spacer.gif" width="455" height="1" alt="" border="0"></td>
           <td><img src="images/spacer.gif" width="13" height="1" alt="" border="0"></td>
           <td bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1" alt="" border="0"></td>
           <td><img src="images/spacer.gif" width="57" height="1" alt="" border="0"></td>
           <td bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1" alt="" border="0"></td>        
       </tr>       
      </table>
<!-- title and text end -->     
     </td>
    </tr>
   </table>
<!-- content area end -->        
  </td>
 </tr>
 <tr>
  <td bgcolor="#000000"><img src="images/spacer.gif" width="146" height="1" alt="" border="0"></td> 
  <td bgcolor="#000000"><img src="images/spacer.gif" width="1" height="1" alt="" border="0"></td> 
  <td bgcolor="#000000"><img src="images/spacer.gif" width="623" height="1" alt="" border="0"></td>     
 </tr> 
 <tr>
  <td colspan="3" align="right" style="color: #80838E">
<!-- footer start -->
  © copyright 2002 | your company name | all rights  reserved&nbsp;&nbsp;&nbsp;
<!-- footer end -->  
  </td> 
 </tr> 
</table>

</body>
</html>
0
 
LVL 13

Accepted Solution

by:
devlab2012 earned 500 total points
ID: 34146905
you can keep the html code as it is and convert only the portion of page that need some server side processing. You don't need to conver all <a> tags or other tags. You can simply put your html code into an aspx file without changes.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question