public class AjaxHandler : System.Web.IHttpHandler
{
#region IHttpHandler 成员
public bool IsReusable
{
get { return false; }
}
HttpContext context;
public void ProcessRequest(HttpContext _context)
{
context = _context;
System.Web.UI.Page page = new System.Web.UI.Page();
//因为我现在动态加载了一个用户控件,但我的用户控件里面的取值是通过Request.QueryString取得数据
//但是因为我这里是通过new System.Web.UI.Page();出来的对像
//所以默认他的Request.QueryString是空对像
//这个时候我如何把我的context.Request.QueryString赋值给他呢?
Control userControl = page.LoadControl(template + ".ascx");
}//谢谢
//但是因为我这里是通过new System.Web.UI.Page();出来的对像
//所以默认他的Request.QueryString是空对像
//这个时候我如何把我的context.Request.QueryString赋值给他呢?把原来的Request.QueryString换成context.Request.QueryString
但我查看转到定义发现Requery只有get属性
public HttpRequest Request { get; }
Request是只读的,只能请求,不能赋值
那我用new page load进来的对像,如何来取当前httpHeader的request对像呢?
for (int i = 0; i < c.Count; i++)
{
string value = c[i].ToString();
}
public HttpRequest UserRequest { get; set; }
吗?
for (int i = 0; i < c.AllKeys.Length; i++)
{
string key = c.Keys[i];//获取键名
string value= c.GetKey(i);//获取键值
}
问题是:
我如何把这个对像赋值给UserControl
他的Requery只有Get没有Set