request cache isn't working

liunx

Guest
When I load the page I get no errors, however applicationTitle.Text is an empty string. Ultimately I want to store an object in the cache but I thought I would start with a simple string. Does anyone see a problem with this code?


global.asax
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
Context.Items.Add("appTitle", "Hello World!!")
End Sub


appTitle.ascx
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim _appTitle As String = CType(HttpContext.Current.Items("appTitle"), String)
applicationTitle.Text = _appTitle
End Sub
....
....
<asp:label id="applicationTitle" runat="server" />See if this helps:

<!-- m --><a class="postlink" href="http://64.233.179.104/search?q=cache:h7siwQqfnzEJ:www.ftponline.com/vsm/2003_05/magazine/columns/aspnet/default_pf.aspx+application+cache+vb.net+global.asax&hl=en">http://64.233.179.104/search?q=cache:h7 ... asax&hl=en</a><!-- m -->

Eric
 
Top