D
darrel
The scenario:
I have a button that when clicked sets a cookie value.
On page load, I read this cookie value and write out some specific HTML.
The catch:
It appears that the buttonHandler executes AFTER the page load on the
postback.
As such, my page is 'one refresh' behind. In otherwords, If I hit the button
to set the cookie, when the page loads, it hasn't 'taken' the new setting
yet since it loaded before the cookie was set.
To get around this, after setting the value in the button handler, I then
response.redirect back to itself. Is this the best way to handle this
problem, or is there a better way to go about this? This method seems to
work just fine, but I'm not sure if I'm committing some huge .net faux pau.
-Darrel
I have a button that when clicked sets a cookie value.
On page load, I read this cookie value and write out some specific HTML.
The catch:
It appears that the buttonHandler executes AFTER the page load on the
postback.
As such, my page is 'one refresh' behind. In otherwords, If I hit the button
to set the cookie, when the page loads, it hasn't 'taken' the new setting
yet since it loaded before the cookie was set.
To get around this, after setting the value in the button handler, I then
response.redirect back to itself. Is this the best way to handle this
problem, or is there a better way to go about this? This method seems to
work just fine, but I'm not sure if I'm committing some huge .net faux pau.
-Darrel