Solved

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

Posted on 2003-11-27
5
232 Views
Last Modified: 2010-04-16
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
Comment
Question by:Smoerble
5 Comments
 
LVL 20

Expert Comment

by:TheAvenger
ID: 9831524
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
 

Author Comment

by:Smoerble
ID: 9831636
Sorry, this is a complete different issue:

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

Accepted Solution

by:
_TAD_ earned 250 total points
ID: 9838513


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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# Single Form 8 42
PrintingFoundIt(Almost!(Damn!)) 1 27
FTP file download using c# 3 22
transaction in asp.net, sql server 6 32
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question