ASP - Dynamic ASP Includes - Asked By Michel Learns on 20-Apr-01 10:20 AM

Can someone give me an alternative that allows for dynamically including asp files based on the user logged in.

An XMLHttp option - Asked By Michel Learns on 18-Jul-14 12:32 PM

I am assuming that the functions/subs in the include file are designed to "response.write" content "somewhere".
Standard functions in ASP includes that don't perform this action should be generic enough not to need a dynamically changing set of code for each user.
It sounds like in your case, you've got a multitude of different files that you want dynamically included based on a certain business rule.  In this case, the user.
There's an article I wrote that utilizes the XMLHttp object that comes with the MSXML3.0 parser.  You don't really need to know XML to utilize this object in your endeavor.  It's really quite simple.  The article link is
http://www.eggheadcafe.com/articles/20010209.asp and is also seen on the home page of this web site as Web Services Server To Server With XMLHttp.  Don't let the title scare you off.  Again, once you've read the article, you'll see it's quite simple.
The article itself pertains to communicating across multiple servers.  However, the concept can also work on the same server.  In fact, I use something similar on one of my other web sites soon to be released.
You could use XMLHttp to dynamically populate a URL variable
and execute the page.  In this case, your files based on user.  In the serverA code, you'll see where you can capture the result of serverB's code and "response.write" the output.  The output from serverB in the article uses XML.  However, it is NOT required to pass XML back to the ojbect.  It's just a stream of data that could be plain text or HTML.
Keep in mind, it is almost impossible to dynamically write ASP server side code and expect the scripting engine to process it.  The article shows how to execute a specific file and return the "response.write" output back to your calling page.
Read the article and apply my comments and let me know if this helps.

Sorry... - Asked By Robbe Morris on 20-Apr-01 10:36 AM

I replied under your account instead of mine.  Please read the previous reply I sent you.

Try This - Asked By Peter Bromberg on 20-Apr-01 11:12 AM

<
select case (Request.ServerVariables("REMOTE_USER"))
case "DOMAIN\User1"
%>
<!--#include file="User1.asp" -->
<
case "DOMAIN\User2"
%>
<!--#include file="User2.asp"-->
<
end select
' rest of your code here
%>
Try This - Asked By Peter Bromberg on 20-Apr-01 11:14 AM
<
select case (Request.ServerVariables("REMOTE_USER"))
case "DOMAIN\User1"
%>
<!--#include file="User1.asp" -->
<
case "DOMAIN\User2"
%>
<!--#include file="User2.asp"-->
<
end select
' rest of your code here
%>
Try This - Asked By Peter Bromberg on 20-Apr-01 11:14 AM
<
select case (Request.ServerVariables("REMOTE_USER"))
case "DOMAIN\User1"
%>
<!--#include file="User1.asp" -->
<
case "DOMAIN\User2"
%>
<!--#include file="User2.asp"-->
<
end select
' rest of your code here
%>
Tnx for all replies... - Asked By Michel Learns on 18-Jul-14 12:34 PM
I will give the XMLHttp option a good try...
And I'll let you know of my testing results soon.