以下是一段在.aspx文件中的代码,用于接收上一个页面传来的值:
<img id="Image2" src=Handler.ashx?id=**** width="107" height="98" />问题是:****处应该怎样写才能接收到上一个页面传来的一个字符串值我的写法是:<img id="Image2" src=Handler.ashx?id=<%# Request.QueryString["id"] %> width="107" height="98" />结果接收到的是空值我已经试过在它相应的.cs文件中这样写可以正确接收到传来的值:
protected void Page_Load(object sender, EventArgs e)
{
string a = Request.QueryString["id"]; Image1.ImageUrl ="Handler.ashx?ID="+ a;
}
<img id="Image2" src=Handler.ashx?id=**** width="107" height="98" />问题是:****处应该怎样写才能接收到上一个页面传来的一个字符串值我的写法是:<img id="Image2" src=Handler.ashx?id=<%# Request.QueryString["id"] %> width="107" height="98" />结果接收到的是空值我已经试过在它相应的.cs文件中这样写可以正确接收到传来的值:
protected void Page_Load(object sender, EventArgs e)
{
string a = Request.QueryString["id"]; Image1.ImageUrl ="Handler.ashx?ID="+ a;
}
int id;
id = Convert.ToInt32(context.Request.QueryString["id"]);
错误是:类型不对