multiple applications, same files...

S

Sean

I have an ASP.NET web application that needs to be rolled out to a
number of clients.
The functionality is the same in all applications, but each client has
its own database.

At the moment, I have one application per client, but most of the
files in the applications are the same, so this is not ideal from a
maintenance point of view.

The only differences between the client applications are:

- Different XML files related to each client
- Different database connection string
- Different application settings

All these differences can be handled from the web.config file.

I want an alternative solution that will reuse the common files, while
running each client's files as a separate application, under the
control of a separate web.config file.

Having a different application for each client allows for security
management across client apps, e.g.:

If I request a file with the URL:

http://www.myapp.com/client1/logon.aspx

I will log on to the application, and then browse to...

http://www.myapp.com/client1/home.aspx

and see content related to client 1.


And if I then request a file with the URL:

http://www.myapp.com/client2/home.aspx

the application will then detect that the user does not have an active
session variable for Client2 and will redirect to Client2/logon.aspx

Recoding of the application or consolidating the databases are not
options at this stage.

Can IIS handle this type of scenario, if so how do I set up my
applications in IIS to implement this?

TIA.
 
M

Marina

This is what I would recommend. Have one directory with your application.
Have separate web.config settings for each client. Such as:

client1XMLFile
client1DBConnString
client2XMLFile
Client2DBConnString

and so on. Basically, have all the settings for all the clients in there,
and the names of the keys have the name of the client (or some sort of ID
that you assigned to the client).

Then have a separate virtual directory for each client. Have IIS redirect
to the real applications logon.aspx, and pass in the id of client. So
redirect to http://www.myapp.com/myapplication/logon.aspx?id=client1 if
someone browses to http://www.myapp.com/client1.

Now,your application can be modified to look in the query string, and maybe
set a session variable, or something else, to basically have this person
treated as client1 the entire time - and to read the appropriate settings
from web.confg.

Does this make sense?
 
S

Sean Tynan

Thanks for your feedback Marina,

I can see how that would work, however i am trying to find a solution that
leverages the web.configs and existing security in ASP.NET
I want http://www.myapp.com/client1/home.aspx and
http://www.myapp.com/client2/home.aspx
to run as different applications, although the same files are being
referenced.
I know that the URL determines which web.config file to use, so with the
correct setup of virtual directories, it should be possible?
If not, ill try your solution.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top