If I do this

x = 5
ViewState("myX") = x


then after a post-back, ViewState("myX") is Nothing


but this

x = 5
ViewState("myX") = x.toString

works just fine


any ideas why this is so? I thought it stored objects, and as such could
store anything


(it also doesn't work correctly with date fields)