Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 254455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:50:52+00:00 2026-05-11T21:50:52+00:00

As part of a MOSS 2007 solution, I’ve got a web part that displays

  • 0

As part of a MOSS 2007 solution, I’ve got a web part that displays a ‘term’ of the day. The terms are stored in a horribly messy XML file so it all gets parsed nicely and then is supposed to update a property called LastUpdatedOn to the current time.

My problem is that administrator level accounts can see this with no problems whatsoever, but viewers are getting an error stating that they have insufficient privileges to save the properties of the web part.

I’m running the code within an elevated privileges delegate, and have instantiated a new context to get around the fact that the context still thinks the current user is not the system account.

Pastebin of full code can be found here

The problem lines are:

SaveProperties = true;
LastUpdatedOn = DateTime.Now.ToString();

Commenting these out means that my web part works, but it will always display a random term on every page load instead of keeping the same term for 24 hours.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:50:53+00:00Added an answer on May 11, 2026 at 9:50 pm

    Why not base your seed on todays date and skip saving a value?

    Sample:

    Random r = new Random(DateTime.Now.DayOfYear + 365 * DateTime.Now.Year);
    r.Next(count);
    

    This will give you a new random value each day.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a web part for MOSS 2007. The web part is being deployed
I've added this code below to a MOSS 2007 web part inside OnPreRender() method.
Part of my application maps resources stored in a number of locations onto web
Part of our java application needs to run javascript that is written by non-developers.
Part of my project is to write a text editor that is used for
Part of my everyday work is maintaining and extending legacy VB6 applications. A common
Part of a new product I have been assigned to work on involves server-side
Part of the install for an app I am responsible for, compiles some C
Part of the series of controls I am working on obviously involves me lumping
Part of the setup routine for the product I'm working on installs a database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.