Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 16th, 2004, 01:19 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Popup Windows

I have a client who's driving me crazy. He keeps insisting on a solution that uses ASP instead of javaScript to launch a new window with an image in it and resize the window to the dimension of the image.

I can't convince him that javascript is the only way. Since I'm not an ASP expert, can anyone tell me if its possible to do such a thing in ASP? Can someone please help. I've include the exact words of the client below:

 
Quote:
quote:Actually, there is a very specific reason that I need the script to perform
Quote:
in a very specific way. I would take me a while to explain it all, but
basically the exact way I need the script to function is:

- someone clicks a simple URL link
- link calls an ASP script and passes a variable (new URL)
- ASP script receives a variable (new URL)
- script processes that variable (URL) and opens a specific sized,
controlled new window using the variable (URL) as the address placed within
that window.
- the window also has to have all button bars, status bar, etc. removed.
Should only have scroll bars as needed.
Reply With Quote
  #2 (permalink)  
Old March 16th, 2004, 01:36 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can give him this very specific answer (feel free to quote me):

ASP runs at server
JavaScript runs at client
Server can not tell the client to open a new window. Server can only tell the client to execute a script within the page it gets back. That script can then launch another browser window. It simply cannot be done another way.

Peter
------------------------------------------------------
Work smarter, not harder.
Reply With Quote
  #3 (permalink)  
Old March 16th, 2004, 01:36 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Well, that's safe to answer: That's not going to work without script.

ASP Script runs at the server. Over there it can do all kinds of fancy stuff, but in the end, all it can do is send content back to the client. It can't open new windows, it can't hide the back button, it can't change the paper orientation when printing; all it can do is push data like HTML, CSS and JavaScript back to the client.

So, for this to work, the ASP page would need to return the appropriate JavaScript. This JavaScript should then open a new window, and optionally close itself.

Enough to convince your client? If I were you, I'd ask him the long version of his explanation.....

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #4 (permalink)  
Old March 16th, 2004, 02:00 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks guys for the quick response and confirming my suspicions. Since I'm a freelancer and needed the work I didn't want to tell him no it can't be done. I researched and built him javascript solution and then he comes back to me with it can't be done that way. I guess I'll have to ask him for the long answer, but I'm already getting the feeling I'm wasting my time with this guy, who wants an impossible solution. Thanks again everyone.

Reply With Quote
  #5 (permalink)  
Old March 16th, 2004, 02:16 PM
Friend of Wrox
 
Join Date: Aug 2003
Location: , , .
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You could, however, generate the javascript on the fly from ASP. Also if it makes the client happier you could use VBScript for the client script instead of JavaScript. Why does the client want it done this way?
Reply With Quote
  #6 (permalink)  
Old March 16th, 2004, 02:37 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Freelancing is very difficult to make money at. This is the second client in two weeks that I've wasted a lot of time on with no pay. When I used to work for a company I'd get paid at the end of the week no matter what. Now I spend my time writing estimates for projects that usually don't get off the ground, clients who ask for impossible solutions, or people who just want to get free advice. Maybe I'm just in a slump hope it gets better soon.

Reply With Quote
  #7 (permalink)  
Old March 16th, 2004, 02:42 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok the client got back to me here's what he said:

"Yeah, javascript can't be in the initial window because their is no initial
window. It is a dynamic link being pulled into a flash piece dynamically.
If flash pulls in the link dynamically, it can't use javascript, or
understand javascript from the html page that it's pulling it from, to
launch a new window. Therefore, it needs to launch a script and pass a URL
variable to that script.

What I am asking for can definitely be done I believe. Can't you place the
appropriate javascript to open the new window correctly WIHTIN the actual
ASP?

The link they would click on would be something like:

http://www.website.com/newscript.asp...m/newpage.html

The ASP script (newscript.asp) would grab the URL from the second part of
the link, passed to it as a variable, and then use javascript to launch a
new window using that variable/URL as the location to place within it. This
can't be done? It seems like it would be a pretty basic script to me, but I
could be wrong."
Reply With Quote
  #8 (permalink)  
Old March 16th, 2004, 02:47 PM
Friend of Wrox
 
Join Date: Aug 2003
Location: , , .
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Find out what he really wants. He probably has a reason for this bizarre seeming request. I have done pages just like the client requests. I take a variable and generate the javaScript on the fly. You can even reload the page on the fly so that the page does not appear to have reloaded. The dynamic HTML doesn't even apperar in the source (thanks to DIV tags). If this is all the client wants, it is very doable. What I am not sure is why he wants it done by the server side code. If you could pass along this explanation, we could probably find a work around.
Reply With Quote
  #9 (permalink)  
Old March 16th, 2004, 02:51 PM
Friend of Wrox
 
Join Date: Aug 2003
Location: , , .
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This shouldn't be so tough. Create an ASP that reads the URL passed in, generates javascript to open the new window and then closes itself.
Reply With Quote
  #10 (permalink)  
Old March 16th, 2004, 05:03 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by myAsp
"Yeah, javascript can't be in the initial window because their is no initial window....What I am asking for can definitely be done I believe. Can't you place the appropriate javascript to open the new window correctly WIHTIN the actual ASP?...
Ask him where he expects this javascript to run. Javascript has to run in the browser, and if there isn't a browser, then well, it can't run. If Flash is going and getting this magic link, then why can't Flash just launch the new window? And with that in mind, where is the Flash movie running? Isn't it running in a browser?

It's beginning to sound like this client has no idea about the technologies they want to use (and/or are using). If that is the case, they either need to start listening to your answers, because you are the technologist, or you need to give up on them and spend time on something more fruitful.

Peter
------------------------------------------------------
Work smarter, not harder.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Close all popup windows on javascript redirect crmpicco Javascript How-To 3 September 5th, 2007 04:37 AM
Accessing Windows service from a windows app sajid08 C# 1 October 6th, 2006 10:25 AM
How to Avoid PopUp Windows when link to a file? Dragonist HTML Code Clinic 3 July 29th, 2004 08:43 PM
Windows 98 OCX control issues vs Windows XP benoyraj VB How-To 0 May 5th, 2004 08:10 AM
Question: Using Popup & Parent windows in ASP savoym Javascript How-To 1 July 25th, 2003 11:08 PM



All times are GMT -4. The time now is 12:30 AM.


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