Does ASP.Net have an equivalent to this?

J

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:


//myComponent.cls

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.

-Jim
 
S

Scott Mitchell [MVP]

Jim, in your .NET component use:

HttpContext.Current.

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

(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)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top