Does ASP.Net have an equivalent to this?

Discussion in 'ASP .Net' started by Jim Bancroft, Nov 20, 2004.

  1. Jim Bancroft

    Jim Bancroft Guest

    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
    Jim Bancroft, Nov 20, 2004
    #1
    1. Advertising

  2. 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

    http://www.4GuysFromRolla.com

    * When you think ASP.NET, think 4GuysFromRolla.com!
    Scott Mitchell [MVP], Nov 20, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    Does a resource have to have all phrases in it?

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Jan 30, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    375
    Neil Ni
    Feb 3, 2006
  2. Replies:
    5
    Views:
    406
  3. Replies:
    8
    Views:
    5,359
  4. Replies:
    1
    Views:
    122
    Florian Frank
    Nov 26, 2005
  5. Shadowfirebird
    Replies:
    5
    Views:
    1,081
    Shadowfirebird
    Nov 11, 2010
Loading...

Share This Page