in

ASP.NET Weblogs

Andy Smith's Blog

Page.RegisterStartupScript('Andy', 'MetaBuilders_WebControls_GainKnowledge();');

update and solution to my "you don't want to disable buttons' post

A few days I did something I don't generally like to do.

I posted a reason to not use one solution to a problem without giving a better way to solve it. I told everybody not to disable buttons after they've been clicked. Well, I had a flash of brilliance, and now I can offer a real solution. Introducing OneClick.

Serverside, no javascript required, and doesn't have any of the problems of disabling the button.

Hope you like it.

Comments

 

Pierre Chalamet said:

This does not work as expected in multi session environment.

Cache object is scoped by application not by session or am I wrong ?
September 19, 2003 3:27 AM
 

Johnny Hall said:

It won't work in a web farm or garden either. It's easily fixed if you have those environments, just use Session (out of process) instead.

But a great idea nevertheless. Thanks.
September 19, 2003 5:56 AM
 

Johnny Hall said:

It will work in a "multi-session" environment because each button instance is cached according to it's id, which is a GUID.
September 19, 2003 6:18 AM
 

Andy Smith said:

Johnny is correct, the usage of the Cache object won't affect multiple users because I store a form-level guid in the cache, not a traditional key.

unfortunatly, he is also correct about the web farm/garden problem. In my gleefull haste, I had overlooked that problem. Using an out-of-roc SessionState as the store for the GUID would seem to work, but you'll of course lose the feature where the GUID is released via automatic cache removal after the script times out and the UnLoad override can't release it.

It seems to me that the implications of this mean that a person using a web farm would have to change the code to use Session instead of cache. bummer.

Maybe an out-of-proc cache is in order?
September 19, 2003 12:39 PM
 

Datagrid Girl said:

Cool. Sounds like something Amazon would patent :)

Marcie
September 19, 2003 3:27 PM

Leave a Comment

(required)  
(optional)
(required)  
Add