Edit WebPart settings for all users?

D

Don

I am creating my first WebPart and I’m having trouble figuring out how
everything works together.

How do I configure a WebPart with settings that will be the same for
all users?

For example, I have a WebPart and I want an administrator to configure
the ConnectString name which will determine which database
ConnectString is pulled from the web.config. But once this is
configured it will be the same for all users.

But, there can be many instances of this WebPart on the page and they
may connect to different database. So and admin may setup one WebPart
to connect to the database for customer A, and anther to connect to
the database for customer B.

I have several parameters that will work like this, the connect string
is just an example.

I’ve tried working with the various editor controls but they all seem
to work on a per-user basis.
Thanks,
Don
 
M

Michael Nemtsev [MVP]

Hello Don,

How do u store settings now? Do u use personalization for this http://msdn.microsoft.com/en-us/library/z36h8be9(VS.80).aspx
?

---
WBR,
Michael Nemtsev [Microsoft MVP] :: blog: http://spaces.live.com/laflour
:: http://twitter.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


D> I am creating my first WebPart and I’m having trouble figuring out
D> how everything works together.
D>
D> How do I configure a WebPart with settings that will be the same for
D> all users?
D>
D> For example, I have a WebPart and I want an administrator to
D> configure the ConnectString name which will determine which database
D> ConnectString is pulled from the web.config. But once this is
D> configured it will be the same for all users.
D>
D> But, there can be many instances of this WebPart on the page and they
D> may connect to different database. So and admin may setup one
D> WebPart to connect to the database for customer A, and anther to
D> connect to the database for customer B.
D>
D> I have several parameters that will work like this, the connect
D> string is just an example.
D>
D> I’ve tried working with the various editor controls but they all seem
D> to work on a per-user basis.
D> Thanks,
D> Don
 
M

Michael Nemtsev [MVP]

Hello Don,

How do u store settings now? Do u use personalization for this http://msdn.microsoft.com/en-us/library/z36h8be9(VS.80).aspx
?

---
WBR,
Michael Nemtsev [Microsoft MVP] :: blog: http://spaces.live.com/laflour
:: http://twitter.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


D> I am creating my first WebPart and I’m having trouble figuring out
D> how everything works together.
D>
D> How do I configure a WebPart with settings that will be the same for
D> all users?
D>
D> For example, I have a WebPart and I want an administrator to
D> configure the ConnectString name which will determine which database
D> ConnectString is pulled from the web.config. But once this is
D> configured it will be the same for all users.
D>
D> But, there can be many instances of this WebPart on the page and they
D> may connect to different database. So and admin may setup one
D> WebPart to connect to the database for customer A, and anther to
D> connect to the database for customer B.
D>
D> I have several parameters that will work like this, the connect
D> string is just an example.
D>
D> I’ve tried working with the various editor controls but they all seem
D> to work on a per-user basis.
D> Thanks,
D> Don
 
D

Don

I have a custom editor, that inherits from EditorPart and saves
changes to the database. The WebPart reads this data the same for
every user.

In addition, I have the an appearance editor that enabels each user to
make changes so persoanlization is used with this control.
 
M

Michael Nemtsev [MVP]

Hello Don,

Well, there is no "per-instance" storage for web parts, by default.
What you can do is to differ your web parts by name or generate new GUID

---
WBR,
Michael Nemtsev [Microsoft MVP] :: blog: http://spaces.live.com/laflour
:: http://twitter.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


D> I have a custom editor, that inherits from EditorPart and saves
D> changes to the database. The WebPart reads this data the same for
D> every user.
D>
D> In addition, I have the an appearance editor that enabels each user
D> to make changes so persoanlization is used with this control.
D>
Hello Don,

How do u store settings now? Do u use personalization for
thishttp://msdn.microsoft.com/en-us/library/z36h8be9(VS.80).aspx

?

---
WBR,
Michael Nemtsev [Microsoft MVP] ::
blog:http://spaces.live.com/laflour
::http://twitter.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

D> I am creating my first WebPart and I’m having trouble figuring out
D> how everything works together.
D>
D> How do I configure a WebPart with settings that will be the same
for
D> all users?
D>
D> For example, I have a WebPart and I want an administrator to
D> configure the ConnectString name which will determine which
database
D> ConnectString is pulled from the web.config. But once this is
D> configured it will be the same for all users.
D>
D> But, there can be many instances of this WebPart on the page and
they
D> may connect to different database. So and admin may setup one
D> WebPart to connect to the database for customer A, and anther to
D> connect to the database for customer B.
D>
D> I have several parameters that will work like this, the connect
D> string is just an example.
D>
D> I’ve tried working with the various editor controls but they all
seem
D> to work on a per-user basis.
D> Thanks,
D> Don
 

Ask a Question

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

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top