Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I have been a grateful member of this site for several years. I love this site and refer everyone to it!..."

Geography

Where in the world do Tek-Tips members come from?
mixc (Programmer)
4 May 00 11:58
The scenario: a link is chosen; for certain users page A is to be called, for others page B. We tried an intermediate page that the link went to and which contained IF statements and RESPONSE.REDIRECT to go to the appropriate page. The problem is we cannot use Request.form to access any variables from the original page which contained the link. We are using IIS 4.0 so server.transfer is not an option.
NickBulka (Programmer)
5 May 00 8:11
I'm not sure what you're asking here.  Can you rephrase your question?

nick bulka
nick@bulka.com

mixc (Programmer)
7 May 00 15:13
PAGE A  has a link to sales

if usertype is X, i want to execute salesx.asp
if usertype is y, i want to execute salesy.asp

and i want access to the items on PAGEA.

here is what was done.

PAGE A linked to salestest.asp

salestest.asp checked usertype and based on that used response.redirect to execute salesx or salesy.asp but neither salesx.asp nor salesy.asp could reference any of the input fields on PAGE A.
palbano (Programmer)
8 May 00 2:22
Try not using Response.Redirect() at all.

Use server side includes and make salestest.asp nothing but an html shell with the decision making code to determine if you should include salesx or salesy.

This will eliminate the extra round trip and provide the included code of salesx and salesy access to the Request variables.

<%
  if ( Request("type") == 1){
%>
<!-- #include file="salesx.asp" -->
<% }else{ %>
<!-- #include file="salesy.asp" -->
<% }  // end if() %>

Good luck
Pete
macr0 (Programmer)
8 May 00 5:21
I am not sure what "usertype" is, if it is a form field. then you can do what you want without ASP, just ole JavaScript. Just Make the Form have no ACTION attrib.
like <form name='myform' method='POST' onSubmit='pagesender()'>

and then javascript like this

function pagesender()
{
  if(document.myform.whateverfield.value == "A")
       parent.location=salesx.asp;
  else  {
     if(document.myform.whateverfield.value == "B")
         parent.location=saley.asp;
  }
}
All of your form info will be intact
THIS MIGHT NOT WORK IF RESPONSE.BUFFER=TRUE

Or, if it is something predermined before the user files out the form (like on a Session variable or something) then just assign a variable when the user first gets to the page
and base which page they goto on that <form action="<%=var%>"

GL
Jlowery   
 
NickBulka (Programmer)
8 May 00 8:09
Pete,
   You can't conditionally include files.  The include directive gets preprocessed before any scripting code executes, so both files would always get included.
   IIS 5 gives you the ability to conditionally include files via the server.execute method.

nick bulka
nick@bulka.com

palbano (Programmer)
8 May 00 18:31
I do it all the time nick

I even use the same technique in JSP

-pete
palbano (Programmer)
9 May 00 17:54
Hello all,

To clarify my original post and Nick's comment. Yes, the files will be included on the server then the scripting ingine will run.

When the engine reaches your server side scripting conditional statement it will jump around a condition that evaluates to 'false'. None of the server scripting code will execute, and none of the HTML will be sent to the browser. The only perfomance issue is the in memory concatination of all the '#include'ed files. In most cases these files are cached and the effect on performance will likely be negligable.

-pete

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close