Application Object!

A

Adam Knight

Hi all,

A basic question!!

I have a user control(.ascx) in my app.
I am trying to use use values stored in the appliacation object.

In the user control i am placing the code <%
Response.Write(Application("myVariable"))%>.
In classic asp this would work fine..but..when i execute the aspx page
containing the control the variable content is not outputted.

Any thoughts?

Sample Code:
<%@ Control Language="vb" autoeventwireup="true" Src="header.ascx.vb"
Inherits="myNameSpace.Header" %>
<% If Not(Request.QueryString("header") = "false") Then %>
<%Response.Write(Application("UrlPrefix"))%>
<asp:Table id="tblNavigation" cssClass="tblNavigation" cellSpacing="0"
Width="950" cellPadding="0" borderWidth="0" Runat="server">
<asp:TableRow runat="server"></asp:TableRow>
</asp:Table>
<% End If %>

Cheers,
Adam
 
D

dcassar

Your code looks okay, assuming Application("UrlPrefix") has something
in it.

Try something like this to see what's in there (air-coding, and I am a
c# guy):
If Application("UrlPrefix") Is Nothing Then
Response.Write("<NULL>")
Else
Response.Write("Type: " & Application("UrlPrefix").GetType().Name &
", Value: """ + Application("UrlPrefix").ToString() + """")
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top