Response.Redirect("ImageCode.aspx?strText = "+strText+"&strSize = "+strSize+"&strColor = "+strColor+"&imgWith = "+imgWith+"&imgHeight = "+imgHeight+"");
//Image1.Visible = true;
aspx.cs页面 string strText = Request.QueryString["strText"].ToString();
string strSize = Request.QueryString["strSize"].ToString();
string strColor = Request.QueryString["strColor"].ToString();
string imgWith = Request.QueryString["imgWith"].ToString();
string imgHeight = Request.QueryString["imgHeight"].ToString();为什么会报错?为将对象引用到实例!
//Image1.Visible = true;
aspx.cs页面 string strText = Request.QueryString["strText"].ToString();
string strSize = Request.QueryString["strSize"].ToString();
string strColor = Request.QueryString["strColor"].ToString();
string imgWith = Request.QueryString["imgWith"].ToString();
string imgHeight = Request.QueryString["imgHeight"].ToString();为什么会报错?为将对象引用到实例!
if(String.IsNullOrEmpty(Request.QueryString["strText"])!=false)
{
strText = Request.QueryString["strText"].ToString();
}
string strSize = Request.QueryString["strSize"]==null?"":Request.QueryString["strSize"].ToString();
string strColor = Request.QueryString["strColor"]==null?"":Request.QueryString["strColor"].ToString();
...
Response.Redirect("ImageCode.aspx?strText = "+strText+"&strSize = "+strSize+"&strColor = "+strColor+"&imgWith = "+imgWith+"&imgHeight = "+imgHeight+"");