what is wrong with it?
try:
   hlink.Attributes.Add["onclick"] = @"<script > window.open('practics.aspx?id="+"1" +" ','popwindow','menubar=0,toolbar=no,location=no,directories=no,status=no,resizable=no,top=100,left=100,width=600,height=500');</script>";

解决方案 »

  1.   

    放一个 hyperLink到aspx页中,然后在page_load中加入以上代码就可!
      

  2.   

    to stdao:
    wait i try
      

  3.   

    try it:
    string str = @"<script > window.open('practics.aspx?id="+"1" +" ','popwindow','menubar=0,toolbar=no,location=no,directories=no,status=no,resizable=no,top=100,left=100,width=600,height=500');</script>";hlink.Attributes.Add("onclick", str);
      

  4.   

    to stdao and newfans:
    can't
      

  5.   


    menubar=0,toolbar=no
    改为
    menubar=no,toolbar=no
      

  6.   

    try:
    HyperLink hlink = new HyperLink();
    hlink.Attributes["onclick"] = @"<script > window.open('practics.aspx?id="+"1" +" ','popwindow','menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,top=100,left=100,width=600,height=500');</script>";
    this is ok.
      

  7.   

    真的很奇怪。
    我也以为
    HyperLink hlink = new HyperLink();
    hlink.Attributes["onclick"] = @"<script > window.open('practics.aspx?id="+"1" +" ','popwindow','menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=no,top=100,left=100,width=600,height=500');</script>";
    这样就是对的。但是,事实上是,叶面上没有任何链接,hlink.Text可以取出来。点这个text没反应。
    对了,我这个是动态table里面的一个hyperlink cell。
    再看看还有没有人能给我点建议,没人的话,就把这分散了八。
      

  8.   

    TableRow r=new TableRow();
    TableCell c=new TableCell();
    HyperLink hlink = new HyperLink();
    hlink.Attributes["onclick"] = @"<script > window.open('practics.aspx?id="+"1" +" ','popwindow','menubar=0,toolbar=no,location=no,directories=no,status=no,resizable=no,top=100,left=100,width=600,height=500');</script>";r.Height=32;
    c.Controls.Add(hlink);
    r.Cells.Add(c);
    TableFile.Rows.Add(r);//这样应该可以了!
      

  9.   

    算了。
    直接用hlink.atrrbutes["onclick"] = "javascript:windows.open()";
    倒是可以,不过由于要传递变量参数,也烦得很。而且下面也看不出来是链接。
    谢谢大家了。兄弟们,接分阿。