how do I target a response.write

They have: 12 posts

Joined: Mar 2002

I have two browser windows open on the desktop. One is a full screen, one is a popup.

I have this line of code:

response.redirect ("findClient.asp?error=invalid")

I need it to load in a popup box(findClient.asp) instead of the fullscreen . I need something like a target attribute here, but don't know how to do it inside the response.write.

Can someone please help me, I pulling my hair out on this one.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Why not do whatever execution is done that results in the redirect command to be done in the popup itself?

Sorry my answer may be vague but I'm not sure of the details of your script. Sad

Could you please post what the script does/how it works? Smiling

ASP is server-side. It can't control how the browser handles client-side stuff like new windows and so on. That's why it'd help to know some more details, to find somewhere to throw in the JS code that'll do what you need. Wink

Peter J. Boettcher's picture

They have: 812 posts

Joined: Feb 2000

As Abhishek said, ASP is server side so it doesn't gve you control over client side stuff like windows. Sometimes when I have to do stuff like this I combine ASP into client-side javascript, for example:

<?php
Dim LoadPage

LoadPage
= "findClient.asp?error=invalid"
?>

<script language = JavaScript>
var IsPage = '

<?php
=LoadPage
?>
'

if (IsPage != "") {
window.open(IsPage)
}
</script>

PJ | Are we there yet?
pjboettcher.com

They have: 12 posts

Joined: Mar 2002

I think Abhishek Reddy is right. I need to do my form validation on the same page as the form -- then I wouldn't have the need to redirect back. I'm new at ASP. This is only my 3rd application. The way I've done my validation, run stored procedures, etc., is to submit the form to a separate page that contains all the form processing code, then redirect back to the original form page.

So... How do i put it all in the same page? Any issues I need to be concered about? I guess I thought something like var=Request.Form("fieldname") would throw an error the first time the page is loaded since the form hasn't been filled in yet. Does it just ignore it untiil the form is submitted to the same page?

I will be working on this today. May I right back if I run into trouble?

Peter J. Boettcher's picture

They have: 812 posts

Joined: Feb 2000

There really is no difference between processing your form in the current asp page or passing the results to another, they're both asp pages.

It shouldn't throw an error if it is blank (make sure you put quotes around it, otherwise you might run into null/integer problems), if you're doing any validation on those vars just verify they're not blank before you start.

Feel free to post back with anymore questions, that's why we're here.

PJ | Are we there yet?
pjboettcher.com

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.