473,544 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asp.Net 2.0 Multiple Application Solutions

I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and wizards.
But, I have found that trying to do something "outside the norm" adds a rather large level of complexity and/or data replication.

Background
I have been commissioned to create a web-based application for a client. It has a formsaunthentic ation secured backend for admins to login and manage system data (clients, categories, geographical regions and their related associations). It also has a frontend where users can search through the clients in the system and view their information. The frontend also contains a formsauthentica tion secured area where the clients can log in and edit some of their information. The 2 entities (Admins and Clients) are separate objects in the data model (because of the completely different information pertaining to each), e.g a client would never become an admin and vice versa.

I decided to use Visual Studio 2005 and .Net 2 for this project because it would give me a head start for when the new technologies are released in November.

The solution is split up into 3 layers - Data Access layer, Businesslogic layer, and Presentation layer (websites)

Problem
I think the main problem I have experienced is multiple formsauthentica tion methods in one website. Because the two entities both have to log into different areas (therefore different login methods) I could not find a way to do this without making the admin section a separate website within the solution (it would actually be a virtual directory in IIS once it is live). Once I did this, I found another problem with having to replicate data.

I decided early on in the project to make use of the new ObjectDataSourc e and the DataSet creation wizard within VS 2005. Both websites need to make use of this dataset. When you initially create the dataset it asks for a DB connection string which either has to be hardcoded into it (bad idea) or stored in the web.config (good idea). It then stores the created DataSet in the app_code directory of the website. This presents a problem when having multiple websites with a single solution (at the moment I have the dataset within both websites app_code directories).

Now you might be asking "why not have the DataSet in the Businesslogic or Data Access layers?". One reason - You have to have the DB connection string hardcoded into it, because it cant access the web.config from either of these layers. I understand that. But I havent found a way to set the connection string programatically nor does the DataSet compile if the ConnectionStrin g property of each TableAdapter is set to "none".

Answers?
In short I would like to know if there is either:
A way to have multiple types of formsauthentica tion in a single website (and how); or
How I can have a shard DataSet somewhere out of a website so that it can be accessed by both websites.

I hope this makes sense and thank anyone that can provide me with any help.

Nov 19 '05 #1
9 2760
Membership [1], Roles, and Profiles are what you need to learn.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee. com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1]
http://msdn.microsoft.com/library/de...aght000022.asp
"Graham" <en*******@news groups.nospam> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
I have been having some fun learning and using the new Controls and methods
in .Net 2.0 which will make my life in the future easier and faster.
Specifically the new databinding practises and wizards.
But, I have found that trying to do something "outside the norm" adds a
rather large level of complexity and/or data replication.

Background
I have been commissioned to create a web-based application for a client. It
has a formsaunthentic ation secured backend for admins to login and manage
system data (clients, categories, geographical regions and their related
associations). It also has a frontend where users can search through the
clients in the system and view their information. The frontend also contains
a formsauthentica tion secured area where the clients can log in and edit
some of their information. The 2 entities (Admins and Clients) are separate
objects in the data model (because of the completely different information
pertaining to each), e.g a client would never become an admin and vice
versa.

I decided to use Visual Studio 2005 and .Net 2 for this project because it
would give me a head start for when the new technologies are released in
November.

The solution is split up into 3 layers - Data Access layer, Businesslogic
layer, and Presentation layer (websites)

Problem
I think the main problem I have experienced is multiple formsauthentica tion
methods in one website. Because the two entities both have to log into
different areas (therefore different login methods) I could not find a way
to do this without making the admin section a separate website within the
solution (it would actually be a virtual directory in IIS once it is live).
Once I did this, I found another problem with having to replicate data.

I decided early on in the project to make use of the new ObjectDataSourc e
and the DataSet creation wizard within VS 2005. Both websites need to make
use of this dataset. When you initially create the dataset it asks for a DB
connection string which either has to be hardcoded into it (bad idea) or
stored in the web.config (good idea). It then stores the created DataSet in
the app_code directory of the website. This presents a problem when having
multiple websites with a single solution (at the moment I have the dataset
within both websites app_code directories).

Now you might be asking "why not have the DataSet in the Businesslogic or
Data Access layers?". One reason - You have to have the DB connection string
hardcoded into it, because it cant access the web.config from either of
these layers. I understand that. But I havent found a way to set the
connection string programatically nor does the DataSet compile if the
ConnectionStrin g property of each TableAdapter is set to "none".

Answers?
In short I would like to know if there is either:
A way to have multiple types of formsauthentica tion in a single website
(and how); or
How I can have a shard DataSet somewhere out of a website so that it can
be accessed by both websites.

I hope this makes sense and thank anyone that can provide me with any help.
Nov 19 '05 #2
Hi Graham,

Welcome to ASPNET newsgroup.
Regarding on the question you mentioned, here are some of my understanding
and suggestion:

1. For formsauthentica tion, we can separate our web application into
multiple parts (sub folders) and set separate access protection on
different sections so that certain users/role can only access certain part
of the application. So for you scenario, we can consider define two roles ,
frontend user and backend admin, and admin can access those pages that
resides in the admin folder and front end user can access pages in other
normal application folders. We can put the front users and admins accounts
in the same database (by default), or creating two separate database/table
to store them. That's all ok within one single asp.net web application. So
I'm a bit unclear on the
=============== ==
The 2 entities (Admins and Clients) are separate objects in the data model
(because of the completely different information pertaining to each), e.g a
client would never become an admin and vice versa.
=============== ==

IMO, we don't care about whether a client is also an admin, we just apply
authorization setting for our web folder / pages so that those admin pages
can only be accessed by administrators while normal pages can only be
accessed by front client users.

2. For the TAbleAdapter, yes , when creating in asp.net 2.0 project, due to
the dynamic compile model, the code file will be put in the App_Code folder
and also can utilize the connectionStrin gs section in the web.config.
While in other Class Library project, the VS.NET ide will by default choose
to persiste the connectionStrin gs in the project assembly's settings data
and after compilation it is not possible to flexibly modify them. So
overcome this, currently we can use the following means;

Create the DataSet/TableAdapters in a separate Class library project, and
after we drag a TAble from the Server explorer and created the DataSet/
TableAdapter, we open the DataSet.Designe r.cs file , locate the the
"InitConnection " function of the
xxxTableAdapter class, it is the method that initialize the TableAdapter's
connection property, it used to be something like:

private void InitConnection( ) {
this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
this.m_connecti on.ConnectionSt ring =
DSLibrary.Prope rties.Settings. Default.Northwi ndConnectionStr ing;
}
we can modify it to

private void InitConnection( ) {
Object obj =
System.Configur ation.Configura tionSettings.Ge tConfig("connec tionStrings");
ConnectionStrin gsSection css = obj as ConnectionStrin gsSection;
string connstr =
css.ConnectionS trings["LocalNorthwind ConnStr"].ConnectionStri ng;
this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
this.m_connecti on.ConnectionSt ring = connstr;

}
Thus, it'll retrieve the connectionstrin g from the current Application's
AppConfig(web.c onfig for web app) and what we need to do in web application
is just provide the proper connectionstrin g in app.config/web.config file.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security


--------------------
| From: "Graham" <en*******@news groups.nospam>
| Subject: Asp.Net 2.0 Multiple Application Solutions
| Date: Mon, 10 Oct 2005 15:00:42 +1300
| Lines: 180
| MIME-Version: 1.0
| Content-Type: multipart/alternative;
| boundary="----=_NextPart_000_ 001A_01C5CDAB.6 2716EF0"
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 222-152-202-93.jetstream.xt ra.co.nz 222.152.202.93
| Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
5.phx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3495 91
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| I have been having some fun learning and using the new Controls and
methods in .Net 2.0 which will make my life in the future easier and
faster. Specifically the new databinding practises and wizards.
| But, I have found that trying to do something "outside the norm" adds a
rather large level of complexity and/or data replication.
| Background
| I have been commissioned to create a web-based application for a client.
It has a formsaunthentic ation secured backend for admins to login and
manage system data (clients, categories, geographical regions and their
related associations). It also has a frontend where users can search
through the clients in the system and view their information. The frontend
also contains a formsauthentica tion secured area where the clients can log
in and edit some of their information. The 2 entities (Admins and Clients)
are separate objects in the data model (because of the completely different
information pertaining to each), e.g a client would never become an admin
and vice versa.
| I decided to use Visual Studio 2005 and .Net 2 for this project because
it would give me a head start for when the new technologies are released in
November.
| The solution is split up into 3 layers - Data Access layer, Businesslogic
layer, and Presentation layer (websites)
| Problem
| I think the main problem I have experienced is multiple
formsauthentica tion methods in one website. Because the two entities both
have to log into different areas (therefore different login methods) I
could not find a way to do this without making the admin section a separate
website within the solution (it would actually be a virtual directory in
IIS once it is live). Once I did this, I found another problem with having
to replicate data.
| I decided early on in the project to make use of the new ObjectDataSourc e
and the DataSet creation wizard within VS 2005. Both websites need to make
use of this dataset. When you initially create the dataset it asks for a DB
connection string which either has to be hardcoded into it (bad idea) or
stored in the web.config (good idea). It then stores the created DataSet in
the app_code directory of the website. This presents a problem when having
multiple websites with a single solution (at the moment I have the dataset
within both websites app_code directories).
| Now you might be asking "why not have the DataSet in the Businesslogic or
Data Access layers?". One reason - You have to have the DB connection
string hardcoded into it, because it cant access the web.config from either
of these layers. I understand that. But I havent found a way to set the
connection string programatically nor does the DataSet compile if the
ConnectionStrin g property of each TableAdapter is set to "none".
| Answers?
| In short I would like to know if there is either:
| A way to have multiple types of formsauthentica tion in a single
website (and how); or
| How I can have a shard DataSet somewhere out of a website so that it
can be accessed by both websites.
| I hope this makes sense and thank anyone that can provide me with any
help.
|

Nov 19 '05 #3
Steven,
Thanks for your help. I managed to fix the DataSet problem. I put it into my
Businesslogic layer and added a method for returning the connectionstrin g.
It seems to work as expected.

For the formsauthentica tion problem:
Each entity is a separate table in the DB therefore if I was to have the
entire solution in one website I could only use one
authorisation/authentication method (one login page). This page would then
need to check the given credentials against both DB tables in order to give
them access to their available areas. This is further complicated by the
fact that administrators have certian roles and clients do not.
I hope this makes sense to you, I initially wanted the login pages separate
because I see there is a distinct difference between administrators, clients
and each of the secured areas.

Thank you for your help once again.
Graham

"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:Y9******** ******@TK2MSFTN GXA02.phx.gbl.. .
Hi Graham,

Welcome to ASPNET newsgroup.
Regarding on the question you mentioned, here are some of my understanding
and suggestion:

1. For formsauthentica tion, we can separate our web application into
multiple parts (sub folders) and set separate access protection on
different sections so that certain users/role can only access certain part
of the application. So for you scenario, we can consider define two roles
,
frontend user and backend admin, and admin can access those pages that
resides in the admin folder and front end user can access pages in other
normal application folders. We can put the front users and admins
accounts
in the same database (by default), or creating two separate database/table
to store them. That's all ok within one single asp.net web application. So
I'm a bit unclear on the
=============== ==
The 2 entities (Admins and Clients) are separate objects in the data model
(because of the completely different information pertaining to each), e.g
a
client would never become an admin and vice versa.
=============== ==

IMO, we don't care about whether a client is also an admin, we just apply
authorization setting for our web folder / pages so that those admin pages
can only be accessed by administrators while normal pages can only be
accessed by front client users.

2. For the TAbleAdapter, yes , when creating in asp.net 2.0 project, due
to
the dynamic compile model, the code file will be put in the App_Code
folder
and also can utilize the connectionStrin gs section in the web.config.
While in other Class Library project, the VS.NET ide will by default
choose
to persiste the connectionStrin gs in the project assembly's settings data
and after compilation it is not possible to flexibly modify them. So
overcome this, currently we can use the following means;

Create the DataSet/TableAdapters in a separate Class library project, and
after we drag a TAble from the Server explorer and created the DataSet/
TableAdapter, we open the DataSet.Designe r.cs file , locate the the
"InitConnection " function of the
xxxTableAdapter class, it is the method that initialize the TableAdapter's
connection property, it used to be something like:

private void InitConnection( ) {
this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
this.m_connecti on.ConnectionSt ring =
DSLibrary.Prope rties.Settings. Default.Northwi ndConnectionStr ing;
}
we can modify it to

private void InitConnection( ) {
Object obj =
System.Configur ation.Configura tionSettings.Ge tConfig("connec tionStrings");
ConnectionStrin gsSection css = obj as ConnectionStrin gsSection;
string connstr =
css.ConnectionS trings["LocalNorthwind ConnStr"].ConnectionStri ng;
this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
this.m_connecti on.ConnectionSt ring = connstr;

}
Thus, it'll retrieve the connectionstrin g from the current Application's
AppConfig(web.c onfig for web app) and what we need to do in web
application
is just provide the proper connectionstrin g in app.config/web.config file.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security


--------------------
| From: "Graham" <en*******@news groups.nospam>
| Subject: Asp.Net 2.0 Multiple Application Solutions
| Date: Mon, 10 Oct 2005 15:00:42 +1300
| Lines: 180
| MIME-Version: 1.0
| Content-Type: multipart/alternative;
| boundary="----=_NextPart_000_ 001A_01C5CDAB.6 2716EF0"
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 222-152-202-93.jetstream.xt ra.co.nz 222.152.202.93
| Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
5.phx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3495 91
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| I have been having some fun learning and using the new Controls and
methods in .Net 2.0 which will make my life in the future easier and
faster. Specifically the new databinding practises and wizards.
| But, I have found that trying to do something "outside the norm" adds a
rather large level of complexity and/or data replication.
| Background
| I have been commissioned to create a web-based application for a client.
It has a formsaunthentic ation secured backend for admins to login and
manage system data (clients, categories, geographical regions and their
related associations). It also has a frontend where users can search
through the clients in the system and view their information. The frontend
also contains a formsauthentica tion secured area where the clients can log
in and edit some of their information. The 2 entities (Admins and Clients)
are separate objects in the data model (because of the completely
different
information pertaining to each), e.g a client would never become an admin
and vice versa.
| I decided to use Visual Studio 2005 and .Net 2 for this project because
it would give me a head start for when the new technologies are released
in
November.
| The solution is split up into 3 layers - Data Access layer,
Businesslogic
layer, and Presentation layer (websites)
| Problem
| I think the main problem I have experienced is multiple
formsauthentica tion methods in one website. Because the two entities both
have to log into different areas (therefore different login methods) I
could not find a way to do this without making the admin section a
separate
website within the solution (it would actually be a virtual directory in
IIS once it is live). Once I did this, I found another problem with having
to replicate data.
| I decided early on in the project to make use of the new
ObjectDataSourc e
and the DataSet creation wizard within VS 2005. Both websites need to make
use of this dataset. When you initially create the dataset it asks for a
DB
connection string which either has to be hardcoded into it (bad idea) or
stored in the web.config (good idea). It then stores the created DataSet
in
the app_code directory of the website. This presents a problem when having
multiple websites with a single solution (at the moment I have the dataset
within both websites app_code directories).
| Now you might be asking "why not have the DataSet in the Businesslogic
or
Data Access layers?". One reason - You have to have the DB connection
string hardcoded into it, because it cant access the web.config from
either
of these layers. I understand that. But I havent found a way to set the
connection string programatically nor does the DataSet compile if the
ConnectionStrin g property of each TableAdapter is set to "none".
| Answers?
| In short I would like to know if there is either:
| A way to have multiple types of formsauthentica tion in a single
website (and how); or
| How I can have a shard DataSet somewhere out of a website so that it
can be accessed by both websites.
| I hope this makes sense and thank anyone that can provide me with any
help.
|

Nov 19 '05 #4
Thanks for your response Graham,

Yes, if the different users's account data are reside in separate table, we
need to query both tables when performing the logon(authentic ation). And
ASP.NET applicaiton's formsauthentica tion only allows single default login
page. If you're wanting to build separate login UI for different users
(client and admin), I think you can consider put a front login UI in the
default login page and let the user to choice login type, login as a normal
client user or login as an administrator, then redirect them to the actual
concrete detailed login page according to their choice and perform the
actual login/authentication code logic. How do you think of this? And for
roles, it doesn't matter whether users are from which table, we just query
the roles from database and assigned to the logon user.

Anyway, since your scenario is different from the common one, we need to
manually add some additional code rather than simply use the default
membership wizard to generate all the work.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security

--------------------
| From: "Graham" <en*******@news groups.nospam>
| References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
<Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| Date: Tue, 11 Oct 2005 09:20:10 +1300
| Lines: 191
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <ev************ **@TK2MSFTNGP10 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 222-152-206-76.jetstream.xt ra.co.nz 222.152.206.76
| Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
0.phx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3497 98
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Steven,
| Thanks for your help. I managed to fix the DataSet problem. I put it into
my
| Businesslogic layer and added a method for returning the
connectionstrin g.
| It seems to work as expected.
|
| For the formsauthentica tion problem:
| Each entity is a separate table in the DB therefore if I was to have the
| entire solution in one website I could only use one
| authorisation/authentication method (one login page). This page would
then
| need to check the given credentials against both DB tables in order to
give
| them access to their available areas. This is further complicated by the
| fact that administrators have certian roles and clients do not.
| I hope this makes sense to you, I initially wanted the login pages
separate
| because I see there is a distinct difference between administrators,
clients
| and each of the secured areas.
|
| Thank you for your help once again.
| Graham
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:Y9******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > Hi Graham,
| >
| > Welcome to ASPNET newsgroup.
| > Regarding on the question you mentioned, here are some of my
understanding
| > and suggestion:
| >
| > 1. For formsauthentica tion, we can separate our web application into
| > multiple parts (sub folders) and set separate access protection on
| > different sections so that certain users/role can only access certain
part
| > of the application. So for you scenario, we can consider define two
roles
| > ,
| > frontend user and backend admin, and admin can access those pages that
| > resides in the admin folder and front end user can access pages in other
| > normal application folders. We can put the front users and admins
| > accounts
| > in the same database (by default), or creating two separate
database/table
| > to store them. That's all ok within one single asp.net web application.
So
| > I'm a bit unclear on the
| > =============== ==
| > The 2 entities (Admins and Clients) are separate objects in the data
model
| > (because of the completely different information pertaining to each),
e.g
| > a
| > client would never become an admin and vice versa.
| > =============== ==
| >
| > IMO, we don't care about whether a client is also an admin, we just
apply
| > authorization setting for our web folder / pages so that those admin
pages
| > can only be accessed by administrators while normal pages can only be
| > accessed by front client users.
| >
| > 2. For the TAbleAdapter, yes , when creating in asp.net 2.0 project,
due
| > to
| > the dynamic compile model, the code file will be put in the App_Code
| > folder
| > and also can utilize the connectionStrin gs section in the web.config.
| > While in other Class Library project, the VS.NET ide will by default
| > choose
| > to persiste the connectionStrin gs in the project assembly's settings
data
| > and after compilation it is not possible to flexibly modify them. So
| > overcome this, currently we can use the following means;
| >
| > Create the DataSet/TableAdapters in a separate Class library project,
and
| > after we drag a TAble from the Server explorer and created the DataSet/
| > TableAdapter, we open the DataSet.Designe r.cs file , locate the the
| > "InitConnection " function of the
| > xxxTableAdapter class, it is the method that initialize the
TableAdapter's
| > connection property, it used to be something like:
| >
| > private void InitConnection( ) {
| > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| > this.m_connecti on.ConnectionSt ring =
| > DSLibrary.Prope rties.Settings. Default.Northwi ndConnectionStr ing;
| > }
| >
| >
| > we can modify it to
| >
| > private void InitConnection( ) {
| > Object obj =
| >
System.Configur ation.Configura tionSettings.Ge tConfig("connec tionStrings");
| > ConnectionStrin gsSection css = obj as ConnectionStrin gsSection;
| > string connstr =
| > css.ConnectionS trings["LocalNorthwind ConnStr"].ConnectionStri ng;
| > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| > this.m_connecti on.ConnectionSt ring = connstr;
| >
| > }
| >
| >
| > Thus, it'll retrieve the connectionstrin g from the current Application's
| > AppConfig(web.c onfig for web app) and what we need to do in web
| > application
| > is just provide the proper connectionstrin g in app.config/web.config
file.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| >
| >
| >
| >
| > --------------------
| > | From: "Graham" <en*******@news groups.nospam>
| > | Subject: Asp.Net 2.0 Multiple Application Solutions
| > | Date: Mon, 10 Oct 2005 15:00:42 +1300
| > | Lines: 180
| > | MIME-Version: 1.0
| > | Content-Type: multipart/alternative;
| > | boundary="----=_NextPart_000_ 001A_01C5CDAB.6 2716EF0"
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | Message-ID: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: 222-152-202-93.jetstream.xt ra.co.nz 222.152.202.93
| > | Path:
| >
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| > 5.phx.gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3495 91
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | I have been having some fun learning and using the new Controls and
| > methods in .Net 2.0 which will make my life in the future easier and
| > faster. Specifically the new databinding practises and wizards.
| > | But, I have found that trying to do something "outside the norm" adds
a
| > rather large level of complexity and/or data replication.
| > | Background
| > | I have been commissioned to create a web-based application for a
client.
| > It has a formsaunthentic ation secured backend for admins to login and
| > manage system data (clients, categories, geographical regions and their
| > related associations). It also has a frontend where users can search
| > through the clients in the system and view their information. The
frontend
| > also contains a formsauthentica tion secured area where the clients can
log
| > in and edit some of their information. The 2 entities (Admins and
Clients)
| > are separate objects in the data model (because of the completely
| > different
| > information pertaining to each), e.g a client would never become an
admin
| > and vice versa.
| > | I decided to use Visual Studio 2005 and .Net 2 for this project
because
| > it would give me a head start for when the new technologies are
released
| > in
| > November.
| > | The solution is split up into 3 layers - Data Access layer,
| > Businesslogic
| > layer, and Presentation layer (websites)
| > | Problem
| > | I think the main problem I have experienced is multiple
| > formsauthentica tion methods in one website. Because the two entities
both
| > have to log into different areas (therefore different login methods) I
| > could not find a way to do this without making the admin section a
| > separate
| > website within the solution (it would actually be a virtual directory in
| > IIS once it is live). Once I did this, I found another problem with
having
| > to replicate data.
| > | I decided early on in the project to make use of the new
| > ObjectDataSourc e
| > and the DataSet creation wizard within VS 2005. Both websites need to
make
| > use of this dataset. When you initially create the dataset it asks for
a
| > DB
| > connection string which either has to be hardcoded into it (bad idea) or
| > stored in the web.config (good idea). It then stores the created
DataSet
| > in
| > the app_code directory of the website. This presents a problem when
having
| > multiple websites with a single solution (at the moment I have the
dataset
| > within both websites app_code directories).
| > | Now you might be asking "why not have the DataSet in the
Businesslogic
| > or
| > Data Access layers?". One reason - You have to have the DB connection
| > string hardcoded into it, because it cant access the web.config from
| > either
| > of these layers. I understand that. But I havent found a way to set the
| > connection string programatically nor does the DataSet compile if the
| > ConnectionStrin g property of each TableAdapter is set to "none".
| > | Answers?
| > | In short I would like to know if there is either:
| > | A way to have multiple types of formsauthentica tion in a single
| > website (and how); or
| > | How I can have a shard DataSet somewhere out of a website so that
it
| > can be accessed by both websites.
| > | I hope this makes sense and thank anyone that can provide me with any
| > help.
| > |
| >
|
|
|

Nov 19 '05 #5
Steven,
Regarding letting users choose their login type:
I do not think that it is a viable option letting an end user select what
login type they want to try, In most of my experience end users can not be
trusted.

From your explanation it sounds like you can have multiple separate
formsauthentica tion methods per website. Is that correct? If so an
explanation on how to implement would solve all my problems.
Otherwise I think I will continue with splitting up the frontend and teh
admin backend into two separate websites.
Thanks for your ongoing support.

Graham

"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:Qa******** ******@TK2MSFTN GXA02.phx.gbl.. .
Thanks for your response Graham,

Yes, if the different users's account data are reside in separate table,
we
need to query both tables when performing the logon(authentic ation). And
ASP.NET applicaiton's formsauthentica tion only allows single default login
page. If you're wanting to build separate login UI for different users
(client and admin), I think you can consider put a front login UI in the
default login page and let the user to choice login type, login as a
normal
client user or login as an administrator, then redirect them to the actual
concrete detailed login page according to their choice and perform the
actual login/authentication code logic. How do you think of this? And
for
roles, it doesn't matter whether users are from which table, we just query
the roles from database and assigned to the logon user.

Anyway, since your scenario is different from the common one, we need to
manually add some additional code rather than simply use the default
membership wizard to generate all the work.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security

--------------------
| From: "Graham" <en*******@news groups.nospam>
| References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
<Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| Date: Tue, 11 Oct 2005 09:20:10 +1300
| Lines: 191
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <ev************ **@TK2MSFTNGP10 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 222-152-206-76.jetstream.xt ra.co.nz 222.152.206.76
| Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
0.phx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3497 98
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Steven,
| Thanks for your help. I managed to fix the DataSet problem. I put it
into
my
| Businesslogic layer and added a method for returning the
connectionstrin g.
| It seems to work as expected.
|
| For the formsauthentica tion problem:
| Each entity is a separate table in the DB therefore if I was to have the
| entire solution in one website I could only use one
| authorisation/authentication method (one login page). This page would
then
| need to check the given credentials against both DB tables in order to
give
| them access to their available areas. This is further complicated by the
| fact that administrators have certian roles and clients do not.
| I hope this makes sense to you, I initially wanted the login pages
separate
| because I see there is a distinct difference between administrators,
clients
| and each of the secured areas.
|
| Thank you for your help once again.
| Graham
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:Y9******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > Hi Graham,
| >
| > Welcome to ASPNET newsgroup.
| > Regarding on the question you mentioned, here are some of my
understanding
| > and suggestion:
| >
| > 1. For formsauthentica tion, we can separate our web application into
| > multiple parts (sub folders) and set separate access protection on
| > different sections so that certain users/role can only access certain
part
| > of the application. So for you scenario, we can consider define two
roles
| > ,
| > frontend user and backend admin, and admin can access those pages
that
| > resides in the admin folder and front end user can access pages in
other
| > normal application folders. We can put the front users and admins
| > accounts
| > in the same database (by default), or creating two separate
database/table
| > to store them. That's all ok within one single asp.net web
application.
So
| > I'm a bit unclear on the
| > =============== ==
| > The 2 entities (Admins and Clients) are separate objects in the data
model
| > (because of the completely different information pertaining to each),
e.g
| > a
| > client would never become an admin and vice versa.
| > =============== ==
| >
| > IMO, we don't care about whether a client is also an admin, we just
apply
| > authorization setting for our web folder / pages so that those admin
pages
| > can only be accessed by administrators while normal pages can only be
| > accessed by front client users.
| >
| > 2. For the TAbleAdapter, yes , when creating in asp.net 2.0 project,
due
| > to
| > the dynamic compile model, the code file will be put in the App_Code
| > folder
| > and also can utilize the connectionStrin gs section in the web.config.
| > While in other Class Library project, the VS.NET ide will by default
| > choose
| > to persiste the connectionStrin gs in the project assembly's settings
data
| > and after compilation it is not possible to flexibly modify them. So
| > overcome this, currently we can use the following means;
| >
| > Create the DataSet/TableAdapters in a separate Class library project,
and
| > after we drag a TAble from the Server explorer and created the
DataSet/
| > TableAdapter, we open the DataSet.Designe r.cs file , locate the the
| > "InitConnection " function of the
| > xxxTableAdapter class, it is the method that initialize the
TableAdapter's
| > connection property, it used to be something like:
| >
| > private void InitConnection( ) {
| > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| > this.m_connecti on.ConnectionSt ring =
| > DSLibrary.Prope rties.Settings. Default.Northwi ndConnectionStr ing;
| > }
| >
| >
| > we can modify it to
| >
| > private void InitConnection( ) {
| > Object obj =
| >
System.Configur ation.Configura tionSettings.Ge tConfig("connec tionStrings");
| > ConnectionStrin gsSection css = obj as ConnectionStrin gsSection;
| > string connstr =
| > css.ConnectionS trings["LocalNorthwind ConnStr"].ConnectionStri ng;
| > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| > this.m_connecti on.ConnectionSt ring = connstr;
| >
| > }
| >
| >
| > Thus, it'll retrieve the connectionstrin g from the current
Application's
| > AppConfig(web.c onfig for web app) and what we need to do in web
| > application
| > is just provide the proper connectionstrin g in app.config/web.config
file.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| >
| >
| >
| >
| > --------------------
| > | From: "Graham" <en*******@news groups.nospam>
| > | Subject: Asp.Net 2.0 Multiple Application Solutions
| > | Date: Mon, 10 Oct 2005 15:00:42 +1300
| > | Lines: 180
| > | MIME-Version: 1.0
| > | Content-Type: multipart/alternative;
| > | boundary="----=_NextPart_000_ 001A_01C5CDAB.6 2716EF0"
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | Message-ID: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: 222-152-202-93.jetstream.xt ra.co.nz
222.152.202.93
| > | Path:
| >
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| > 5.phx.gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3495 91
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | I have been having some fun learning and using the new Controls and
| > methods in .Net 2.0 which will make my life in the future easier and
| > faster. Specifically the new databinding practises and wizards.
| > | But, I have found that trying to do something "outside the norm"
adds
a
| > rather large level of complexity and/or data replication.
| > | Background
| > | I have been commissioned to create a web-based application for a
client.
| > It has a formsaunthentic ation secured backend for admins to login and
| > manage system data (clients, categories, geographical regions and
their
| > related associations). It also has a frontend where users can search
| > through the clients in the system and view their information. The
frontend
| > also contains a formsauthentica tion secured area where the clients can
log
| > in and edit some of their information. The 2 entities (Admins and
Clients)
| > are separate objects in the data model (because of the completely
| > different
| > information pertaining to each), e.g a client would never become an
admin
| > and vice versa.
| > | I decided to use Visual Studio 2005 and .Net 2 for this project
because
| > it would give me a head start for when the new technologies are
released
| > in
| > November.
| > | The solution is split up into 3 layers - Data Access layer,
| > Businesslogic
| > layer, and Presentation layer (websites)
| > | Problem
| > | I think the main problem I have experienced is multiple
| > formsauthentica tion methods in one website. Because the two entities
both
| > have to log into different areas (therefore different login methods) I
| > could not find a way to do this without making the admin section a
| > separate
| > website within the solution (it would actually be a virtual directory
in
| > IIS once it is live). Once I did this, I found another problem with
having
| > to replicate data.
| > | I decided early on in the project to make use of the new
| > ObjectDataSourc e
| > and the DataSet creation wizard within VS 2005. Both websites need to
make
| > use of this dataset. When you initially create the dataset it asks for
a
| > DB
| > connection string which either has to be hardcoded into it (bad idea)
or
| > stored in the web.config (good idea). It then stores the created
DataSet
| > in
| > the app_code directory of the website. This presents a problem when
having
| > multiple websites with a single solution (at the moment I have the
dataset
| > within both websites app_code directories).
| > | Now you might be asking "why not have the DataSet in the
Businesslogic
| > or
| > Data Access layers?". One reason - You have to have the DB connection
| > string hardcoded into it, because it cant access the web.config from
| > either
| > of these layers. I understand that. But I havent found a way to set
the
| > connection string programatically nor does the DataSet compile if the
| > ConnectionStrin g property of each TableAdapter is set to "none".
| > | Answers?
| > | In short I would like to know if there is either:
| > | A way to have multiple types of formsauthentica tion in a single
| > website (and how); or
| > | How I can have a shard DataSet somewhere out of a website so
that
it
| > can be accessed by both websites.
| > | I hope this makes sense and thank anyone that can provide me with
any
| > help.
| > |
| >
|
|
|

Nov 19 '05 #6
Hi Graham,

Thanks for your reply. If provide multiple login UI on the single LOGIN
page is not acceptable, I'm afraid it would be hard to achieve multiple
login in the single application. Though we can manually do the
FormsAuthentica tion so as to validate the user from both the two database,
we're still limited to one login page per application. So if the admin
pages and normal users page haven't much cross related application data or
states need to share, you can consider separate them into two application
that'll make development much easier(using the buildin membership service
and VS.NET ide design-time support can save much time).

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Graham" <en*******@news groups.nospam>
| References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
<Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
<ev************ **@TK2MSFTNGP10 .phx.gbl>
<Qa************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| Date: Wed, 12 Oct 2005 08:30:38 +1300
| Lines: 319
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <u6************ **@TK2MSFTNGP14 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 222-152-206-76.jetstream.xt ra.co.nz 222.152.206.76
| Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
4.phx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3501 04
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Steven,
| Regarding letting users choose their login type:
| I do not think that it is a viable option letting an end user select what
| login type they want to try, In most of my experience end users can not
be
| trusted.
|
| From your explanation it sounds like you can have multiple separate
| formsauthentica tion methods per website. Is that correct? If so an
| explanation on how to implement would solve all my problems.
| Otherwise I think I will continue with splitting up the frontend and teh
| admin backend into two separate websites.
| Thanks for your ongoing support.
|
| Graham
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:Qa******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > Thanks for your response Graham,
| >
| > Yes, if the different users's account data are reside in separate
table,
| > we
| > need to query both tables when performing the logon(authentic ation).
And
| > ASP.NET applicaiton's formsauthentica tion only allows single default
login
| > page. If you're wanting to build separate login UI for different users
| > (client and admin), I think you can consider put a front login UI in the
| > default login page and let the user to choice login type, login as a
| > normal
| > client user or login as an administrator, then redirect them to the
actual
| > concrete detailed login page according to their choice and perform the
| > actual login/authentication code logic. How do you think of this? And
| > for
| > roles, it doesn't matter whether users are from which table, we just
query
| > the roles from database and assigned to the logon user.
| >
| > Anyway, since your scenario is different from the common one, we need to
| > manually add some additional code rather than simply use the default
| > membership wizard to generate all the work.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| >
| >
| >
| >
| >
| > --------------------
| > | From: "Graham" <en*******@news groups.nospam>
| > | References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| > <Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
| > | Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| > | Date: Tue, 11 Oct 2005 09:20:10 +1300
| > | Lines: 191
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Original
| > | Message-ID: <ev************ **@TK2MSFTNGP10 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: 222-152-206-76.jetstream.xt ra.co.nz 222.152.206.76
| > | Path:
| >
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| > 0.phx.gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3497 98
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | Steven,
| > | Thanks for your help. I managed to fix the DataSet problem. I put it
| > into
| > my
| > | Businesslogic layer and added a method for returning the
| > connectionstrin g.
| > | It seems to work as expected.
| > |
| > | For the formsauthentica tion problem:
| > | Each entity is a separate table in the DB therefore if I was to have
the
| > | entire solution in one website I could only use one
| > | authorisation/authentication method (one login page). This page would
| > then
| > | need to check the given credentials against both DB tables in order to
| > give
| > | them access to their available areas. This is further complicated by
the
| > | fact that administrators have certian roles and clients do not.
| > | I hope this makes sense to you, I initially wanted the login pages
| > separate
| > | because I see there is a distinct difference between administrators,
| > clients
| > | and each of the secured areas.
| > |
| > | Thank you for your help once again.
| > | Graham
| > |
| > | "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| > | news:Y9******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > | > Hi Graham,
| > | >
| > | > Welcome to ASPNET newsgroup.
| > | > Regarding on the question you mentioned, here are some of my
| > understanding
| > | > and suggestion:
| > | >
| > | > 1. For formsauthentica tion, we can separate our web application into
| > | > multiple parts (sub folders) and set separate access protection on
| > | > different sections so that certain users/role can only access
certain
| > part
| > | > of the application. So for you scenario, we can consider define two
| > roles
| > | > ,
| > | > frontend user and backend admin, and admin can access those pages
| > that
| > | > resides in the admin folder and front end user can access pages in
| > other
| > | > normal application folders. We can put the front users and admins
| > | > accounts
| > | > in the same database (by default), or creating two separate
| > database/table
| > | > to store them. That's all ok within one single asp.net web
| > application.
| > So
| > | > I'm a bit unclear on the
| > | > =============== ==
| > | > The 2 entities (Admins and Clients) are separate objects in the data
| > model
| > | > (because of the completely different information pertaining to
each),
| > e.g
| > | > a
| > | > client would never become an admin and vice versa.
| > | > =============== ==
| > | >
| > | > IMO, we don't care about whether a client is also an admin, we just
| > apply
| > | > authorization setting for our web folder / pages so that those admin
| > pages
| > | > can only be accessed by administrators while normal pages can only
be
| > | > accessed by front client users.
| > | >
| > | > 2. For the TAbleAdapter, yes , when creating in asp.net 2.0 project,
| > due
| > | > to
| > | > the dynamic compile model, the code file will be put in the App_Code
| > | > folder
| > | > and also can utilize the connectionStrin gs section in the
web.config.
| > | > While in other Class Library project, the VS.NET ide will by default
| > | > choose
| > | > to persiste the connectionStrin gs in the project assembly's settings
| > data
| > | > and after compilation it is not possible to flexibly modify them. So
| > | > overcome this, currently we can use the following means;
| > | >
| > | > Create the DataSet/TableAdapters in a separate Class library
project,
| > and
| > | > after we drag a TAble from the Server explorer and created the
| > DataSet/
| > | > TableAdapter, we open the DataSet.Designe r.cs file , locate the the
| > | > "InitConnection " function of the
| > | > xxxTableAdapter class, it is the method that initialize the
| > TableAdapter's
| > | > connection property, it used to be something like:
| > | >
| > | > private void InitConnection( ) {
| > | > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| > | > this.m_connecti on.ConnectionSt ring =
| > | > DSLibrary.Prope rties.Settings. Default.Northwi ndConnectionStr ing;
| > | > }
| > | >
| > | >
| > | > we can modify it to
| > | >
| > | > private void InitConnection( ) {
| > | > Object obj =
| > | >
| >
System.Configur ation.Configura tionSettings.Ge tConfig("connec tionStrings");
| > | > ConnectionStrin gsSection css = obj as ConnectionStrin gsSection;
| > | > string connstr =
| > | > css.ConnectionS trings["LocalNorthwind ConnStr"].ConnectionStri ng;
| > | > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| > | > this.m_connecti on.ConnectionSt ring = connstr;
| > | >
| > | > }
| > | >
| > | >
| > | > Thus, it'll retrieve the connectionstrin g from the current
| > Application's
| > | > AppConfig(web.c onfig for web app) and what we need to do in web
| > | > application
| > | > is just provide the proper connectionstrin g in app.config/web.config
| > file.
| > | >
| > | > Thanks,
| > | >
| > | > Steven Cheng
| > | > Microsoft Online Support
| > | >
| > | > Get Secure! www.microsoft.com/security
| > | >
| > | >
| > | >
| > | >
| > | > --------------------
| > | > | From: "Graham" <en*******@news groups.nospam>
| > | > | Subject: Asp.Net 2.0 Multiple Application Solutions
| > | > | Date: Mon, 10 Oct 2005 15:00:42 +1300
| > | > | Lines: 180
| > | > | MIME-Version: 1.0
| > | > | Content-Type: multipart/alternative;
| > | > | boundary="----=_NextPart_000_ 001A_01C5CDAB.6 2716EF0"
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | > | Message-ID: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| > | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | > | NNTP-Posting-Host: 222-152-202-93.jetstream.xt ra.co.nz
| > 222.152.202.93
| > | > | Path:
| > | >
| >
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| > | > 5.phx.gbl
| > | > | Xref: TK2MSFTNGXA02.p hx.gbl
| > | > microsoft.publi c.dotnet.framew ork.aspnet:3495 91
| > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | > |
| > | > | I have been having some fun learning and using the new Controls
and
| > | > methods in .Net 2.0 which will make my life in the future easier and
| > | > faster. Specifically the new databinding practises and wizards.
| > | > | But, I have found that trying to do something "outside the norm"
| > adds
| > a
| > | > rather large level of complexity and/or data replication.
| > | > | Background
| > | > | I have been commissioned to create a web-based application for a
| > client.
| > | > It has a formsaunthentic ation secured backend for admins to login
and
| > | > manage system data (clients, categories, geographical regions and
| > their
| > | > related associations). It also has a frontend where users can search
| > | > through the clients in the system and view their information. The
| > frontend
| > | > also contains a formsauthentica tion secured area where the clients
can
| > log
| > | > in and edit some of their information. The 2 entities (Admins and
| > Clients)
| > | > are separate objects in the data model (because of the completely
| > | > different
| > | > information pertaining to each), e.g a client would never become an
| > admin
| > | > and vice versa.
| > | > | I decided to use Visual Studio 2005 and .Net 2 for this project
| > because
| > | > it would give me a head start for when the new technologies are
| > released
| > | > in
| > | > November.
| > | > | The solution is split up into 3 layers - Data Access layer,
| > | > Businesslogic
| > | > layer, and Presentation layer (websites)
| > | > | Problem
| > | > | I think the main problem I have experienced is multiple
| > | > formsauthentica tion methods in one website. Because the two entities
| > both
| > | > have to log into different areas (therefore different login
methods) I
| > | > could not find a way to do this without making the admin section a
| > | > separate
| > | > website within the solution (it would actually be a virtual
directory
| > in
| > | > IIS once it is live). Once I did this, I found another problem with
| > having
| > | > to replicate data.
| > | > | I decided early on in the project to make use of the new
| > | > ObjectDataSourc e
| > | > and the DataSet creation wizard within VS 2005. Both websites need
to
| > make
| > | > use of this dataset. When you initially create the dataset it asks
for
| > a
| > | > DB
| > | > connection string which either has to be hardcoded into it (bad
idea)
| > or
| > | > stored in the web.config (good idea). It then stores the created
| > DataSet
| > | > in
| > | > the app_code directory of the website. This presents a problem when
| > having
| > | > multiple websites with a single solution (at the moment I have the
| > dataset
| > | > within both websites app_code directories).
| > | > | Now you might be asking "why not have the DataSet in the
| > Businesslogic
| > | > or
| > | > Data Access layers?". One reason - You have to have the DB
connection
| > | > string hardcoded into it, because it cant access the web.config from
| > | > either
| > | > of these layers. I understand that. But I havent found a way to set
| > the
| > | > connection string programatically nor does the DataSet compile if
the
| > | > ConnectionStrin g property of each TableAdapter is set to "none".
| > | > | Answers?
| > | > | In short I would like to know if there is either:
| > | > | A way to have multiple types of formsauthentica tion in a
single
| > | > website (and how); or
| > | > | How I can have a shard DataSet somewhere out of a website so
| > that
| > it
| > | > can be accessed by both websites.
| > | > | I hope this makes sense and thank anyone that can provide me with
| > any
| > | > help.
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|

Nov 19 '05 #7
Hi Graham,

How are you going on this issue? If there're anything else we can help,
please feel free to post here.
Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 181327491
| References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
<Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
<ev************ **@TK2MSFTNGP10 .phx.gbl>
<Qa************ **@TK2MSFTNGXA0 2.phx.gbl>
<u6************ **@TK2MSFTNGP14 .phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online. microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Wed, 12 Oct 2005 09:35:24 GMT
| Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| Message-ID: <jN************ *@TK2MSFTNGXA02 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| Lines: 373
| Path: TK2MSFTNGXA02.p hx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3502 09
| NNTP-Posting-Host: tomcatimport2.p hx.gbl 10.201.218.182
|
| Hi Graham,
|
| Thanks for your reply. If provide multiple login UI on the single LOGIN
| page is not acceptable, I'm afraid it would be hard to achieve multiple
| login in the single application. Though we can manually do the
| FormsAuthentica tion so as to validate the user from both the two
database,
| we're still limited to one login page per application. So if the admin
| pages and normal users page haven't much cross related application data
or
| states need to share, you can consider separate them into two application
| that'll make development much easier(using the buildin membership service
| and VS.NET ide design-time support can save much time).
|
| Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
| --------------------
| | From: "Graham" <en*******@news groups.nospam>
| | References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| <Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
| <ev************ **@TK2MSFTNGP10 .phx.gbl>
| <Qa************ **@TK2MSFTNGXA0 2.phx.gbl>
| | Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| | Date: Wed, 12 Oct 2005 08:30:38 +1300
| | Lines: 319
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | X-RFC2646: Format=Flowed; Original
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | Message-ID: <u6************ **@TK2MSFTNGP14 .phx.gbl>
| | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| | NNTP-Posting-Host: 222-152-206-76.jetstream.xt ra.co.nz 222.152.206.76
| | Path:
|
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| 4.phx.gbl
| | Xref: TK2MSFTNGXA02.p hx.gbl
| microsoft.publi c.dotnet.framew ork.aspnet:3501 04
| | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| |
| | Steven,
| | Regarding letting users choose their login type:
| | I do not think that it is a viable option letting an end user select
what
| | login type they want to try, In most of my experience end users can not
| be
| | trusted.
| |
| | From your explanation it sounds like you can have multiple separate
| | formsauthentica tion methods per website. Is that correct? If so an
| | explanation on how to implement would solve all my problems.
| | Otherwise I think I will continue with splitting up the frontend and
teh
| | admin backend into two separate websites.
| | Thanks for your ongoing support.
| |
| | Graham
| |
| | "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| | news:Qa******** ******@TK2MSFTN GXA02.phx.gbl.. .
| | > Thanks for your response Graham,
| | >
| | > Yes, if the different users's account data are reside in separate
| table,
| | > we
| | > need to query both tables when performing the logon(authentic ation).
| And
| | > ASP.NET applicaiton's formsauthentica tion only allows single default
| login
| | > page. If you're wanting to build separate login UI for different users
| | > (client and admin), I think you can consider put a front login UI in
the
| | > default login page and let the user to choice login type, login as a
| | > normal
| | > client user or login as an administrator, then redirect them to the
| actual
| | > concrete detailed login page according to their choice and perform the
| | > actual login/authentication code logic. How do you think of this?
And
| | > for
| | > roles, it doesn't matter whether users are from which table, we just
| query
| | > the roles from database and assigned to the logon user.
| | >
| | > Anyway, since your scenario is different from the common one, we need
to
| | > manually add some additional code rather than simply use the default
| | > membership wizard to generate all the work.
| | >
| | > Thanks,
| | >
| | > Steven Cheng
| | > Microsoft Online Support
| | >
| | > Get Secure! www.microsoft.com/security
| | >
| | >
| | >
| | >
| | >
| | > --------------------
| | > | From: "Graham" <en*******@news groups.nospam>
| | > | References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| | > <Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
| | > | Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| | > | Date: Tue, 11 Oct 2005 09:20:10 +1300
| | > | Lines: 191
| | > | X-Priority: 3
| | > | X-MSMail-Priority: Normal
| | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | > | X-RFC2646: Format=Flowed; Original
| | > | Message-ID: <ev************ **@TK2MSFTNGP10 .phx.gbl>
| | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| | > | NNTP-Posting-Host: 222-152-206-76.jetstream.xt ra.co.nz
222.152.206.76
| | > | Path:
| | >
|
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| | > 0.phx.gbl
| | > | Xref: TK2MSFTNGXA02.p hx.gbl
| | > microsoft.publi c.dotnet.framew ork.aspnet:3497 98
| | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| | > |
| | > | Steven,
| | > | Thanks for your help. I managed to fix the DataSet problem. I put
it
| | > into
| | > my
| | > | Businesslogic layer and added a method for returning the
| | > connectionstrin g.
| | > | It seems to work as expected.
| | > |
| | > | For the formsauthentica tion problem:
| | > | Each entity is a separate table in the DB therefore if I was to
have
| the
| | > | entire solution in one website I could only use one
| | > | authorisation/authentication method (one login page). This page
would
| | > then
| | > | need to check the given credentials against both DB tables in order
to
| | > give
| | > | them access to their available areas. This is further complicated
by
| the
| | > | fact that administrators have certian roles and clients do not.
| | > | I hope this makes sense to you, I initially wanted the login pages
| | > separate
| | > | because I see there is a distinct difference between administrators,
| | > clients
| | > | and each of the secured areas.
| | > |
| | > | Thank you for your help once again.
| | > | Graham
| | > |
| | > | "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| | > | news:Y9******** ******@TK2MSFTN GXA02.phx.gbl.. .
| | > | > Hi Graham,
| | > | >
| | > | > Welcome to ASPNET newsgroup.
| | > | > Regarding on the question you mentioned, here are some of my
| | > understanding
| | > | > and suggestion:
| | > | >
| | > | > 1. For formsauthentica tion, we can separate our web application
into
| | > | > multiple parts (sub folders) and set separate access protection on
| | > | > different sections so that certain users/role can only access
| certain
| | > part
| | > | > of the application. So for you scenario, we can consider define
two
| | > roles
| | > | > ,
| | > | > frontend user and backend admin, and admin can access those
pages
| | > that
| | > | > resides in the admin folder and front end user can access pages
in
| | > other
| | > | > normal application folders. We can put the front users and admins
| | > | > accounts
| | > | > in the same database (by default), or creating two separate
| | > database/table
| | > | > to store them. That's all ok within one single asp.net web
| | > application.
| | > So
| | > | > I'm a bit unclear on the
| | > | > =============== ==
| | > | > The 2 entities (Admins and Clients) are separate objects in the
data
| | > model
| | > | > (because of the completely different information pertaining to
| each),
| | > e.g
| | > | > a
| | > | > client would never become an admin and vice versa.
| | > | > =============== ==
| | > | >
| | > | > IMO, we don't care about whether a client is also an admin, we
just
| | > apply
| | > | > authorization setting for our web folder / pages so that those
admin
| | > pages
| | > | > can only be accessed by administrators while normal pages can
only
| be
| | > | > accessed by front client users.
| | > | >
| | > | > 2. For the TAbleAdapter, yes , when creating in asp.net 2.0
project,
| | > due
| | > | > to
| | > | > the dynamic compile model, the code file will be put in the
App_Code
| | > | > folder
| | > | > and also can utilize the connectionStrin gs section in the
| web.config.
| | > | > While in other Class Library project, the VS.NET ide will by
default
| | > | > choose
| | > | > to persiste the connectionStrin gs in the project assembly's
settings
| | > data
| | > | > and after compilation it is not possible to flexibly modify them.
So
| | > | > overcome this, currently we can use the following means;
| | > | >
| | > | > Create the DataSet/TableAdapters in a separate Class library
| project,
| | > and
| | > | > after we drag a TAble from the Server explorer and created the
| | > DataSet/
| | > | > TableAdapter, we open the DataSet.Designe r.cs file , locate the
the
| | > | > "InitConnection " function of the
| | > | > xxxTableAdapter class, it is the method that initialize the
| | > TableAdapter's
| | > | > connection property, it used to be something like:
| | > | >
| | > | > private void InitConnection( ) {
| | > | > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| | > | > this.m_connecti on.ConnectionSt ring =
| | > | > DSLibrary.Prope rties.Settings. Default.Northwi ndConnectionStr ing;
| | > | > }
| | > | >
| | > | >
| | > | > we can modify it to
| | > | >
| | > | > private void InitConnection( ) {
| | > | > Object obj =
| | > | >
| | >
| System.Configur ation.Configura tionSettings.Ge tConfig("connec tionStrings");
| | > | > ConnectionStrin gsSection css = obj as ConnectionStrin gsSection;
| | > | > string connstr =
| | > | > css.ConnectionS trings["LocalNorthwind ConnStr"].ConnectionStri ng;
| | > | > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| | > | > this.m_connecti on.ConnectionSt ring = connstr;
| | > | >
| | > | > }
| | > | >
| | > | >
| | > | > Thus, it'll retrieve the connectionstrin g from the current
| | > Application's
| | > | > AppConfig(web.c onfig for web app) and what we need to do in web
| | > | > application
| | > | > is just provide the proper connectionstrin g in
app.config/web.config
| | > file.
| | > | >
| | > | > Thanks,
| | > | >
| | > | > Steven Cheng
| | > | > Microsoft Online Support
| | > | >
| | > | > Get Secure! www.microsoft.com/security
| | > | >
| | > | >
| | > | >
| | > | >
| | > | > --------------------
| | > | > | From: "Graham" <en*******@news groups.nospam>
| | > | > | Subject: Asp.Net 2.0 Multiple Application Solutions
| | > | > | Date: Mon, 10 Oct 2005 15:00:42 +1300
| | > | > | Lines: 180
| | > | > | MIME-Version: 1.0
| | > | > | Content-Type: multipart/alternative;
| | > | > | boundary="----=_NextPart_000_ 001A_01C5CDAB.6 2716EF0"
| | > | > | X-Priority: 3
| | > | > | X-MSMail-Priority: Normal
| | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | > | > | Message-ID: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| | > | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| | > | > | NNTP-Posting-Host: 222-152-202-93.jetstream.xt ra.co.nz
| | > 222.152.202.93
| | > | > | Path:
| | > | >
| | >
|
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| | > | > 5.phx.gbl
| | > | > | Xref: TK2MSFTNGXA02.p hx.gbl
| | > | > microsoft.publi c.dotnet.framew ork.aspnet:3495 91
| | > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| | > | > |
| | > | > | I have been having some fun learning and using the new Controls
| and
| | > | > methods in .Net 2.0 which will make my life in the future easier
and
| | > | > faster. Specifically the new databinding practises and wizards.
| | > | > | But, I have found that trying to do something "outside the
norm"
| | > adds
| | > a
| | > | > rather large level of complexity and/or data replication.
| | > | > | Background
| | > | > | I have been commissioned to create a web-based application for a
| | > client.
| | > | > It has a formsaunthentic ation secured backend for admins to login
| and
| | > | > manage system data (clients, categories, geographical regions and
| | > their
| | > | > related associations). It also has a frontend where users can
search
| | > | > through the clients in the system and view their information. The
| | > frontend
| | > | > also contains a formsauthentica tion secured area where the
clients
| can
| | > log
| | > | > in and edit some of their information. The 2 entities (Admins and
| | > Clients)
| | > | > are separate objects in the data model (because of the completely
| | > | > different
| | > | > information pertaining to each), e.g a client would never become
an
| | > admin
| | > | > and vice versa.
| | > | > | I decided to use Visual Studio 2005 and .Net 2 for this project
| | > because
| | > | > it would give me a head start for when the new technologies are
| | > released
| | > | > in
| | > | > November.
| | > | > | The solution is split up into 3 layers - Data Access layer,
| | > | > Businesslogic
| | > | > layer, and Presentation layer (websites)
| | > | > | Problem
| | > | > | I think the main problem I have experienced is multiple
| | > | > formsauthentica tion methods in one website. Because the two
entities
| | > both
| | > | > have to log into different areas (therefore different login
| methods) I
| | > | > could not find a way to do this without making the admin section a
| | > | > separate
| | > | > website within the solution (it would actually be a virtual
| directory
| | > in
| | > | > IIS once it is live). Once I did this, I found another problem
with
| | > having
| | > | > to replicate data.
| | > | > | I decided early on in the project to make use of the new
| | > | > ObjectDataSourc e
| | > | > and the DataSet creation wizard within VS 2005. Both websites
need
| to
| | > make
| | > | > use of this dataset. When you initially create the dataset it
asks
| for
| | > a
| | > | > DB
| | > | > connection string which either has to be hardcoded into it (bad
| idea)
| | > or
| | > | > stored in the web.config (good idea). It then stores the created
| | > DataSet
| | > | > in
| | > | > the app_code directory of the website. This presents a problem
when
| | > having
| | > | > multiple websites with a single solution (at the moment I have the
| | > dataset
| | > | > within both websites app_code directories).
| | > | > | Now you might be asking "why not have the DataSet in the
| | > Businesslogic
| | > | > or
| | > | > Data Access layers?". One reason - You have to have the DB
| connection
| | > | > string hardcoded into it, because it cant access the web.config
from
| | > | > either
| | > | > of these layers. I understand that. But I havent found a way to
set
| | > the
| | > | > connection string programatically nor does the DataSet compile if
| the
| | > | > ConnectionStrin g property of each TableAdapter is set to "none".
| | > | > | Answers?
| | > | > | In short I would like to know if there is either:
| | > | > | A way to have multiple types of formsauthentica tion in a
| single
| | > | > website (and how); or
| | > | > | How I can have a shard DataSet somewhere out of a website
so
| | > that
| | > it
| | > | > can be accessed by both websites.
| | > | > | I hope this makes sense and thank anyone that can provide me
with
| | > any
| | > | > help.
| | > | > |
| | > | >
| | > |
| | > |
| | > |
| | >
| |
| |
| |
|
|

Nov 19 '05 #8
Hey,
Sorry, completely forgot to say thanks. All those issues have been fixed.
Thanks for all your help.

Graham

"Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
news:xL******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hi Graham,

How are you going on this issue? If there're anything else we can help,
please feel free to post here.
Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 181327491
| References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
<Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
<ev************ **@TK2MSFTNGP10 .phx.gbl>
<Qa************ **@TK2MSFTNGXA0 2.phx.gbl>
<u6************ **@TK2MSFTNGP14 .phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online. microsoft.com (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Wed, 12 Oct 2005 09:35:24 GMT
| Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| Message-ID: <jN************ *@TK2MSFTNGXA02 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| Lines: 373
| Path: TK2MSFTNGXA02.p hx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3502 09
| NNTP-Posting-Host: tomcatimport2.p hx.gbl 10.201.218.182
|
| Hi Graham,
|
| Thanks for your reply. If provide multiple login UI on the single LOGIN
| page is not acceptable, I'm afraid it would be hard to achieve multiple
| login in the single application. Though we can manually do the
| FormsAuthentica tion so as to validate the user from both the two
database,
| we're still limited to one login page per application. So if the
admin
| pages and normal users page haven't much cross related application data
or
| states need to share, you can consider separate them into two
application
| that'll make development much easier(using the buildin membership
service
| and VS.NET ide design-time support can save much time).
|
| Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
| --------------------
| | From: "Graham" <en*******@news groups.nospam>
| | References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| <Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
| <ev************ **@TK2MSFTNGP10 .phx.gbl>
| <Qa************ **@TK2MSFTNGXA0 2.phx.gbl>
| | Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| | Date: Wed, 12 Oct 2005 08:30:38 +1300
| | Lines: 319
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | X-RFC2646: Format=Flowed; Original
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | Message-ID: <u6************ **@TK2MSFTNGP14 .phx.gbl>
| | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| | NNTP-Posting-Host: 222-152-206-76.jetstream.xt ra.co.nz 222.152.206.76
| | Path:
|
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| 4.phx.gbl
| | Xref: TK2MSFTNGXA02.p hx.gbl
| microsoft.publi c.dotnet.framew ork.aspnet:3501 04
| | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| |
| | Steven,
| | Regarding letting users choose their login type:
| | I do not think that it is a viable option letting an end user select
what
| | login type they want to try, In most of my experience end users can
not
| be
| | trusted.
| |
| | From your explanation it sounds like you can have multiple separate
| | formsauthentica tion methods per website. Is that correct? If so an
| | explanation on how to implement would solve all my problems.
| | Otherwise I think I will continue with splitting up the frontend and
teh
| | admin backend into two separate websites.
| | Thanks for your ongoing support.
| |
| | Graham
| |
| | "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| | news:Qa******** ******@TK2MSFTN GXA02.phx.gbl.. .
| | > Thanks for your response Graham,
| | >
| | > Yes, if the different users's account data are reside in separate
| table,
| | > we
| | > need to query both tables when performing the logon(authentic ation).
| And
| | > ASP.NET applicaiton's formsauthentica tion only allows single default
| login
| | > page. If you're wanting to build separate login UI for different
users
| | > (client and admin), I think you can consider put a front login UI in
the
| | > default login page and let the user to choice login type, login as a
| | > normal
| | > client user or login as an administrator, then redirect them to the
| actual
| | > concrete detailed login page according to their choice and perform
the
| | > actual login/authentication code logic. How do you think of this?
And
| | > for
| | > roles, it doesn't matter whether users are from which table, we just
| query
| | > the roles from database and assigned to the logon user.
| | >
| | > Anyway, since your scenario is different from the common one, we
need
to
| | > manually add some additional code rather than simply use the default
| | > membership wizard to generate all the work.
| | >
| | > Thanks,
| | >
| | > Steven Cheng
| | > Microsoft Online Support
| | >
| | > Get Secure! www.microsoft.com/security
| | >
| | >
| | >
| | >
| | >
| | > --------------------
| | > | From: "Graham" <en*******@news groups.nospam>
| | > | References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| | > <Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
| | > | Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| | > | Date: Tue, 11 Oct 2005 09:20:10 +1300
| | > | Lines: 191
| | > | X-Priority: 3
| | > | X-MSMail-Priority: Normal
| | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | > | X-RFC2646: Format=Flowed; Original
| | > | Message-ID: <ev************ **@TK2MSFTNGP10 .phx.gbl>
| | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| | > | NNTP-Posting-Host: 222-152-206-76.jetstream.xt ra.co.nz
222.152.206.76
| | > | Path:
| | >
|
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| | > 0.phx.gbl
| | > | Xref: TK2MSFTNGXA02.p hx.gbl
| | > microsoft.publi c.dotnet.framew ork.aspnet:3497 98
| | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| | > |
| | > | Steven,
| | > | Thanks for your help. I managed to fix the DataSet problem. I put
it
| | > into
| | > my
| | > | Businesslogic layer and added a method for returning the
| | > connectionstrin g.
| | > | It seems to work as expected.
| | > |
| | > | For the formsauthentica tion problem:
| | > | Each entity is a separate table in the DB therefore if I was to
have
| the
| | > | entire solution in one website I could only use one
| | > | authorisation/authentication method (one login page). This page
would
| | > then
| | > | need to check the given credentials against both DB tables in
order
to
| | > give
| | > | them access to their available areas. This is further complicated
by
| the
| | > | fact that administrators have certian roles and clients do not.
| | > | I hope this makes sense to you, I initially wanted the login pages
| | > separate
| | > | because I see there is a distinct difference between
administrators,
| | > clients
| | > | and each of the secured areas.
| | > |
| | > | Thank you for your help once again.
| | > | Graham
| | > |
| | > | "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in
message
| | > | news:Y9******** ******@TK2MSFTN GXA02.phx.gbl.. .
| | > | > Hi Graham,
| | > | >
| | > | > Welcome to ASPNET newsgroup.
| | > | > Regarding on the question you mentioned, here are some of my
| | > understanding
| | > | > and suggestion:
| | > | >
| | > | > 1. For formsauthentica tion, we can separate our web application
into
| | > | > multiple parts (sub folders) and set separate access protection
on
| | > | > different sections so that certain users/role can only access
| certain
| | > part
| | > | > of the application. So for you scenario, we can consider define
two
| | > roles
| | > | > ,
| | > | > frontend user and backend admin, and admin can access those
pages
| | > that
| | > | > resides in the admin folder and front end user can access pages
in
| | > other
| | > | > normal application folders. We can put the front users and
admins
| | > | > accounts
| | > | > in the same database (by default), or creating two separate
| | > database/table
| | > | > to store them. That's all ok within one single asp.net web
| | > application.
| | > So
| | > | > I'm a bit unclear on the
| | > | > =============== ==
| | > | > The 2 entities (Admins and Clients) are separate objects in the
data
| | > model
| | > | > (because of the completely different information pertaining to
| each),
| | > e.g
| | > | > a
| | > | > client would never become an admin and vice versa.
| | > | > =============== ==
| | > | >
| | > | > IMO, we don't care about whether a client is also an admin, we
just
| | > apply
| | > | > authorization setting for our web folder / pages so that those
admin
| | > pages
| | > | > can only be accessed by administrators while normal pages can
only
| be
| | > | > accessed by front client users.
| | > | >
| | > | > 2. For the TAbleAdapter, yes , when creating in asp.net 2.0
project,
| | > due
| | > | > to
| | > | > the dynamic compile model, the code file will be put in the
App_Code
| | > | > folder
| | > | > and also can utilize the connectionStrin gs section in the
| web.config.
| | > | > While in other Class Library project, the VS.NET ide will by
default
| | > | > choose
| | > | > to persiste the connectionStrin gs in the project assembly's
settings
| | > data
| | > | > and after compilation it is not possible to flexibly modify
them.
So
| | > | > overcome this, currently we can use the following means;
| | > | >
| | > | > Create the DataSet/TableAdapters in a separate Class library
| project,
| | > and
| | > | > after we drag a TAble from the Server explorer and created the
| | > DataSet/
| | > | > TableAdapter, we open the DataSet.Designe r.cs file , locate the
the
| | > | > "InitConnection " function of the
| | > | > xxxTableAdapter class, it is the method that initialize the
| | > TableAdapter's
| | > | > connection property, it used to be something like:
| | > | >
| | > | > private void InitConnection( ) {
| | > | > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| | > | > this.m_connecti on.ConnectionSt ring =
| | > | > DSLibrary.Prope rties.Settings. Default.Northwi ndConnectionStr ing;
| | > | > }
| | > | >
| | > | >
| | > | > we can modify it to
| | > | >
| | > | > private void InitConnection( ) {
| | > | > Object obj =
| | > | >
| | >
|
System.Configur ation.Configura tionSettings.Ge tConfig("connec tionStrings");
| | > | > ConnectionStrin gsSection css = obj as ConnectionStrin gsSection;
| | > | > string connstr =
| | > | > css.ConnectionS trings["LocalNorthwind ConnStr"].ConnectionStri ng;
| | > | > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| | > | > this.m_connecti on.ConnectionSt ring = connstr;
| | > | >
| | > | > }
| | > | >
| | > | >
| | > | > Thus, it'll retrieve the connectionstrin g from the current
| | > Application's
| | > | > AppConfig(web.c onfig for web app) and what we need to do in web
| | > | > application
| | > | > is just provide the proper connectionstrin g in
app.config/web.config
| | > file.
| | > | >
| | > | > Thanks,
| | > | >
| | > | > Steven Cheng
| | > | > Microsoft Online Support
| | > | >
| | > | > Get Secure! www.microsoft.com/security
| | > | >
| | > | >
| | > | >
| | > | >
| | > | > --------------------
| | > | > | From: "Graham" <en*******@news groups.nospam>
| | > | > | Subject: Asp.Net 2.0 Multiple Application Solutions
| | > | > | Date: Mon, 10 Oct 2005 15:00:42 +1300
| | > | > | Lines: 180
| | > | > | MIME-Version: 1.0
| | > | > | Content-Type: multipart/alternative;
| | > | > | boundary="----=_NextPart_000_ 001A_01C5CDAB.6 2716EF0"
| | > | > | X-Priority: 3
| | > | > | X-MSMail-Priority: Normal
| | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| | > | > | Message-ID: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| | > | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| | > | > | NNTP-Posting-Host: 222-152-202-93.jetstream.xt ra.co.nz
| | > 222.152.202.93
| | > | > | Path:
| | > | >
| | >
|
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| | > | > 5.phx.gbl
| | > | > | Xref: TK2MSFTNGXA02.p hx.gbl
| | > | > microsoft.publi c.dotnet.framew ork.aspnet:3495 91
| | > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| | > | > |
| | > | > | I have been having some fun learning and using the new
Controls
| and
| | > | > methods in .Net 2.0 which will make my life in the future easier
and
| | > | > faster. Specifically the new databinding practises and wizards.
| | > | > | But, I have found that trying to do something "outside the
norm"
| | > adds
| | > a
| | > | > rather large level of complexity and/or data replication.
| | > | > | Background
| | > | > | I have been commissioned to create a web-based application for
a
| | > client.
| | > | > It has a formsaunthentic ation secured backend for admins to
login
| and
| | > | > manage system data (clients, categories, geographical regions
and
| | > their
| | > | > related associations). It also has a frontend where users can
search
| | > | > through the clients in the system and view their information.
The
| | > frontend
| | > | > also contains a formsauthentica tion secured area where the
clients
| can
| | > log
| | > | > in and edit some of their information. The 2 entities (Admins
and
| | > Clients)
| | > | > are separate objects in the data model (because of the
completely
| | > | > different
| | > | > information pertaining to each), e.g a client would never become
an
| | > admin
| | > | > and vice versa.
| | > | > | I decided to use Visual Studio 2005 and .Net 2 for this
project
| | > because
| | > | > it would give me a head start for when the new technologies are
| | > released
| | > | > in
| | > | > November.
| | > | > | The solution is split up into 3 layers - Data Access layer,
| | > | > Businesslogic
| | > | > layer, and Presentation layer (websites)
| | > | > | Problem
| | > | > | I think the main problem I have experienced is multiple
| | > | > formsauthentica tion methods in one website. Because the two
entities
| | > both
| | > | > have to log into different areas (therefore different login
| methods) I
| | > | > could not find a way to do this without making the admin section
a
| | > | > separate
| | > | > website within the solution (it would actually be a virtual
| directory
| | > in
| | > | > IIS once it is live). Once I did this, I found another problem
with
| | > having
| | > | > to replicate data.
| | > | > | I decided early on in the project to make use of the new
| | > | > ObjectDataSourc e
| | > | > and the DataSet creation wizard within VS 2005. Both websites
need
| to
| | > make
| | > | > use of this dataset. When you initially create the dataset it
asks
| for
| | > a
| | > | > DB
| | > | > connection string which either has to be hardcoded into it (bad
| idea)
| | > or
| | > | > stored in the web.config (good idea). It then stores the created
| | > DataSet
| | > | > in
| | > | > the app_code directory of the website. This presents a problem
when
| | > having
| | > | > multiple websites with a single solution (at the moment I have
the
| | > dataset
| | > | > within both websites app_code directories).
| | > | > | Now you might be asking "why not have the DataSet in the
| | > Businesslogic
| | > | > or
| | > | > Data Access layers?". One reason - You have to have the DB
| connection
| | > | > string hardcoded into it, because it cant access the web.config
from
| | > | > either
| | > | > of these layers. I understand that. But I havent found a way to
set
| | > the
| | > | > connection string programatically nor does the DataSet compile
if
| the
| | > | > ConnectionStrin g property of each TableAdapter is set to "none".
| | > | > | Answers?
| | > | > | In short I would like to know if there is either:
| | > | > | A way to have multiple types of formsauthentica tion in a
| single
| | > | > website (and how); or
| | > | > | How I can have a shard DataSet somewhere out of a website
so
| | > that
| | > it
| | > | > can be accessed by both websites.
| | > | > | I hope this makes sense and thank anyone that can provide me
with
| | > any
| | > | > help.
| | > | > |
| | > | >
| | > |
| | > |
| | > |
| | >
| |
| |
| |
|
|

Nov 19 '05 #9
Thanks for your followup Graham,

Really glad that you've already overcome that problem and continue your
work. If there're any further questions in the furture, please feel free to
post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Graham" <en*******@news groups.nospam>
| References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
<Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
<ev************ **@TK2MSFTNGP10 .phx.gbl>
<Qa************ **@TK2MSFTNGXA0 2.phx.gbl>
<u6************ **@TK2MSFTNGP14 .phx.gbl>
<jN************ *@TK2MSFTNGXA02 .phx.gbl>
<xL************ **@TK2MSFTNGXA0 1.phx.gbl>
| Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| Date: Thu, 3 Nov 2005 14:39:25 +1300
| Lines: 510
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <#W************ **@TK2MSFTNGP12 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: 222-153-144-207.jetstream.x tra.co.nz 222.153.144.207
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP12.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1356 95
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Hey,
| Sorry, completely forgot to say thanks. All those issues have been fixed.
| Thanks for all your help.
|
| Graham
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:xL******** ******@TK2MSFTN GXA01.phx.gbl.. .
| > Hi Graham,
| >
| > How are you going on this issue? If there're anything else we can help,
| > please feel free to post here.
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | X-Tomcat-ID: 181327491
| > | References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| > <Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
| > <ev************ **@TK2MSFTNGP10 .phx.gbl>
| > <Qa************ **@TK2MSFTNGXA0 2.phx.gbl>
| > <u6************ **@TK2MSFTNGP14 .phx.gbl>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain
| > | Content-Transfer-Encoding: 7bit
| > | From: st*****@online. microsoft.com (Steven Cheng[MSFT])
| > | Organization: Microsoft
| > | Date: Wed, 12 Oct 2005 09:35:24 GMT
| > | Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | Message-ID: <jN************ *@TK2MSFTNGXA02 .phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | Lines: 373
| > | Path: TK2MSFTNGXA02.p hx.gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3502 09
| > | NNTP-Posting-Host: tomcatimport2.p hx.gbl 10.201.218.182
| > |
| > | Hi Graham,
| > |
| > | Thanks for your reply. If provide multiple login UI on the single
LOGIN
| > | page is not acceptable, I'm afraid it would be hard to achieve
multiple
| > | login in the single application. Though we can manually do the
| > | FormsAuthentica tion so as to validate the user from both the two
| > database,
| > | we're still limited to one login page per application. So if the
| > admin
| > | pages and normal users page haven't much cross related application
data
| > or
| > | states need to share, you can consider separate them into two
| > application
| > | that'll make development much easier(using the buildin membership
| > service
| > | and VS.NET ide design-time support can save much time).
| > |
| > | Thanks,
| > |
| > | Steven Cheng
| > | Microsoft Online Support
| > |
| > | Get Secure! www.microsoft.com/security
| > | (This posting is provided "AS IS", with no warranties, and confers no
| > | rights.)
| > |
| > | --------------------
| > | | From: "Graham" <en*******@news groups.nospam>
| > | | References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| > | <Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
| > | <ev************ **@TK2MSFTNGP10 .phx.gbl>
| > | <Qa************ **@TK2MSFTNGXA0 2.phx.gbl>
| > | | Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| > | | Date: Wed, 12 Oct 2005 08:30:38 +1300
| > | | Lines: 319
| > | | X-Priority: 3
| > | | X-MSMail-Priority: Normal
| > | | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | | X-RFC2646: Format=Flowed; Original
| > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | | Message-ID: <u6************ **@TK2MSFTNGP14 .phx.gbl>
| > | | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | | NNTP-Posting-Host: 222-152-206-76.jetstream.xt ra.co.nz
222.152.206.76
| > | | Path:
| > |
| >
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| > | 4.phx.gbl
| > | | Xref: TK2MSFTNGXA02.p hx.gbl
| > | microsoft.publi c.dotnet.framew ork.aspnet:3501 04
| > | | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | |
| > | | Steven,
| > | | Regarding letting users choose their login type:
| > | | I do not think that it is a viable option letting an end user select
| > what
| > | | login type they want to try, In most of my experience end users can
| > not
| > | be
| > | | trusted.
| > | |
| > | | From your explanation it sounds like you can have multiple separate
| > | | formsauthentica tion methods per website. Is that correct? If so an
| > | | explanation on how to implement would solve all my problems.
| > | | Otherwise I think I will continue with splitting up the frontend and
| > teh
| > | | admin backend into two separate websites.
| > | | Thanks for your ongoing support.
| > | |
| > | | Graham
| > | |
| > | | "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| > | | news:Qa******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > | | > Thanks for your response Graham,
| > | | >
| > | | > Yes, if the different users's account data are reside in separate
| > | table,
| > | | > we
| > | | > need to query both tables when performing the
logon(authentic ation).
| > | And
| > | | > ASP.NET applicaiton's formsauthentica tion only allows single
default
| > | login
| > | | > page. If you're wanting to build separate login UI for different
| > users
| > | | > (client and admin), I think you can consider put a front login UI
in
| > the
| > | | > default login page and let the user to choice login type, login
as a
| > | | > normal
| > | | > client user or login as an administrator, then redirect them to
the
| > | actual
| > | | > concrete detailed login page according to their choice and
perform
| > the
| > | | > actual login/authentication code logic. How do you think of this?
| > And
| > | | > for
| > | | > roles, it doesn't matter whether users are from which table, we
just
| > | query
| > | | > the roles from database and assigned to the logon user.
| > | | >
| > | | > Anyway, since your scenario is different from the common one, we
| > need
| > to
| > | | > manually add some additional code rather than simply use the
default
| > | | > membership wizard to generate all the work.
| > | | >
| > | | > Thanks,
| > | | >
| > | | > Steven Cheng
| > | | > Microsoft Online Support
| > | | >
| > | | > Get Secure! www.microsoft.com/security
| > | | >
| > | | >
| > | | >
| > | | >
| > | | >
| > | | > --------------------
| > | | > | From: "Graham" <en*******@news groups.nospam>
| > | | > | References: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| > | | > <Y9************ **@TK2MSFTNGXA0 2.phx.gbl>
| > | | > | Subject: Re: Asp.Net 2.0 Multiple Application Solutions
| > | | > | Date: Tue, 11 Oct 2005 09:20:10 +1300
| > | | > | Lines: 191
| > | | > | X-Priority: 3
| > | | > | X-MSMail-Priority: Normal
| > | | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | | > | X-RFC2646: Format=Flowed; Original
| > | | > | Message-ID: <ev************ **@TK2MSFTNGP10 .phx.gbl>
| > | | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | | > | NNTP-Posting-Host: 222-152-206-76.jetstream.xt ra.co.nz
| > 222.152.206.76
| > | | > | Path:
| > | | >
| > |
| >
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| > | | > 0.phx.gbl
| > | | > | Xref: TK2MSFTNGXA02.p hx.gbl
| > | | > microsoft.publi c.dotnet.framew ork.aspnet:3497 98
| > | | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | | > |
| > | | > | Steven,
| > | | > | Thanks for your help. I managed to fix the DataSet problem. I
put
| > it
| > | | > into
| > | | > my
| > | | > | Businesslogic layer and added a method for returning the
| > | | > connectionstrin g.
| > | | > | It seems to work as expected.
| > | | > |
| > | | > | For the formsauthentica tion problem:
| > | | > | Each entity is a separate table in the DB therefore if I was to
| > have
| > | the
| > | | > | entire solution in one website I could only use one
| > | | > | authorisation/authentication method (one login page). This page
| > would
| > | | > then
| > | | > | need to check the given credentials against both DB tables in
| > order
| > to
| > | | > give
| > | | > | them access to their available areas. This is further
complicated
| > by
| > | the
| > | | > | fact that administrators have certian roles and clients do not.
| > | | > | I hope this makes sense to you, I initially wanted the login
pages
| > | | > separate
| > | | > | because I see there is a distinct difference between
| > administrators,
| > | | > clients
| > | | > | and each of the secured areas.
| > | | > |
| > | | > | Thank you for your help once again.
| > | | > | Graham
| > | | > |
| > | | > | "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in
| > message
| > | | > | news:Y9******** ******@TK2MSFTN GXA02.phx.gbl.. .
| > | | > | > Hi Graham,
| > | | > | >
| > | | > | > Welcome to ASPNET newsgroup.
| > | | > | > Regarding on the question you mentioned, here are some of my
| > | | > understanding
| > | | > | > and suggestion:
| > | | > | >
| > | | > | > 1. For formsauthentica tion, we can separate our web
application
| > into
| > | | > | > multiple parts (sub folders) and set separate access
protection
| > on
| > | | > | > different sections so that certain users/role can only access
| > | certain
| > | | > part
| > | | > | > of the application. So for you scenario, we can consider
define
| > two
| > | | > roles
| > | | > | > ,
| > | | > | > frontend user and backend admin, and admin can access those
| > pages
| > | | > that
| > | | > | > resides in the admin folder and front end user can access
pages
| > in
| > | | > other
| > | | > | > normal application folders. We can put the front users and
| > admins
| > | | > | > accounts
| > | | > | > in the same database (by default), or creating two separate
| > | | > database/table
| > | | > | > to store them. That's all ok within one single asp.net web
| > | | > application.
| > | | > So
| > | | > | > I'm a bit unclear on the
| > | | > | > =============== ==
| > | | > | > The 2 entities (Admins and Clients) are separate objects in
the
| > data
| > | | > model
| > | | > | > (because of the completely different information pertaining to
| > | each),
| > | | > e.g
| > | | > | > a
| > | | > | > client would never become an admin and vice versa.
| > | | > | > =============== ==
| > | | > | >
| > | | > | > IMO, we don't care about whether a client is also an admin, we
| > just
| > | | > apply
| > | | > | > authorization setting for our web folder / pages so that those
| > admin
| > | | > pages
| > | | > | > can only be accessed by administrators while normal pages can
| > only
| > | be
| > | | > | > accessed by front client users.
| > | | > | >
| > | | > | > 2. For the TAbleAdapter, yes , when creating in asp.net 2.0
| > project,
| > | | > due
| > | | > | > to
| > | | > | > the dynamic compile model, the code file will be put in the
| > App_Code
| > | | > | > folder
| > | | > | > and also can utilize the connectionStrin gs section in the
| > | web.config.
| > | | > | > While in other Class Library project, the VS.NET ide will by
| > default
| > | | > | > choose
| > | | > | > to persiste the connectionStrin gs in the project assembly's
| > settings
| > | | > data
| > | | > | > and after compilation it is not possible to flexibly modify
| > them.
| > So
| > | | > | > overcome this, currently we can use the following means;
| > | | > | >
| > | | > | > Create the DataSet/TableAdapters in a separate Class library
| > | project,
| > | | > and
| > | | > | > after we drag a TAble from the Server explorer and created the
| > | | > DataSet/
| > | | > | > TableAdapter, we open the DataSet.Designe r.cs file , locate
the
| > the
| > | | > | > "InitConnection " function of the
| > | | > | > xxxTableAdapter class, it is the method that initialize the
| > | | > TableAdapter's
| > | | > | > connection property, it used to be something like:
| > | | > | >
| > | | > | > private void InitConnection( ) {
| > | | > | > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| > | | > | > this.m_connecti on.ConnectionSt ring =
| > | | > | >
DSLibrary.Prope rties.Settings. Default.Northwi ndConnectionStr ing;
| > | | > | > }
| > | | > | >
| > | | > | >
| > | | > | > we can modify it to
| > | | > | >
| > | | > | > private void InitConnection( ) {
| > | | > | > Object obj =
| > | | > | >
| > | | >
| > |
| >
System.Configur ation.Configura tionSettings.Ge tConfig("connec tionStrings");
| > | | > | > ConnectionStrin gsSection css = obj as
ConnectionStrin gsSection;
| > | | > | > string connstr =
| > | | > | >
css.ConnectionS trings["LocalNorthwind ConnStr"].ConnectionStri ng;
| > | | > | > this.m_connecti on = new System.Data.Sql Client.SqlConne ction();
| > | | > | > this.m_connecti on.ConnectionSt ring = connstr;
| > | | > | >
| > | | > | > }
| > | | > | >
| > | | > | >
| > | | > | > Thus, it'll retrieve the connectionstrin g from the current
| > | | > Application's
| > | | > | > AppConfig(web.c onfig for web app) and what we need to do in
web
| > | | > | > application
| > | | > | > is just provide the proper connectionstrin g in
| > app.config/web.config
| > | | > file.
| > | | > | >
| > | | > | > Thanks,
| > | | > | >
| > | | > | > Steven Cheng
| > | | > | > Microsoft Online Support
| > | | > | >
| > | | > | > Get Secure! www.microsoft.com/security
| > | | > | >
| > | | > | >
| > | | > | >
| > | | > | >
| > | | > | > --------------------
| > | | > | > | From: "Graham" <en*******@news groups.nospam>
| > | | > | > | Subject: Asp.Net 2.0 Multiple Application Solutions
| > | | > | > | Date: Mon, 10 Oct 2005 15:00:42 +1300
| > | | > | > | Lines: 180
| > | | > | > | MIME-Version: 1.0
| > | | > | > | Content-Type: multipart/alternative;
| > | | > | > | boundary="----=_NextPart_000_ 001A_01C5CDAB.6 2716EF0"
| > | | > | > | X-Priority: 3
| > | | > | > | X-MSMail-Priority: Normal
| > | | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | | > | > | Message-ID: <#L************ **@TK2MSFTNGP15 .phx.gbl>
| > | | > | > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | | > | > | NNTP-Posting-Host: 222-152-202-93.jetstream.xt ra.co.nz
| > | | > 222.152.202.93
| > | | > | > | Path:
| > | | > | >
| > | | >
| > |
| >
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl!T K2MSFTNGP08.phx .gbl!TK2MSFTNGP 1
| > | | > | > 5.phx.gbl
| > | | > | > | Xref: TK2MSFTNGXA02.p hx.gbl
| > | | > | > microsoft.publi c.dotnet.framew ork.aspnet:3495 91
| > | | > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > | | > | > |
| > | | > | > | I have been having some fun learning and using the new
| > Controls
| > | and
| > | | > | > methods in .Net 2.0 which will make my life in the future
easier
| > and
| > | | > | > faster. Specifically the new databinding practises and
wizards.
| > | | > | > | But, I have found that trying to do something "outside the
| > norm"
| > | | > adds
| > | | > a
| > | | > | > rather large level of complexity and/or data replication.
| > | | > | > | Background
| > | | > | > | I have been commissioned to create a web-based application
for
| > a
| > | | > client.
| > | | > | > It has a formsaunthentic ation secured backend for admins to
| > login
| > | and
| > | | > | > manage system data (clients, categories, geographical regions
| > and
| > | | > their
| > | | > | > related associations). It also has a frontend where users can
| > search
| > | | > | > through the clients in the system and view their information.
| > The
| > | | > frontend
| > | | > | > also contains a formsauthentica tion secured area where the
| > clients
| > | can
| > | | > log
| > | | > | > in and edit some of their information. The 2 entities (Admins
| > and
| > | | > Clients)
| > | | > | > are separate objects in the data model (because of the
| > completely
| > | | > | > different
| > | | > | > information pertaining to each), e.g a client would never
become
| > an
| > | | > admin
| > | | > | > and vice versa.
| > | | > | > | I decided to use Visual Studio 2005 and .Net 2 for this
| > project
| > | | > because
| > | | > | > it would give me a head start for when the new technologies
are
| > | | > released
| > | | > | > in
| > | | > | > November.
| > | | > | > | The solution is split up into 3 layers - Data Access layer,
| > | | > | > Businesslogic
| > | | > | > layer, and Presentation layer (websites)
| > | | > | > | Problem
| > | | > | > | I think the main problem I have experienced is multiple
| > | | > | > formsauthentica tion methods in one website. Because the two
| > entities
| > | | > both
| > | | > | > have to log into different areas (therefore different login
| > | methods) I
| > | | > | > could not find a way to do this without making the admin
section
| > a
| > | | > | > separate
| > | | > | > website within the solution (it would actually be a virtual
| > | directory
| > | | > in
| > | | > | > IIS once it is live). Once I did this, I found another problem
| > with
| > | | > having
| > | | > | > to replicate data.
| > | | > | > | I decided early on in the project to make use of the new
| > | | > | > ObjectDataSourc e
| > | | > | > and the DataSet creation wizard within VS 2005. Both websites
| > need
| > | to
| > | | > make
| > | | > | > use of this dataset. When you initially create the dataset it
| > asks
| > | for
| > | | > a
| > | | > | > DB
| > | | > | > connection string which either has to be hardcoded into it
(bad
| > | idea)
| > | | > or
| > | | > | > stored in the web.config (good idea). It then stores the
created
| > | | > DataSet
| > | | > | > in
| > | | > | > the app_code directory of the website. This presents a problem
| > when
| > | | > having
| > | | > | > multiple websites with a single solution (at the moment I
have
| > the
| > | | > dataset
| > | | > | > within both websites app_code directories).
| > | | > | > | Now you might be asking "why not have the DataSet in the
| > | | > Businesslogic
| > | | > | > or
| > | | > | > Data Access layers?". One reason - You have to have the DB
| > | connection
| > | | > | > string hardcoded into it, because it cant access the
web.config
| > from
| > | | > | > either
| > | | > | > of these layers. I understand that. But I havent found a way
to
| > set
| > | | > the
| > | | > | > connection string programatically nor does the DataSet
compile
| > if
| > | the
| > | | > | > ConnectionStrin g property of each TableAdapter is set to
"none".
| > | | > | > | Answers?
| > | | > | > | In short I would like to know if there is either:
| > | | > | > | A way to have multiple types of formsauthentica tion in a
| > | single
| > | | > | > website (and how); or
| > | | > | > | How I can have a shard DataSet somewhere out of a
website
| > so
| > | | > that
| > | | > it
| > | | > | > can be accessed by both websites.
| > | | > | > | I hope this makes sense and thank anyone that can provide me
| > with
| > | | > any
| > | | > | > help.
| > | | > | > |
| > | | > | >
| > | | > |
| > | | > |
| > | | > |
| > | | >
| > | |
| > | |
| > | |
| > |
| > |
| >
|
|
|

Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2402
by: Eric S. Johansson | last post by:
I have an application where I need a very simple database, effectively a very large dictionary. The very large dictionary must be accessed from multiple processes simultaneously. I need to be able to lock records within the very large dictionary when records are written to. Estimated number of records will be in the ballpark of 50,000 to...
6
2517
by: Don Leverton | last post by:
Hi All, I've got a situation where I am developing an Access 97 app for a client, and am in the "beta testing" stage. I have split the app up, using the DB splitter, into front-end /back-end for the usual reason ... so I can mess with form/report revisions. Since splitting, I've had issues with re-linking the tables ... as it relates to...
2
2833
by: Johann Blake | last post by:
I can hardly believe I'm the first one to report this, but having gone through the newsgroup, it appears that way. I would like to open a solution in the VS.NET IDE that consists of multiple DLLs and a test application (an .EXE). The .EXE is my startup application. All the DLLs are shared components. This means that they contain a key and...
32
14767
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
1
1506
by: dinosaur8000 | last post by:
Hi, I have two ASP.NET solutions in my website, located in two directories: c:\projects\mainsite -- the main web site solution c:\projects\newmodule -- a module I'm adding on solution My web site's root is pointing to "c:\projects\mainsite", and I've created a virtual directory called "newmodule" pointing to "c:\projects\newmodule".
11
4323
by: Olie | last post by:
This post is realy to get some opinions on the best way of getting fast comunication between multiple applications. I have scowered the web for imformation on this subject and have just found conflicting views and far from ideal solutions. My application has to send small amounts of data about 50bytes to multiple client applications. The...
1
1153
by: DR | last post by:
Is it possible to update multiple solutions on the server at once? The group I am working with, created a web application that will be recreated as a copy for each new customer with new DB. Thinking in the future we were wondering if there is a way to update all of the solutions (which is the same as the one originally created) at once,...
14
3578
by: dl | last post by:
I have two classes, say A and B, both having a data member 'int n'; private in A, public in B. When I derive class C from both public A and public B, B::n should be visible to C while A::n should not be. But if I compile with g++-4.0.3 the following snippet: class A { int i;
4
1831
by: nospam | last post by:
Hello everyone - Newbie here with another dumb question :-) I want to have several apps under 1 domain - basically the domain root for general users and then an "admin" folder with a database utility www.generalusers.com www.generalusers.com/admin
0
7359
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7757
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7699
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5895
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5288
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4905
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3400
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1833
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
651
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.