Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Using Context Object Disadvantages !!?

Using Context Object Disadvantages !!?

Scheduled Pinned Locked Moved ASP.NET
questionsysadmintutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Naif_Prof
    wrote on last edited by
    #1

    hi what is thr Disadvantages of using Using Context Object to pass parameter between pages? the folowing is example //page1.aspx.cs this.Context.Items["x"] = TextBox1.Text; Server.Transfer("page2.aspx", true); //page2.aspx.cs TextBox1.Text = this.Context.Items["x"].ToString();

    N 1 Reply Last reply
    0
    • N Naif_Prof

      hi what is thr Disadvantages of using Using Context Object to pass parameter between pages? the folowing is example //page1.aspx.cs this.Context.Items["x"] = TextBox1.Text; Server.Transfer("page2.aspx", true); //page2.aspx.cs TextBox1.Text = this.Context.Items["x"].ToString();

      N Offline
      N Offline
      nature0276
      wrote on last edited by
      #2

      The disadvantage is that you can pass between pages only within the scope of the paticular request. You cannot use Response.Redirect() with Collection Item.... If you use Server.Transfer the URL does not get updated for the users. You can use Session Object. Hope Helped. Happy Programming....

      Sanjeev

      N 1 Reply Last reply
      0
      • N nature0276

        The disadvantage is that you can pass between pages only within the scope of the paticular request. You cannot use Response.Redirect() with Collection Item.... If you use Server.Transfer the URL does not get updated for the users. You can use Session Object. Hope Helped. Happy Programming....

        Sanjeev

        N Offline
        N Offline
        Naif_Prof
        wrote on last edited by
        #3

        thanks Sanjeev, I understand from you the following: If we pass variable value from page 1 to page 2 by using context.item and server.transfer We can get the variable value in page 2 only so we can not get it in page 3 or page 4 But if we use session we can get it during the session in any page but it will consume the RAM and professional programmer don’t prefer to use the session thanks again

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups