TableCell Cell=new TableCell();
Cell.Text="<a href="WebForm2.aspx:?"id="+"listname.Items[i].Text+>"+"&b=this.listname.Items[i].Text+</a>";这句话语法哪里错了????

解决方案 »

  1.   


    TableCell Cell=new TableCell(); 
    Cell.Text="<a href=\"WebForm2.aspx:?\"id="+listname.Items[i].Text +">"+ this.listname.Items[i].Text +"</a>";
      

  2.   

    加一个\对"进行转义,不然它会以为="<a href="是字符串,以为WebForm2.aspx:?是变量,所以就出错了
      

  3.   


    Cell.Text="<a href='WebForm2.aspx?id="+listname.Items[i].Text+"'>"+this.listname.Items[i].Text+"</a>";这样就可以了!经过测试!
      

  4.   

    你的引号位置错误了,建议 色个断点看看你那个字符串的值就知道了4楼是对的
    Cell.Text="<a href='WebForm2.aspx?id="+listname.Items[i].Text+"'>"+this.listname.Items[i].Text+"</a>";