Session state?

When I look at Trace.axd for my web application, it doesn’t appear that the session state is being set by the GoView control.

I see a session cookie, but when I look in the session state portion of the trace nothing is showing.
I have the GoView control inside a user control that is inside my application.
When I put a breakpoint in my SessionStarted handler, it seems to be getting called every time there is a postback to my page.
Shouldn't the session started handler be called only once?

Yes, it should only be called once. It sounds like session state is being cleared for some reason.

Is EnableViewState true for the GoView? The only information GoView saves in view state is a unique identifier that is a key in the session state to find the GoView stored in session state. For many applications this identifier is not needed, but if your GoView is inside a user control, it may well be needed after all.

EnableViewState is false for the view. The view is a control inside a user control which is then placed on our page. Could the user control be interfering with the session state somehow?

Yes, try setting GoView.EnableViewState to true.

Won’t that mean serializing a gigantic pile of stuff (all my nodes in my document, etc.)?

No, as I said above, the only thing GoView saves in view state is an identifier in the session. It’s what’s returned by GoView.MakeSessionViewID(). When there’s no view state available, it returns GoView.SafeID, which is an identifier-safe version of Control.UniqueID.