473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Serialization problem, "is not marked as serializable" error for UserControl

Hi,

I am serializing a custom class holding some data for my project.

This data internally contains a class which contains an event

public delegate void MemberModifiedEventHandler(object sender,
MemberModifiedEventArgs e);

/// <summary>

/// Occurs on modification in a group.

/// </summary>

public event MemberModifiedEventHandler OnMembersModified;

This sender brings in a CutomPage derived from
System.Windows.Forms.UserControl.

I do not need to serialize this class as it contains only UI and has
got nothing to be saved and serialized.

But when i serialize the data it gives the error "CutomPage is not
marked as serializable".

How can i come across this problem without serializing this page.

NonSerializable attribute does not work for events and classes.

How can i serialize my data without serializing these usercontrol
clases.

Waiting for a kind reply.

Thanks & Regards

Nirdesh Dabas

ni********@yahoo.com

Aug 27 '07 #1
1 3018
Nirdesh,

Have you tried applying it to the field on the event, like so?

[field:NonSerializable]
public event EventHandler MyEvent;

That should work.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<ni***********@gmail.comwrote in message
news:11*********************@r29g2000hsg.googlegro ups.com...
Hi,

I am serializing a custom class holding some data for my project.

This data internally contains a class which contains an event

public delegate void MemberModifiedEventHandler(object sender,
MemberModifiedEventArgs e);

/// <summary>

/// Occurs on modification in a group.

/// </summary>

public event MemberModifiedEventHandler OnMembersModified;

This sender brings in a CutomPage derived from
System.Windows.Forms.UserControl.

I do not need to serialize this class as it contains only UI and has
got nothing to be saved and serialized.

But when i serialize the data it gives the error "CutomPage is not
marked as serializable".

How can i come across this problem without serializing this page.

NonSerializable attribute does not work for events and classes.

How can i serialize my data without serializing these usercontrol
clases.

Waiting for a kind reply.

Thanks & Regards

Nirdesh Dabas

ni********@yahoo.com

Aug 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: CM | last post by:
Hi, There: I am working on a commercial ASP web application which use MS Access 2000 as database. When configuring the database access, I got an error saying that this database is a read-only...
9
by: Bjorn | last post by:
Hi, I need to determine the hightest date between e.g. "8/3/2004" and "8/4/2004". With this code, i get 'dat2' , which means that "8/4/2004" is higher than "8/3/2004". That 's right. But with...
60
by: K. G. Suarez | last post by:
Hello everyone. I am new to programming and my uncle gave me a copy of "C For Dummies 2nd Edition". I am up to chapter 9 right now. He probably saw me struggling with "The C Programming...
7
by: ben | last post by:
hello, an algorithm book i'm reading talks about the connectivity problem/algorithm. it gives a number of examples where the connectivity problem applies to real life situations (like, the...
0
by: Junkguy | last post by:
I need to be able to tell if the blank row of a DataGrid has been edited or not. In a DataGrid, you may notice that if you click on the asterisk row, the asterisk will change to a triangle, but...
9
by: Lonnie Princehouse | last post by:
There doesn't seem to be any way to customize the behavior of "is" as can be done for other operators... why not?
10
by: abcd | last post by:
I recently came across a problem where I saw this error: "TypeError: unsubscriptable object" How can I determine if an object is "scriptable" or "unscriptable"?
10
by: mcbobin | last post by:
Hi, Here's hoping someone can help... I'm using a stored procedure to return a single row of data ie a DataRow e.g. public static DataRow GetManualDailySplits(string prmLocationID, string
5
by: Zytan | last post by:
I am trying to pass a variable that has been disposed into a function that accepts an object, and I get this exception. What does it mean? Why can't I pass in *anything* into a parameter of type...
94
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.