Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

C# (urgent): share Application Variables between C# and ASP/VB?

Hi all,
I need to access the same data from some ASP/VB scripts and also from some C# scripts.

In VB it's done this way:
------------------------
Application("xxx") = "dummyData"
------------------------

I try to access it in C# with this code:
------------------------
if (Application["xxx"] != null)
      Response.Write("App(xxx): "+ Application["xxx"].ToString()+"<br>");
else
      Response.Write("App(xxx) is null :(<br>");
------------------------

It allways returns the else part, why does it not find the data inside the Application variable?

Thank you and best regards
0
Smoerble
Asked:
Smoerble
1 Solution
 
TheAvengerCommented:
I don't know why you ask almost the same question again, but I already gave you the solution here:

http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20809219.html
0
 
SmoerbleAuthor Commented:
Sorry, this is a complete different issue:

I set the Application variable in setVar.asp and want to read it in getVar.aspx.
0
 
_TAD_Commented:


This is an interesting thread, something that I have not done before (but may do in the future).


Personally I would look into using MarshalAs or MarshalByRef attributes.

I know that if you are trying to use C++ variable declarations in C# sometimes you need to use the MarshalAs attribute.


This probably doesn't help any since the variables are being declared and used inside the .Net framework.  However I would be very interested in seeing the resolution if you get it working.

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now