datagrid超级链接列弹出窗口。正常。但是原窗口WebForm1.aspx去变成了一个空白页
上面有一个这样的东西[object]
弄了一半下午还是不行前台弹出窗口代码部分是这样的:
javascript:varwin=window.open('WebForm2.aspx?pname={0}',null,'width=300,height=150')在网上找了一大圈,问这个问题的挺多。。却没人解决。。这是原贴地址。。
http://dev.csdn.net/develop/article/15/15456.shtm

解决方案 »

  1.   

    javascript:varwin=window.open('WebForm2.aspx?pname={0}',null,'width=300,height=150');history.forward();
      

  2.   

    Response.Write("
    <script language='javascript'>
    window.open(
    'XXX.aspx', 
    'popupnav',
    'width=300,height=150,resizable=1,scrollbars=no, left = 500, top = 200'
    )
    </script>");height=100 窗口高度;
    width=400 窗口宽度;
    top=0 窗口距离屏幕上方的象素值;
    left=0 窗口距离屏幕左侧的象素值;
    toolbar=no 是否显示工具栏,yes为显示;
    menubar,scrollbars 表示菜单栏和滚动栏。
    resizable=no 是否允许改变窗口大小,yes为允许;
    location=no 是否显示地址栏,yes为允许;
    status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;这样应该很清楚了吧,把这行代码写在链接的点击事件中
      

  3.   

    你WebForm1.aspx.cs中的代码有问题
            private void Page_Load(object sender, System.EventArgs e)
            {                if ( ! this.IsPostBack )  
                    this.BindData();        }
    就是这句,把if ( ! this.IsPostBack ) 去掉就可以原因:
    你在单击DataGrid的超链接时,页面刷新了,这样IsPostBack=true,所以页面上就没有了数据
      

  4.   

    不中!就是不中。。 niss() 的东西我都有。。可是用不着。。是DataGrid下的  超级链接  列!我的代码
    <asp:HyperLinkColumn Text="参数。。" DataNavigateUrlField="pname" DataTextField="pname" HeaderText="参数" DataTextFormatString="pname"
    DataNavigateUrlFormatString="javascript:varwin=window.open('WebForm2.aspx?ProductID={0}',null,'width=300,height=150')">
    </asp:HyperLinkColumn>这个history.forward()加上。。出错。JS出错。。语法错误。
      

  5.   

    请点这里,查看详细情况 http://www.lz.net.cn/bbs/X_AdvCom_Get.asp?UserID=7342
      

  6.   

    根据你的意思,改下代码:
    <ItemTemplate>
        <asp:hyperLink id=lnk commandname="view" .......></asp:...>
    </itemtemplate>然后在DataGrid的ItemCommand事件中加上下面代码:
    if(e.CommandName=="view")
    Response.Write("
    <script language='javascript'>
    window.open(
    'XXX.aspx', 
    'popupnav',
    'width=300,height=150,resizable=1,scrollbars=no, left = 500, top = 200'
    )
    </script>");
    解决!
      

  7.   

    至于你要给页面传参数,也一样,在xxx.aspx后面加就是了,要获取ID,
    ((TextBox)e.Item.findControl("id")).Text(如果你的ID也是绑定在TextBox模板列的话
      

  8.   

    使用<a href="a.aspx" target="_blank"></a>也可以实现啊!
      

  9.   

    DataNavigateUrlFormatString="javascript:window.open('WebForm2.aspx?ProductID={0}','_blank','width=300,height=150')">
      

  10.   

    <ItemTemplate>
    <A href='<%# DataBinder.Eval(Container, "DataItem.filepath") %>' target="_blank">
    <%# DataBinder.Eval(Container, "DataItem.subjects") %>
    </A>
    </ItemTemplate>直接从源文件中复制的哈。。
      

  11.   

    不要怎么麻烦,
    只要在datagrid使用模板列,在模板列里添加Hyperlink控件,让Hyperlink控件Target属性为"_blank"
    这样就会弹出窗口,当然要绑定数据
      

  12.   

    javascrip:varwin=window.open('datail.aspx?ID={0}',null,'width=300,height=200');window.close();我的事这么写的 写在url的连接下 不过不要生成模板列