比如说我在aspx里面写了Response.Write("<script language=javascript>window.open('image.htm?id=001');</script>");
image.htm的代码是这样的
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="VisualStudio.HTML" name="ProgId">
<meta content="Microsoft Visual Studio .NET 7.1" name="Originator">
</head>
<body>
<FONT face="宋体"><IMG height="376" alt="" src="" width="504"></FONT>
</body>
</html>
那这个scr=""该怎么做才能接收aspx页面传递过来的id呢

解决方案 »

  1.   

    1、用 Image 控件
    2、用 Literal 控件
    Literal.Text = "<IMG height="376" alt="" src=\"" + Request["id"] + "\" width="504">"
      

  2.   

    我是在.net里面新建一个htm页面啊
    <html>
    <head>
    <title></title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="VisualStudio.HTML" name="ProgId">
    <meta content="Microsoft Visual Studio .NET 7.1" name="Originator">
    </head>
    <body>
    <FONT face="宋体"><IMG height="376" alt="" src="" width="504"></FONT>
    </body>
    </html>
    只要告诉我<body>
    <FONT face="宋体"><IMG height="376" alt="" src="" width="504"></FONT>
    </body>
    这里面的scr=什么就行
      

  3.   

    比较矛盾
    又想要用静态页面,又想要获取服务器变量window.onload = function()
    {
        var location = window.location.href;
        var id = location.substring(location.indexOf("=") + 1);    document.getElemeentById('img').src = id;
    }