我尝试在以下通用处理程序中使用ASP.Net,但我在Page.RouteData
Reference to a non-shared member requires an object reference
我做错了什么?
<%@ WebHandler Language="VB" Class="MainHandler" %>
Imports System
Imports System.Web
Imports System.Xml
Public Class MainHandler : Implements IHttpHandler, System.Web.SessionState.IRequiresSessionState
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim lng As String = Page.RouteData.Values("locale")
End Sub
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property
End Class
对于任何答案,请记住我是新手,我的舌头语言是VB.NET :) 提前谢谢。
答案 0 :(得分:2)
Dim lng As String = HttpContext.Current.Request.RequestContext.RouteData.Values("locale")
答案 1 :(得分:0)