473,511 Members | 14,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieve asp.net session variable within HTA page?

Hello.

I have an aspx page with a button onclick that opens an HTA page that
simply runs javascript to open a client desktop application...the aspx
form remains open.

I would like to set which file should be opened by the HTA based on a
session variable set in the aspx page.

Having a total brain-fade on this. Tried the following in the HTA with
no luck:

<html>
<%@language="vbscript"%>
<%= session.getAttribute( "KB_Test" ) %>
<head>
<title>Session Test</title>
<HTA:APPLICATION ID="oHTA"/>
</head>
<body>
<p>Test: <%=KB_Test%></p>
</body>
</html>

Please, what am I missing...other than a piece of my brain?

Thanks,
Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
5 2745
Kathy,

Not sure where the .getAttribute method comes from... could this be your
problem?

Regards,
Jason S.

"Kathy Burke" <ka**********@attbi.com> wrote in message
news:O0**************@TK2MSFTNGP10.phx.gbl...
Hello.

I have an aspx page with a button onclick that opens an HTA page that
simply runs javascript to open a client desktop application...the aspx
form remains open.

I would like to set which file should be opened by the HTA based on a
session variable set in the aspx page.

Having a total brain-fade on this. Tried the following in the HTA with
no luck:

<html>
<%@language="vbscript"%>
<%= session.getAttribute( "KB_Test" ) %>
<head>
<title>Session Test</title>
<HTA:APPLICATION ID="oHTA"/>
</head>
<body>
<p>Test: <%=KB_Test%></p>
</body>
</html>

Please, what am I missing...other than a piece of my brain?

Thanks,
Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2
Just trying things from examples I've seen.

Then I thought, it would be easier just to pass a querystring to the
hta form -- but this doesn't seem to work?

My asp.net is:

Dim strTest As String = "Hello Kathy"
RegisterClientScriptBlock("Test",
"<script>window.open('TEST.hta?filename= ' + strTest', 'Test',
'menubar=no');</script>")

My hta is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<%@language="vbscript"%>
<%= varFilename=request.querystring("filename") %>
<head>
<title>Session Test</title>
<HTA:APPLICATION ID="oHTA"/>
</head>
<body>
<p>Test: <%= varFilename %></p>
</body>
</html>

But I don't see the querystring variable...?

Clues?

Thanks,

Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3
Been awhile since I read about HTA's. I wouldn't have commented in the
first place except I saw what looked like a bad method call. Read as much
as you can about HTA's on MSDN... not sure if they honor querystrings or how
you pass parameters to them.

Jason S.

"Kathy Burke" <ka**********@attbi.com> wrote in message
news:uv**************@TK2MSFTNGP11.phx.gbl...
Just trying things from examples I've seen.

Then I thought, it would be easier just to pass a querystring to the
hta form -- but this doesn't seem to work?

My asp.net is:

Dim strTest As String = "Hello Kathy"
RegisterClientScriptBlock("Test",
"<script>window.open('TEST.hta?filename= ' + strTest', 'Test',
'menubar=no');</script>")

My hta is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<%@language="vbscript"%>
<%= varFilename=request.querystring("filename") %>
<head>
<title>Session Test</title>
<HTA:APPLICATION ID="oHTA"/>
</head>
<body>
<p>Test: <%= varFilename %></p>
</body>
</html>

But I don't see the querystring variable...?

Clues?

Thanks,

Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #4
Joe
Been a bit since I've used HTAs too but I think Jason's right about the
request.querystring. As far as I remember, HTA's execute client-side
vbscript and jscript.

I know it would be a pain in the nether region but maybe you'll have to
generate the hta dynamically and save it on the server before opening it
using whatever class corresponds in asp.net to the old filesystem object in
classic asp, probably system.io.

If it's an intranet situation and you want to open an M$ Office program I've
used automation successfully to open Word and enter info from a database on
the server in the new document. It's no great leap to do the same kind of
thing with Excel or Access.

Just my penny's worth - it's an interesting question.

Joe
"Jason S" <so*****@somewhere.com> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Been awhile since I read about HTA's. I wouldn't have commented in the
first place except I saw what looked like a bad method call. Read as much
as you can about HTA's on MSDN... not sure if they honor querystrings or how you pass parameters to them.

Jason S.

"Kathy Burke" <ka**********@attbi.com> wrote in message
news:uv**************@TK2MSFTNGP11.phx.gbl...
Just trying things from examples I've seen.

Then I thought, it would be easier just to pass a querystring to the
hta form -- but this doesn't seem to work?

My asp.net is:

Dim strTest As String = "Hello Kathy"
RegisterClientScriptBlock("Test",
"<script>window.open('TEST.hta?filename= ' + strTest', 'Test',
'menubar=no');</script>")

My hta is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<%@language="vbscript"%>
<%= varFilename=request.querystring("filename") %>
<head>
<title>Session Test</title>
<HTA:APPLICATION ID="oHTA"/>
</head>
<body>
<p>Test: <%= varFilename %></p>
</body>
</html>

But I don't see the querystring variable...?

Clues?

Thanks,

Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 18 '05 #5
use Rane to communicate with asp.net
http://www.lostinet.com/en/lwsamplecs/?framesrc=rane/
download the hta sample:
http://www.lostinet.com/en/lwsamplecs/rane/Exama.hta

"Kathy Burke" <ka**********@attbi.com> ????
news:uv****************@TK2MSFTNGP11.phx.gbl...
Just trying things from examples I've seen.

Then I thought, it would be easier just to pass a querystring to the
hta form -- but this doesn't seem to work?

My asp.net is:

Dim strTest As String = "Hello Kathy"
RegisterClientScriptBlock("Test",
"<script>window.open('TEST.hta?filename= ' + strTest', 'Test',
'menubar=no');</script>")

My hta is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<%@language="vbscript"%>
<%= varFilename=request.querystring("filename") %>
<head>
<title>Session Test</title>
<HTA:APPLICATION ID="oHTA"/>
</head>
<body>
<p>Test: <%= varFilename %></p>
</body>
</html>

But I don't see the querystring variable...?

Clues?

Thanks,

Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4123
by: Marc Rivait | last post by:
Here is a very interesting scenario. I have a simple test application that loads a page and sets a session variable on the load event. On the first page there is a link to a second page. The...
4
2153
by: Stephen | last post by:
I have a .NET (1.1 framework) application that is losing a session variable on only a few PC's. The main page is loading up in a frame in a Portal application. On the Page_Load it stores an...
5
2191
by: ASP.Confused | last post by:
As you can tell from my previous posts on this issue...I'm really confused :-/ I have a few ASP.NET web applications on my web host's "https" server. Our web host has a single "bin" folder for...
1
366
by: ChrisN | last post by:
Hi there, Two questions related to each other. 1. Session variables expire by defualt when not used for 20 minutes. Does "used" mean that a user has not access any session varibles in 20...
3
2664
by: Phillip N Rounds | last post by:
I'm writing a user control which has two states: Active & InActive. I additionally am required that there to be only one active control per page, and all logic has to be contained within the...
1
2402
by: whidbey | last post by:
Hello friends, I am whidbey, new to thescripts and dot net as well.I am working over Online Shopping Cart,web application.I design a page (webform5.aspx) where user search books then select the books...
0
1979
by: whidbey | last post by:
Hello friends, I am whidbey, new to thescripts and dot net as well.I am working over Online Shopping Cart,web application.I design a page (webform5.aspx) where user search books then select the books...
4
1485
by: John Wright | last post by:
I use the following code to set a session variable for people I have authenticated to my site: For Each row As DataRow In foundRow Session("Login") = row.Item(1).ToString Exit For Next
6
3753
by: ChrisAtWokingham | last post by:
I have been struggling with unexpected error messages on an ASP.NET system, using SQL and C#. The application draws organisation charts, based on data stored in the SQL database. Some of the chart...
0
7349
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.