做了个静态的HTML 页面 复制到ASPX 里边改成动态控件出现错误HELP
<%@ Page language= "c# " Codebehind= "WebForm4.aspx.cs " AutoEventWireup= "false " Inherits= "Ex.WebForm4 " %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN "
"http://www.w3.org/TR/html4/loose.dtd ">
<HTML>
<!-- InstanceBegin template= "/Templates/submenu.dwt " codeOutsideHTMLIsLocked= "false " -->
<HEAD>
<title> </title>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<!-- InstanceBeginEditable name= "doctitle " -->
<!-- InstanceEndEditable --> <style type= "text/css "> </style>
<link href= "../style/_style.css " rel= "stylesheet " type= "text/css ">
<style type= "text/css ">
BODY { BACKGROUND-COLOR: #04344f }
</style>
<!-- InstanceBeginEditable name= "head " -->
<script language= "JavaScript " 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_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_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init " && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over ") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out " ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down ") {
nbArr = document[grpName];
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}
//-->
</script>
<!-- InstanceEndEditable -->
</HEAD>
<body onLoad= "MM_preloadImages( '../img/smenu1_h.gif ', '../img/smenu2_h.gif ', '../img/smenu3_h.gif ') ">
<table width= "940 " border= "1 " align= "center " cellpadding= "0 " cellspacing= "0 " bordercolor= "#BEBEBE "
class= "back ">
<tr>
<td> <table width= "940 " border= "0 " cellpadding= "0 " cellspacing= "0 " class= "big ">
<tr>
<td> <table width= "940 " border= "0 " cellpadding= "0 " cellspacing= "0 ">
<tr>
<td width= "26 " height= "13 "> </td>
<td width= "699 "> </td>
<td width= "17 "> </td>
<td width= "17 "> </td>
<td width= "17 "> </td>
<td width= "17 "> </td>
<td width= "17 "> </td>
<td width= "17 "> </td>
<td width= "17 "> </td>
<td colspan= "2 "> <div align= "right "> <a href= "# "> <img src= "../img/english.gif " name= "Image1 " width= "55 " height= "13 " border= "0 " id= "Image1 "> </a>
</div>
<div align= "right "> </div>
</td>
</tr>
<tr>
<td height= "34 "> </td>
<td valign= "bottom "> <a href= "../index.aspx "> <img src= "../img/logo.gif " name= "Image2 " width= "164 " height= "27 " border= "0 " id= "Image2 "> </a> </td>
<td valign= "bottom "> </td>
<td valign= "bottom "> <a href= "../bbs/index.asp " onMouseOver= "MM_swapImage( 'Image3 ', ' ', '../img/smenu1_h.gif ',1) "
onMouseOut= "MM_swapImgRestore() "> <img src= "../img/smenu1.gif " name= "Image3 " width= "49 " height= "12 " border= "0 " id= "Image3 "> </a> </td>
<td valign= "bottom "> </td>
<td valign= "bottom "> <a href= "../ourclub/tuijian.html " onMouseOver= "MM_swapImage( 'Image4 ', ' ', '../img/smenu2_h.gif ',1) "
onMouseOut= "MM_swapImgRestore() "> <img src= "../img/smenu2.gif " name= "Image4 " width= "61 " height= "12 " border= "0 " id= "Image4 "> </a> </td>
<td valign= "bottom "> </td>
<td valign= "bottom "> <a href= "../business/zhanlue.html " onMouseOver= "MM_swapImage( 'Image5 ', ' ', '../img/smenu3_h.gif ',1) "
onMouseOut= "MM_swapImgRestore() "> <img src= "../img/smenu3.gif " name= "Image5 " width= "49 " height= "12 " border= "0 " id= "Image5 "> </a> </td>
<td valign= "bottom "> </td>
<td width= "79 " valign= "bottom "> <img src= "../img/smenu4.gif " width= "127 " height= "12 "> </td>
<td width= "17 "> </td>
</tr>
[解决办法]
244行左右:
<!-- <a href= 'news_show1.aspx?nid= <%# DataBinder.Eval(Container, "DataItem.id ") %> '> <%# DataBinder.Eval(Container, "DataItem.jianjie ") %> </a> -->
<div onclick=top.location= 'news_show1.aspx?nid= <%# DataBinder.Eval(Container, "DataItem.id ") %> '>
</div>
改为:
[解决办法]
<!-- <a href= 'news_show1.aspx?nid= <%# DataBinder.Eval(Container, "DataItem.id ") %> '> <%# DataBinder.Eval(Container, "DataItem.jianjie ") %> </a> -->
<div onclick= "top.location= 'news_show1.aspx?nid= <%# DataBinder.Eval(Container, "DataItem.id ") %> ' ">
</div>