Using Context Object Disadvantages !!?
-
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();
-
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();
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
-
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
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