Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / May 2008

Tip: Looking for answers? Try searching our database.

Problem passing data between pages

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 30 May 2008 02:45 GMT
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.EventArgs) Handles btnSubmit.Click
 Dim Msg As String

 Context.Items("Msg") = Msg
 Response.Redirect("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.EventArgs)
Handles Me.Load
  lblMsg.Text = CType(Context.Items("Msg"), String)
End Sub

What is the problem and how can I fix it?

Thanks

Regards
Mark Rae [MVP] - 30 May 2008 03:40 GMT
> What is the problem

You're trying to use Context with Response.Redirect:
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=15

> and how can I fix it?

1) Use Server.Transfer

2) Use Session

3) Use a QueryString

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.