473,662 Members | 2,631 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\websi te
FLT\ats\asp\pt_ ats_listaAssist encias.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 2306
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******** ******@TK2MSFTN GP09.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\websi te
FLT\ats\asp\pt_ ats_listaAssist encias.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
12036
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 on the server (in our own accounts on the same machine). When I am testing both versions of our program using the same browser (IE on Windows or Konqueror on Linux) the session variables will mix up and only the latest selection or options will...
5
2253
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 display page uses pagination to break the results up into several subsequent pages. The 1st page is OK, but 2nd...last display pages loose the key word variable I initially posted. Seems I could keep passing the keyword with GET, I already use GET...
9
2641
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'; global $LOGINDIR;
11
4942
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., http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=Tidy7IDbDHA.2108%40cpmsftngxa06.phx.gbl) that indicate that ASP will queue up requests when they come in with the same "session".
8
18752
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 access databases. The server is a Dell Dual 2.4Ghz XEON with 512Mb Ram. Every few days I get the error 'HTTP/1.1 New Session Failed' and the server stops showing the sites. It comes right after a bit and then the error comes back. I
0
1507
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 XML 2005 Conference, the most respected educational gathering of technologists, novices, experienced implementers and users, consultants, and innovators to share knowledge and experiences, gain insight, and initiate new advancements in XML and...
10
1381
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 the address bar. For example *number of items to display *categories *brands *user_id *price interval *...
4
4073
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 have to click it twice to do the job (the first submit resets the sessions but this it too late to change the field values, which requires another submit to pick up the new session values). Problem is I cant think how to accomplish the resetting of...
4
1386
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. They'll have to register and login to access the job submit form. I want to use a PayPal buy now button, but this will take them off site to make payment. I know I can use sessions like they do in the register/login tutorial I'm using from the book PHP...
3
14254
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 print"$image_id";?>"></a>
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8547
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8633
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7368
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1754
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.