Edit WebPart settings for all users?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Don

    Edit WebPart settings for all users?

    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
  • Michael Nemtsev [MVP]

    #2
    Re: Edit WebPart settings for all users?

    Hello Don,

    How do u store settings now? Do u use personalization for this http://msdn.microsoft.com/en-us/libr...e9(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


    DI am creating my first WebPart and I’m having trouble figuring out
    Dhow everything works together.
    D>
    DHow do I configure a WebPart with settings that will be the same for
    Dall users?
    D>
    DFor example, I have a WebPart and I want an administrator to
    Dconfigure the ConnectString name which will determine which database
    DConnectString is pulled from the web.config. But once this is
    Dconfigured it will be the same for all users.
    D>
    DBut, there can be many instances of this WebPart on the page and they
    Dmay connect to different database. So and admin may setup one
    DWebPart to connect to the database for customer A, and anther to
    Dconnect to the database for customer B.
    D>
    DI have several parameters that will work like this, the connect
    Dstring is just an example.
    D>
    DI’ve tried working with the various editor controls but they all seem
    Dto work on a per-user basis.
    DThanks,
    DDon


    Comment

    • Michael Nemtsev [MVP]

      #3
      Re: Edit WebPart settings for all users?

      Hello Don,

      How do u store settings now? Do u use personalization for this http://msdn.microsoft.com/en-us/libr...e9(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


      DI am creating my first WebPart and I’m having trouble figuring out
      Dhow everything works together.
      D>
      DHow do I configure a WebPart with settings that will be the same for
      Dall users?
      D>
      DFor example, I have a WebPart and I want an administrator to
      Dconfigure the ConnectString name which will determine which database
      DConnectString is pulled from the web.config. But once this is
      Dconfigured it will be the same for all users.
      D>
      DBut, there can be many instances of this WebPart on the page and they
      Dmay connect to different database. So and admin may setup one
      DWebPart to connect to the database for customer A, and anther to
      Dconnect to the database for customer B.
      D>
      DI have several parameters that will work like this, the connect
      Dstring is just an example.
      D>
      DI’ve tried working with the various editor controls but they all seem
      Dto work on a per-user basis.
      DThanks,
      DDon


      Comment

      • Don

        #4
        Re: Edit WebPart settings for all users?

        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.




        On Oct 27, 5:37 pm, Michael Nemtsev [MVP] <nemt...@msn.co mwrote:
        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
        >
        DI am creating my first WebPart and I’m having trouble figuring out
        Dhow everything works together.
        D>
        DHow do I configure a WebPart with settings that will be the same for
        Dall users?
        D>
        DFor example, I have a WebPart and I want an administrator to
        Dconfigure the ConnectString name which will determine which database
        DConnectString is pulled from the web.config.  But once this is
        Dconfigured it will be the same for all users.
        D>
        DBut, there can be many instances of this WebPart on the page and they
        Dmay connect to different database.  So and admin may setup one
        DWebPart to connect to the database for customer A, and anther to
        Dconnect to the database for customer B.
        D>
        DI have several parameters that will work like this, the connect
        Dstring is just an example.
        D>
        DI’ve tried working with the various editor controls but they all seem
        Dto work on a per-user basis.
        DThanks,
        DDon

        Comment

        • Michael Nemtsev [MVP]

          #5
          Re: Edit WebPart settings for all users?

          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


          DI have a custom editor, that inherits from EditorPart and saves
          Dchanges to the database. The WebPart reads this data the same for
          Devery user.
          D>
          DIn addition, I have the an appearance editor that enabels each user
          Dto make changes so persoanlization is used with this control.
          D>
          DOn Oct 27, 5:37 pm, Michael Nemtsev [MVP] <nemt...@msn.co mwrote:
          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
          >>
          >DI am creating my first WebPart and I’m having trouble figuring out
          >Dhow everything works together.
          >D>
          >DHow do I configure a WebPart with settings that will be the same
          >for
          >Dall users?
          >D>
          >DFor example, I have a WebPart and I want an administrator to
          >Dconfigure the ConnectString name which will determine which
          >database
          >DConnectStri ng is pulled from the web.config. But once this is
          >Dconfigured it will be the same for all users.
          >D>
          >DBut, there can be many instances of this WebPart on the page and
          >they
          >Dmay connect to different database. So and admin may setup one
          >DWebPart to connect to the database for customer A, and anther to
          >Dconnect to the database for customer B.
          >D>
          >DI have several parameters that will work like this, the connect
          >Dstring is just an example.
          >D>
          >DI’ve tried working with the various editor controls but they all
          >seem
          >Dto work on a per-user basis.
          >DThanks,
          >DDon

          Comment

          Working...