multiple applications, same files...

Discussion in 'ASP .Net' started by Sean, Apr 14, 2004.

  1. Sean

    Sean Guest

    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.
     
    Sean, Apr 14, 2004
    #1
    1. Advertising

  2. Sean

    Marina Guest

    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?

    "Sean" <> wrote in message
    news:...
    > 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.
     
    Marina, Apr 14, 2004
    #2
    1. Advertising

  3. Sean

    Sean Tynan Guest

    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.

    "Marina" <> wrote in message
    news:...
    > 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?
    >
    > "Sean" <> wrote in message
    > news:...
    > > 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.

    >
    >
     
    Sean Tynan, Apr 15, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    655
  2. Steve Mauldin
    Replies:
    1
    Views:
    407
    Steve Mauldin
    Jun 9, 2005
  3. Replies:
    4
    Views:
    957
    M.E.Farmer
    Feb 13, 2005
  4. Guest
    Replies:
    3
    Views:
    636
    Michael Nemtsev
    Jun 14, 2007
  5. David Heinemeier Hansson
    Replies:
    0
    Views:
    106
    David Heinemeier Hansson
    Feb 13, 2004
Loading...

Share This Page