Problem passing data between pages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Problem passing data between pages

    Hi

    From the calling page I am assigning value a string to context as below;

    Protected Sub btnSubmit_Click (ByVal sender As Object, ByVal e As
    System.EventArg s) Handles btnSubmit.Click
    Dim Msg As String

    Context.Items(" Msg") = Msg
    Response.Redire ct("Called_Page .aspx")
    End Sub

    In the called page I have the below code to pick the info from context but
    no information is received;

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArg s)
    Handles Me.Load
    lblMsg.Text = CType(Context.I tems("Msg"), String)
    End Sub

    What is the problem and how can I fix it?

    Thanks

    Regards


  • Mark Rae [MVP]

    #2
    Re: Problem passing data between pages

    "John" <info@nospam.in fovis.co.ukwrot e in message
    news:OobqNbfwIH A.5584@TK2MSFTN GP02.phx.gbl...
    What is the problem
    You're trying to use Context with Response.Redire ct:

    and how can I fix it?
    1) Use Server.Transfer

    2) Use Session

    3) Use a QueryString


    --
    Mark Rae
    ASP.NET MVP


    Comment

    Working...