【问题标题】:ReadOnly Property Request As System.Web.HttpRequest is not accessible in this context because it is FriendReadOnly Property Request As System.Web.HttpRequest 在此上下文中不可访问,因为它是 Friend
【发布时间】:2011-01-06 18:33:19
【问题描述】:

我需要读取 ashx 处理程序的上下文值。

Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
        Dim Resp As System.Web.HttpResponse = context.Response
        Dim dd = Resp.Request... ' HERE COMES THE ERROR
    End Sub

问题是当我尝试读取位于dd.Request.Response.Request.Form 的值时出现以下错误

ReadOnly Property Request As System.Web.HttpRequest 在此上下文中不可访问,因为它是 Friend

那么我在这里做错了什么?

【问题讨论】:

    标签: asp.net vb.net httprequest


    【解决方案1】:

    你不应该这样做:

    Dim dd = context.Request 'Access the http request from the context instead of the response
    

    您使用响应来获取请求是否有原因?

    HTH。

    【讨论】:

    • 不,没有这个理由!我只是一个新手!非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-22
    • 2020-06-27
    • 2013-01-05
    • 2021-04-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多