Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 15th, 2003, 12:43 PM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Accessing Server Side Data on Client Side

How do you access data gathered on the server side (by any means, whether it be from a database, or other means) from the client side?
Especially within event handlers on the client side? I would think this would be a very desireble need, yet I can't find anything on it
specifically. Maybe you can't.

My knowledge at this point is access as far as Session variables, application variables, page and function scope.

Here is an excellent example: you query data from a database, obviously on the server side. Now, how would you access this data on the client side. I am leaving this as a very broad question on purpose.

 
Old October 15th, 2003, 01:40 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can't access anything from the client to the server apart from requesting a page if you are using only the browser. You need to pass everything you expect to need to the client by means of HTML: hidden form elements, javascript variables/arrays, etc. Then when you have client side events, you can have javascript access that data.

Alternatively you can use ActiveX objects or Java applets that get downloaded to and run at the broser.

If you want to do something more fancy within the browser alone, you could build a frameset with a hidden frame and use that frame as a "talker" to the server. You can force posts or gets thru that frame, then the frame returns with javascript that provides data and the actions necessary for the event you called (populating HTML controls etc). This would make more of an application feel to a web page.

Session/application/page/function vars are all only within the scope of the server-side application. And remember that once the server is done processing one ASP, it's gone. And thus is the bane of the ASP programmers existence: the statelessness of the web.

Peter
 
Old October 15th, 2003, 02:19 PM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, I see what you are saying, that has been the most helpful response thus far. I like the idea about frames, I am still learning web developement and have not fully covered frames and dynamic html. My primary skills are in C++ and algorithm development and I was thinking is more along those lines.

 
Old October 15th, 2003, 02:33 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Do some background reading on ASP so you can get familiar with the whole statelessness issue of web applications. When you have been writing desktop software it can be very hard to come to grips with the disconnected nature of a web app. There are plenty of intro and beginning books in the wrox/wiley/apress libraries that explain it. If you haven't yet gotten into ASP yet, you might concider starting with ASP.Net. Paticularly because you could jumpt right into the C# language (versus dealing with VBScript in ASP) and could cover one hurdle pretty quick.

Good luck!

Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Converting Client-side to Server-side Code kwilliams ASP.NET 2.0 Professional 1 November 21st, 2007 05:25 PM
Firing server side events at client side codes mehdi62b ASP.NET 1.0 and 1.1 Basics 6 May 18th, 2005 09:11 AM
sharing a server-side variable with client-side pigtail Javascript How-To 6 November 4th, 2004 02:01 AM
storing data client side Anjali VBScript 3 September 3rd, 2004 05:24 PM
Two Client Side vs Server Side issues Milo Classic ASP Professional 5 May 25th, 2004 02:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.