protected void Gridview_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "repertory")
        {
            Response.Redirect("Show.aspx?ID=" + e.CommandArgument.ToString());
        }
    }
怎么打开一个固定大小和位置,不需要工具栏、地址栏的页面

解决方案 »

  1.   

    使用window.open('aa.aspx','','width=100px,height=100px');
      

  2.   

    用div模拟弹层,或window.showModalDialog('a.aspx','','resizable:yes;scroll:yes;status:no;dialogWidth=320px;dialogHeight=230px;center=yes;help=no');
      

  3.   

    后台.cs
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
    string id = e.Row.Cells[0].Text;            e.Row.Attributes.Add("onclick", "javascript:showDialog('"+id + "');");
            } 
        }前台.aspx
    function showDialog(id)
    {
    window.open('aa.aspx?id' + id,'','width=100px,height=100px'); 
    }
      

  4.   

    在模版列里放<div onclick="JavaScript::window.open('aa.aspx?id' + id,'','width=100px,height=100px'); ">>>></div>
      

  5.   

    前台代码(版本)
    <script>
    var url="";var agruments=new Object();agrument.window=window;
    window.showModalDialog(url,arguments,"dialogWidth;100px;dialogHeight:100px;center:yes:status:no;scroll:yes;help:no");
    </script>
    后台代码(版本)
    string str = "<script language = 'javascript'>";
           str += "var url='Default2.aspx'; var arguments=new  Object(); arguments.window=window;";
           str += "window.showModalDialog(url,arguments,'dialogWidth:400px;dialogHeight:300px;center:yes:status:no;scroll:yes;help:no')";
           str+="</script>";
           Response.Write(str );
      

  6.   

    <a href="#" onclick="window.open(' <%# Eval("J_jobId")%>');">职位详细信息 </a> 
    function open(s) { 
                loc_x = document.body.scrollLeft + event.clientX - event.offsetX + 100; 
                loc_y = document.body.scrollTop + event.clientY - event.offsetY + 170; 
                window.open("JobsView.aspx?J_jobId="+s, "", "edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:350px;dialogHeight:350px;dialogTop:" + loc_y + "px;dialogLeft:" + loc_x + "px"); 
            } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 
        { 
            if (e.Row.RowIndex != -1) 
            { 
                e.Row.Attributes.Add("onclick", "open('" + this.GridView1.DataKeys[e.Row.RowIndex].Value.ToString().Trim() + "')"); 
            } 
        } 
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 
        { 
            if (e.Row.RowType == DataControlRowType.DataRow) 
            {           ((HyperLink)e.Row.Cells[0].FindControl("HyperLink1")).Attributes.Add("onclick", "windows.open('')"); 
            
                ((HyperLink)e.Row.Cells[0].Controls[0]).Attributes.Add("onclick", "windows.open('')"); 
            } 
        }
    function open(url) 
    { } 
    <ItemStyle HorizontalAlign ="Center" /> <ItemTemplate> <a href="javascript:open(' <%#Eval("Id")%>');"> 
    <%#Eval("Subject")%> </a> 
    </ItemTemplate> 
    </asp:TemplateField> 
    function open(Id) {         URL = "a.aspx?Id=" + Id; 
            myleft = (screen.availWidth - 500) / 2; 
            window.open(URL, "", "height=500,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=100,left=" + myleft + ",resizable=yes"); 
        }