Edit WebPart settings for all users?

  • Thread starter Thread starter Don
  • Start date Start date
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
 
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
 
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
 
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.
 
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
 
Back
Top