Does ASP.Net have an equivalent to this?


Jim Bancroft

Hi all,

I'm porting an ASP application to ASP.Net, and wondered if there was an
equivalent to the COM Services' "ObjectContext" class.

For instance, I'd like to port this code from VB6. It queries some ASP form
values using the object context:


Dim objContext As COMSVCSLib.ObjectContext
Set objContext = GetObjectContext
myVar = objContext("Request").Form("ValueXYZ")

Is there a generally accepted way of doing the same thing, of "getting at"
ASP.Net form variables in an existing assembly? Any tips or advice or links
you could give me I'd appreciate, and thanks.




Scott Mitchell [MVP]

Jim, in your .NET component use:


And off you go. (i.e., HttpContext.Current.Request.Form["blah"], or

(Make sure your component has System.Web.dll in its References folder,
and that you have using System.Web; (C#) or Imports System.Web (VB.NET)
in the top of your class file!)

Happy Programming!


Scott Mitchell
(e-mail address removed)

* When you think ASP.NET, think!