我总共用了这些方法!但是都不行 
我的target是'mainFrame' 页面是:/WineByTypeAndName.aspx 
救命啊: 
第1种不行 
string url= "<scriptlanguage='javascript'type='text/javascript'>parent.window.frames['mainFrame'].location.href='/WineByTypeAndName.aspx;</script>"; 
Response.Write(url); 
第2种也不行 
Response.Write("<script>mainFrame.location.replace'/WineByTypeAndName.aspx');</script>"); 
第3种也是不行 
Response.Write("<script language='javascript'>window.open('/WineByTypeAndName.aspx','mainFrame');</script>");

解决方案 »

  1.   

    我第3个就是windows.open啊
    Response.Write("<script language='javascript'>
    window.open('/WineByTypeAndName.aspx','mainFrame');</script>");
      

  2.   

    Redirect不可以设置target的,用a标记或者js来控制。
      

  3.   

    Redirect不可以设置target的,用a标记或者js来控制。
      

  4.   

    第三种都不行?
    你改一下第一种:
    string url= "<scriptlanguage='javascript'type='text/javascript'>parent.window.document.getElementById('mainFrame').contentWindow.location.href='/WineByTypeAndName.aspx';</script>";
    Response.Write(url);
      

  5.   

    string url= "<scriptlanguage='javascript'type='text/javascript'>parent.window.frames['mainFrame'].location.href='/WineByTypeAndName.aspx;</script>";
    Response.Write(url); 
    -----------------
    这里写的有问题,scriptlanguage中间没有空格隔开,而且WineByTypeAndName.aspx后也没单引号try:string url= "<script>top.mainFrame.location.href='/WineByTypeAndName.aspx;'</script>";
    Response.Write(url);
      

  6.   

    还是不行....
    是不是这样改
    string url = "<script language='javascript' type='text/javascript'>parent.window.document.getElementById('mainFrame').contentWindow.location.href='/WineByTypeAndName.aspx';</script>";
    Response.Write(url);
      

  7.   

    <iframe id="mainFrame" src="" width="100%" height="100%" runat="server"></iframe>
    在添加一个button
    里面写一句:
    mainFrame.Attributes.Add("src","WineByTypeAndName.aspx ");
    看看
      

  8.   

    还是不行....
    是不是这样改
    string url = "<script language='javascript' type='text/javascript'>parent.window.document.getElementById('mainFrame').contentWindow.location.href='/WineByTypeAndName.aspx';</script>";
    Response.Write(url);
    ==============
    上面的不行?
      

  9.   

    你 转到的页面地址 里面那个‘/’干什么啊,去掉。
    ==========
    这个'/'不可以去掉的我用Redirect 转向时 不要target时 页面转向没问提