Caching in a MCMS page

G

Guest

Hi,

I originally posted this question in the Microsoft Content Management Server
(MCMS) newsgroup but was told to post here.

In my MCMS site, I've written an "admin" page that sends out emails to a
list of subscribers. Everything is working fine, but if the admin user
happens to click refresh after the '000s emails have been sent, they will be
sent again. Obviously not good. I'm using some javascript to initially prompt
the user "are they sure" and then set the value "Y" or "N" in a hidden
textbox. After the emails have been sent (at the end of the click event) I
set this value back to "N".

If I overload LoadViewState and SaveViewState and step
through these events, I can see my textbox being set to "N" after the email
send, then, on the refresh it becomes empty string and then "Y" again.

I have also tried
"Page.Response.Cache.SetCacheability(HttpCacheability.NoCache);" in the
page_load event.

What do I have to do to make refresh function like the page had just been
hit for the first time. Can anyone assist me with this?

Thanks,
Anthony
 
G

Guest

Anthony,

There is no way to tell exactly when a user will press the browser refresh
button. They just press it when ever they feel like and you have to be ready
for it. The state changes your seeing ('m using my power to divine code) is
refresh is loading the initial value in the page_load event or page_init if
its hard coded in the aspx or ascx.

Permanent soultion persist if the emails have been sent on the server. Use
this persisted info to determine when to send the emails, how the page looks
when it is loaded (refreshed), etc. set it when sending emails of course,
How you clear it is up to you.

Good Luck
DWS
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top