how to convert string to System.Web.HttpContext

Last post 07-06-2009 3:47 AM by Bober Song - MSFT. 5 replies.

Sort Posts:

  • how to convert string to System.Web.HttpContext

    07-05-2009, 7:29 AM

    how to convert string to System.Web.HttpContext

  • Re: how to convert string to System.Web.HttpContext

    07-05-2009, 11:23 AM
    • Participant
      989 point Participant
    • Scott927
    • Member since 09-20-2006, 4:53 AM
    • Phoenix, AZ
    • Posts 181

    You can't directly convert a string to an HttpContext object. That would be like asking someone how to convert a tire into a car. Can you be a little more descriptive about exactly what it is you want to do?

    Scott M Schluer
    ---
    MCPD: ASP.NET Developer 3.5
  • Re: how to convert string to System.Web.HttpContext

    07-05-2009, 8:39 PM
    • Star
      12,441 point Star
    • malcolms
    • Member since 06-12-2008, 4:38 AM
    • Melbourne, Australia
    • Posts 2,044

    Hi.  Can you be more specific about what you're trying to do? 

    You can't convert HttpContext to a string, but some of the properties it exposes can return strings.

    Sincerely,
    Malcolm Sheridan

    Microsoft Certified Solution Developer
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as
    Answer" if a marked post does not actually answer your question.
  • Re: how to convert string to System.Web.HttpContext

    07-06-2009, 1:09 AM
    • Contributor
      7,266 point Contributor
    • sirdneo
    • Member since 12-16-2008, 5:45 AM
    • Karachi, Pakistan
    • Posts 1,141

    You can't convert string to System.Web.HttpContext. Kindly provide me details that what you want to accomplish.

    Thanks,
    Zeeshan Umar

    ~Please Mark As Answer, if one or multiple posts, which helped you in your problem. So that it might be useful for others~

    My Blog
  • Re: how to convert string to System.Web.HttpContext

    07-06-2009, 1:38 AM
    • Member
      132 point Member
    • safzal1212
    • Member since 02-22-2008, 8:16 PM
    • Posts 77

     No you can not do that.

  • Re: how to convert string to System.Web.HttpContext

    07-06-2009, 3:47 AM
    Answer

     Hi Sanjeev.Kejriwal,

    You can not convert string to System.Web.HttpContext.

    Based on my understanding, I think you want to add an item to System.Web.HttpContext.

    You can use the following code to add value:

    Context.Items["oneItem"] = "add one item value";

    The static property Current on the HttpContext class can be useful whenever the flow of control leaves the code in your Page derived web form. Using this property you can reach out and magically grab the current Request, Response, Session, and Application objects (and more) for the request you are servicing

    For more information which is related to the System.Web.HttpContext, please check the following links:

    Working With HttpContext.Current
    http://odetocode.com/Articles/112.aspx
    http://www.odetocode.com/Articles/111.aspx
    http://aspnet.4guysfromrolla.com/articles/060904-1.aspx
    http://msdn.microsoft.com/en-us/library/system.web.httpcontext.current.aspx
    http://msdn.microsoft.com/en-us/library/system.web.httpcontext.aspx

    I hope it is helpful to you.

    Best Regards,
    Bober Song
    --------------------------------
    Please remember to click “Mark as Answer” on the post that helps you
Page 1 of 1 (6 items)