473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ASP vs ASP.NET sessions (2nd post)

I there,

I'm trying to use the same session varaibles in both .asp and .aspx
pages, but I can't. (i'm using VB.NET)

Error using cast...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30188: Declaration expected.

Source Error:
Line 8: dim msg as string = "Sessões"
Line 9:
Line 10: msg = ctype( session("SnPor-DIST-id"), string )
Line 11:
Line 12: Sub Page_Load( Sender as Object, e As EventArgs )
Source File: D:\trabalhos Filtrarte\website
FLT\ats\asp\pt_ats_listaAssistencias.aspx Line: 10
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

Error using session as in ASP page
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30188: Declaration expected.

Source Error:

Line 8: dim msg as string = "Sessões"
Line 9:
Line 10: msg = context.session("SnPor-DIST-id")
Line 11:
Line 12: Sub Page_Load( Sender as Object, e As EventArgs )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

using like ASP response.write page
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
<%= ">" & session("SnPor-DIST-id") & "<" %>

in the html code, I just have ><
seams the session is empty... but if I open the ASP page in the same moment,
I can see it isn't empty.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

could anyone help me on this, please?
thank you in advance
Bruno Alexandre,
(Sintra, PORTUGAL)

Nov 17 '05 #1
1 2288
There are 2 issues here

1) You are getting a compile time error. Not a runtime error. That means
your code cannot compile.

The reason it cannot compile, is that script blocks can have either
functions or just script code <script runat="server"></script> blocks may
contain ONLY functions and class level declaration. <% %> blocks may have
script code that just runs. Line 10 would belong in a <% %> type block -
and because it is not, you are getting a compile time error.

2) This will not work anyway, since ASP and ASP.NET run in 2 different
processes and thus cannot share session state. You will have to pass it via
query string, store it in a db, etc. Basically find another way to pass data
back and forth.

"Bruno Alexandre" <br*************@filtrarte.com> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
I there,

I'm trying to use the same session varaibles in both .asp and .aspx
pages, but I can't. (i'm using VB.NET)

Error using cast...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30188: Declaration expected.

Source Error:
Line 8: dim msg as string = "Sessões"
Line 9:
Line 10: msg = ctype( session("SnPor-DIST-id"), string )
Line 11:
Line 12: Sub Page_Load( Sender as Object, e As EventArgs )
Source File: D:\trabalhos Filtrarte\website
FLT\ats\asp\pt_ats_listaAssistencias.aspx Line: 10
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Error using session as in ASP page
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30188: Declaration expected.

Source Error:

Line 8: dim msg as string = "Sessões"
Line 9:
Line 10: msg = context.session("SnPor-DIST-id")
Line 11:
Line 12: Sub Page_Load( Sender as Object, e As EventArgs )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

using like ASP response.write page
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<%= ">" & session("SnPor-DIST-id") & "<" %>

in the html code, I just have ><
seams the session is empty... but if I open the ASP page in the same moment, I can see it isn't empty.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

could anyone help me on this, please?
thank you in advance
Bruno Alexandre,
(Sintra, PORTUGAL)

Nov 17 '05 #2

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

Similar topics

13
by: jing_li | last post by:
Hi, you all, I am a newbee for php and I need your help. One of my coworker and I are both developing a webpage for our project using php. We have a copy of the same files in different location...
5
by: leegold2 | last post by:
Probably a newbie question about "state": My problem is I have a search form, so user enters a keyword <enter>, then this form posts to another page were the result are displayed. But this...
9
by: Bartosz Wegrzyn | last post by:
I need help with sessions. I createt set of web site for nav with authorization. first I go into main.php which looks like this: <?php //common functions include_once '../login/common.php';...
11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
8
by: riprod | last post by:
Someone in the IIS newsgroup suggest I post this here, so sorry in advance for the cross posting. I have a Win 2003 SP1 with IIS 6 and host about 40 websites, most of them useing ASP/VB with...
0
by: melledge | last post by:
The Reliable Source for Everything XML - XML 2005 Update XML 2005 - November 14-18 - Atlanta Hilton Hotel - Atlanta, GA www.xmlconference.org Register today and participate in IDEAlliance's...
10
by: julian_m | last post by:
i'm finishing my 2nd php project. It's a sort of catalog and I used css/mysql as well. All the functionality of the site is mainly beacause the great number of arguments I pass to every page on...
4
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I...
4
by: DavidPr | last post by:
I'm trying to put together a simple job program to use in my community where people can post job ads. It'll cost to place an ad, but I'm having trouble figuring out how to work the paying part. ...
3
by: nse111 | last post by:
I use PHP sessions to pass a value from one page to another. In my 1st page I pass a value called 'id' to my 2nd page using a hyperlink. explained: <a href="abc.php?id=<?php...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.