Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Application Object!

 
Thread Tools Search this Thread
Old 10-21-2005, 03:28 AM   #1
Default Application Object!


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




Adam Knight
  Reply With Quote
Old 10-21-2005, 05:10 AM   #2
dcassar@cmcdataworks.com
 
Posts: n/a
Default Re: Application Object!
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



dcassar@cmcdataworks.com
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to open Web Application pages (ASPX) in Windows application. arameshmca Software 1 02-07-2008 03:18 AM
Server Error in '/Forms' Application. AxleWack General Help Related Topics 0 10-11-2007 01:47 PM
How to revert file to unknown application perezla General Help Related Topics 1 09-12-2007 03:15 AM
Active X cannot create this object gellison General Help Related Topics 0 08-09-2007 06:42 PM
deploy web application behind a server (no NAT) xavoux Software 0 06-22-2006 01:11 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46