Re: simulate virtual directory for each user

From: Scott M. (s-mar_at_BADSPAMsnet.net)
Date: 02/03/04


Date: Mon, 2 Feb 2004 22:06:18 -0500

Could you be more specific as to why each user needs their own directory?
What would "Jack" get that requires him to have a different directory than
"Sue" or "Tom"?

I ask because ASP.NET can build content on the fly. Content can be cached
based on an url parameter (i.e. the user) so that different users get
different output. And, there are many more options to ensure that different
users to a site get different results.

"Amir Eshterayeh" <aeshterayeh@hotmail.com> wrote in message
news:%23ypqklf6DHA.2656@TK2MSFTNGP11.phx.gbl...
> Dear Friends
>
> Would you please give me your professional idea about this asp.net
problem.
>
> I need different virtual directory for different customer with their names
> like these:
> www.oursite.com/Jack
> www.oursite.com/Sue
> www.oursite.com/Tom
>
> I have a asp.net project. It is a website and the content of it WebPages
> comes from database.
> To give each user a virtual directory, I have 2 options:
> 1. create a virtual directory for each user and copy the asp.net project
to
> each directory
> This is not a good solution.
> 2. Copy all the files to root directory (www.oursite.com) and when users
> type
> www.ourwebsite.com/jack or www.ourwebsite.com/sue, I can figure out the
name
> (jack or sue) and get the id of the user from database and bring the
content
> of that user's web pages from database.
>
> I put the following code into Application_BeginRequest event in
Global.asax
> file:
>
> dim sFolderName As String = Request.ApplicationPath.ToString.Trim("/")
> dim AgentID as long = GetAgentIdByFolderName(sFolderName) 'from the
> database
> WriteAgentIdToCookie(AgentID)
> Server.Transfer("AgentHomePage.aspx")
>
> After writing the agent Id to client's cookie, I redirect to agent home
page
> and at this page, I read cookie and get agent id and bring the agent info
> like its picture URL and home page info from database.
>
> The problem is: When I type : www.oursite.com/Jack
> I faced this error: page can not be found!
>
> Do you think global.asax is a good place to put this code? and also this
> code: Request.ApplicationPath ? HttpRequest or something?
> Is there a better way to get what user typed I mean the folder name that
> comes after my website.
>
> I got web hosting service from another company so I do not have any
control
> over that company's IIS. I could not found a way in its web hosting's
admin
> site to set the default page. Any page with default or index name will
come
> when I type www.oursite.com without including file name.
>
> Please help. Thank you very much in advance
>
> Best Regards
> Andy Eshtry
>
>
>
>



Relevant Pages

  • Re: simulate virtual directory for each user
    ... Attach an event handler to the HttpApplication object's BeginRequest ... >>> I need different virtual directory for different customer with their ... >>> of that user's web pages from database. ... >>> After writing the agent Id to client's cookie, ...
    (microsoft.public.dotnet.framework.aspnet)
  • simulate virtual directory for each user
    ... I need different virtual directory for different customer with their names ... and get the id of the user from database and bring the content ... After writing the agent Id to client's cookie, I redirect to agent home page ... I read cookie and get agent id and bring the agent info ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: simulate virtual directory for each user
    ... > I need different virtual directory for different customer with their names ... > of that user's web pages from database. ... > After writing the agent Id to client's cookie, ... I read cookie and get agent id and bring the agent info ...
    (microsoft.public.dotnet.general)
  • simulate virtual directory for each user
    ... I need different virtual directory for different customer with their names ... and get the id of the user from database and bring the content ... After writing the agent Id to client's cookie, I redirect to agent home page ... I read cookie and get agent id and bring the agent info ...
    (microsoft.public.dotnet.general)
  • Re: simulate virtual directory for each user
    ... > I need different virtual directory for different customer with their names> like these: ... It is a website and the content of it WebPages> comes from database. ... > After writing the agent Id to client's cookie, I redirect to agent home page> and at this page, I read cookie and get agent id and bring the agent info> like its picture URL and home page info from database. ...
    (microsoft.public.dotnet.general)