Weird ViewState problem with NonSerialized() and Guid field

J

John Doe

Hi,

I have an object getting saved into ViewState.
The first (private) field of the object class is of type System.Guid.

Upon postback, after clicking an ImageButton in my page, I get an exception
of type "An error has occurred because a control with auto- generated id..."
etc.

I actually generate myself the ID mentionned in the exception and the code
should work fine since I'm not doing anything at all in Page_Load upon
postback.

If I replace the field with a string and change my code so that I convert my
string into a guid first when using it, I don't get the error.

I checked my code multiple times, and I really don't know what I'm doing
wrong.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top