【发布时间】:2011-05-05 18:49:38
【问题描述】:
我想将字符串传递给 .ashx 页面。
通常我会通过在 .aspx 页面中设置参数来做到这一点,例如:Loader="TreeLoader.ashx?passedVariable=hello"
但我想在 .aspx.cs 端以编程方式执行此操作,因为值会改变。
.ashx 页面接受 HTTPContext:
public void ProcessRequest(HttpContext context)
{
不应该有什么办法给上下文加个参数,然后用类似这样的方式获取参数:
string searchString = context.Request["searchString"];
实现这一目标的最佳方法是什么?
【问题讨论】: