472,119 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

how to change one element of machine.config into web.config?

Dan
H,

i want to use for one specific application the default membership provider
as defined by default in machine.config, except one element: i want to use
requiresUniqueEmail="false" instead of the default configuration in
machine.config (which is set on "true").

So i did this in the web.config of the application:
<membership defaultProvider="MyMembershipProvider">
<providers>
requiresUniqueEmail="true"
/>
</providers>
</membership>

but this generates the error: "The configuration section cannot contain a
CDATA or text element."

if i put
<add name=" ..."
i also have to put: "Type"
and also the connectionstring

and then i have to add the section
<connectionStrings>
Do i have to copy the entire membership section of the machine.config into
web.config + section <connectionStrings>
and change the element "requiresUniqueEmail", or it can shorter?

Thanks
Dan
Apr 18 '07 #1
4 6393
You have to remove the provider you want to change and then re-add it, as
in:

<membership defaultProvider="SqlPageContentMembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<remove name="MyMembershipProvider"/>
<add name="MyMembershipProvider"
type="DsiGlobal.AspNetControls.SqlMembershipProvid er"
connectionStringName="WebContentConnectionString"
applicationName="appName"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
passwordFormat="Encrypted"/>
</providers>
</membership>

You can also use <clear /to remove all the Membership Providers, and then
add it back in. Remember that essentially, the providers element represents
a NameValueCollection, so you treat it like one.
--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Dan" <da******@nomaol.nlwrote in message
news:eu**************@TK2MSFTNGP02.phx.gbl...
H,

i want to use for one specific application the default membership provider
as defined by default in machine.config, except one element: i want to use
requiresUniqueEmail="false" instead of the default configuration in
machine.config (which is set on "true").

So i did this in the web.config of the application:
<membership defaultProvider="MyMembershipProvider">
<providers>
requiresUniqueEmail="true"
/>
</providers>
</membership>

but this generates the error: "The configuration section cannot contain a
CDATA or text element."

if i put
<add name=" ..."
i also have to put: "Type"
and also the connectionstring

and then i have to add the section
<connectionStrings>
Do i have to copy the entire membership section of the machine.config into
web.config + section <connectionStrings>
and change the element "requiresUniqueEmail", or it can shorter?

Thanks
Dan


Apr 18 '07 #2
Dan
Thanks for replying,

so if i understand good, if i want to change only one property of the
default provider (like requirersUniqueEmail), i have to remove the provider,
then to add it back and redifine all other properties + also define a new
connectionstring with <connectionstrings></connectionstringselement
(because there is no one in web.config).
Is this correct?
If yes, a lot of work for just changing a "true" in "false", don't you think
so?

"Kevin Spencer" <un**********@nothinks.comschreef in bericht
news:eC**************@TK2MSFTNGP04.phx.gbl...
You have to remove the provider you want to change and then re-add it, as
in:

<membership defaultProvider="SqlPageContentMembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<remove name="MyMembershipProvider"/>
<add name="MyMembershipProvider"
type="DsiGlobal.AspNetControls.SqlMembershipProvid er"
connectionStringName="WebContentConnectionString"
applicationName="appName"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
passwordFormat="Encrypted"/>
</providers>
</membership>

You can also use <clear /to remove all the Membership Providers, and
then add it back in. Remember that essentially, the providers element
represents a NameValueCollection, so you treat it like one.
--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Dan" <da******@nomaol.nlwrote in message
news:eu**************@TK2MSFTNGP02.phx.gbl...
>H,

i want to use for one specific application the default membership
provider as defined by default in machine.config, except one element: i
want to use requiresUniqueEmail="false" instead of the default
configuration in machine.config (which is set on "true").

So i did this in the web.config of the application:
<membership defaultProvider="MyMembershipProvider">
<providers>
requiresUniqueEmail="true"
/>
</providers>
</membership>

but this generates the error: "The configuration section cannot contain a
CDATA or text element."

if i put
<add name=" ..."
i also have to put: "Type"
and also the connectionstring

and then i have to add the section
<connectionStrings>
Do i have to copy the entire membership section of the machine.config
into web.config + section <connectionStrings>
and change the element "requiresUniqueEmail", or it can shorter?

Thanks
Dan



Apr 18 '07 #3
so if i understand good, if i want to change only one property of the
default provider (like requirersUniqueEmail), i have to remove the
provider, then to add it back and redifine all other properties + also
define a new connectionstring with <connectionstrings></connectionstrings>
element (because there is no one in web.config).
Is this correct?
As I said, the configuration section exposes an underlying Collection.
However, there is no interface for changing any of the properties of the
members via the configuration file. But there is a configuration interface
for removing and adding members, so that is what you do. Yes. That's
correct.
If yes, a lot of work for just changing a "true" in "false", don't you
think so?
You've spent more time talking about it than it takes to do it, so, no I
don't think it's a lot of work.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Dan" <da******@nomaol.nlwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Thanks for replying,

so if i understand good, if i want to change only one property of the
default provider (like requirersUniqueEmail), i have to remove the
provider, then to add it back and redifine all other properties + also
define a new connectionstring with <connectionstrings></connectionstrings>
element (because there is no one in web.config).
Is this correct?
If yes, a lot of work for just changing a "true" in "false", don't you
think so?

"Kevin Spencer" <un**********@nothinks.comschreef in bericht
news:eC**************@TK2MSFTNGP04.phx.gbl...
>You have to remove the provider you want to change and then re-add it, as
in:

<membership defaultProvider="SqlPageContentMembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<remove name="MyMembershipProvider"/>
<add name="MyMembershipProvider"
type="DsiGlobal.AspNetControls.SqlMembershipProvid er"
connectionStringName="WebContentConnectionString"
applicationName="appName"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
passwordFormat="Encrypted"/>
</providers>
</membership>

You can also use <clear /to remove all the Membership Providers, and
then add it back in. Remember that essentially, the providers element
represents a NameValueCollection, so you treat it like one.
--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Dan" <da******@nomaol.nlwrote in message
news:eu**************@TK2MSFTNGP02.phx.gbl...
>>H,

i want to use for one specific application the default membership
provider as defined by default in machine.config, except one element: i
want to use requiresUniqueEmail="false" instead of the default
configuration in machine.config (which is set on "true").

So i did this in the web.config of the application:
<membership defaultProvider="MyMembershipProvider">
<providers>
requiresUniqueEmail="true"
/>
</providers>
</membership>

but this generates the error: "The configuration section cannot contain
a CDATA or text element."

if i put
<add name=" ..."
i also have to put: "Type"
and also the connectionstring

and then i have to add the section
<connectionStrings>
Do i have to copy the entire membership section of the machine.config
into web.config + section <connectionStrings>
and change the element "requiresUniqueEmail", or it can shorter?

Thanks
Dan




Apr 18 '07 #4
Dan
Ok, thanks for your advice ... and time

"Kevin Spencer" <un**********@nothinks.comschreef in bericht
news:eU**************@TK2MSFTNGP04.phx.gbl...
>so if i understand good, if i want to change only one property of the
default provider (like requirersUniqueEmail), i have to remove the
provider, then to add it back and redifine all other properties + also
define a new connectionstring with
<connectionstrings></connectionstringselement (because there is no one
in web.config).
Is this correct?

As I said, the configuration section exposes an underlying Collection.
However, there is no interface for changing any of the properties of the
members via the configuration file. But there is a configuration interface
for removing and adding members, so that is what you do. Yes. That's
correct.
>If yes, a lot of work for just changing a "true" in "false", don't you
think so?

You've spent more time talking about it than it takes to do it, so, no I
don't think it's a lot of work.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Dan" <da******@nomaol.nlwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>Thanks for replying,

so if i understand good, if i want to change only one property of the
default provider (like requirersUniqueEmail), i have to remove the
provider, then to add it back and redifine all other properties + also
define a new connectionstring with
<connectionstrings></connectionstringselement (because there is no one
in web.config).
Is this correct?
If yes, a lot of work for just changing a "true" in "false", don't you
think so?

"Kevin Spencer" <un**********@nothinks.comschreef in bericht
news:eC**************@TK2MSFTNGP04.phx.gbl...
>>You have to remove the provider you want to change and then re-add it,
as in:

<membership defaultProvider="SqlPageContentMembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<remove name="MyMembershipProvider"/>
<add name="MyMembershipProvider"
type="DsiGlobal.AspNetControls.SqlMembershipProvid er"
connectionStringName="WebContentConnectionString"
applicationName="appName"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
passwordFormat="Encrypted"/>
</providers>
</membership>

You can also use <clear /to remove all the Membership Providers, and
then add it back in. Remember that essentially, the providers element
represents a NameValueCollection, so you treat it like one.
--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Dan" <da******@nomaol.nlwrote in message
news:eu**************@TK2MSFTNGP02.phx.gbl...
H,

i want to use for one specific application the default membership
provider as defined by default in machine.config, except one element: i
want to use requiresUniqueEmail="false" instead of the default
configuration in machine.config (which is set on "true").

So i did this in the web.config of the application:
<membership defaultProvider="MyMembershipProvider">
<providers>
requiresUniqueEmail="true"
/>
</providers>
</membership>

but this generates the error: "The configuration section cannot contain
a CDATA or text element."

if i put
<add name=" ..."
i also have to put: "Type"
and also the connectionstring

and then i have to add the section
<connectionStrings>
Do i have to copy the entire membership section of the machine.config
into web.config + section <connectionStrings>
and change the element "requiresUniqueEmail", or it can shorter?

Thanks
Dan




Apr 18 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marcin Polewski | last post: by
2 posts views Thread by Joel D Kraft | last post: by
3 posts views Thread by PawelR | last post: by
4 posts views Thread by Ravi Ambros Wallau | last post: by
11 posts views Thread by TARUN | last post: by
reply views Thread by Michael Bray | last post: by
reply views Thread by leo001 | last post: by

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.