Monday, February 26, 2007

Hidden field's value gets lost

Hidden fields loose their value on postback, when the container they are placed in, is disabled. However, when they get disabled, their value is kept.

Wednesday, February 21, 2007

STOP ECG

STOP THE EUROPEAN CITY GUIDE!
If you run a small business you could be next!

Friday, February 09, 2007

Make a page refresh after a form submit


Guess what happens, if you insert new records in a datatable on a button click, then press F5, or the refresh button of the browser?! The same record is going to be inserted again. I found this very annoying.
A simple solution: redirect to the same page at the end of the button click event handler.
private void SaveClicked(object sender, EventArgs e)
{
// insert a record somewhere in a datatable
Response.Redirect(itself); // itself being the URL of the current page
}