473,395 Members | 1,996 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,395 software developers and data experts.

make Serializable or create custom TypeConverter ?

Hi,

I try to assign a variable of type WebControls.Button to ViewState as
follows

ViewState["m_ballSelected"] = m_ballSelected;

but get an error -->

"The type 'System.Web.UI.WebControls.Button' must be marked as Serializable
or have a TypeConverter other than ReferenceConverter to be put in
viewstate."

How do I mark this intrinsic-control as Serializable ?
or else ...
I guess I have to create a custom TypeConverter for my Button then ?
How do I do that ?
any code samples someone can recommend me ?

thanks

chris
Nov 17 '05 #1
1 2444
Just add EnableViewState="True" as an attribute to the
button in the aspx file.

HTH,
Gaz

-----Original Message-----
Hi,

I try to assign a variable of type WebControls.Button to ViewState asfollows

ViewState["m_ballSelected"] = m_ballSelected;

but get an error -->

"The type 'System.Web.UI.WebControls.Button' must be marked as Serializableor have a TypeConverter other than ReferenceConverter to be put inviewstate."

How do I mark this intrinsic-control as Serializable ?
or else ...
I guess I have to create a custom TypeConverter for my Button then ?How do I do that ?
any code samples someone can recommend me ?

thanks

chris
.

Nov 17 '05 #2

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

Similar topics

2
by: jeffpriz | last post by:
I'm having trouble.. I created a small class that I pass to my Pages, and I want to put that class into Viewstate.. I do: Viewstate.add("thisVar", myClassVariable) and i receive the lovely...
1
by: Yogesh Parab | last post by:
In our application we havr presentation layer and business laye. The presentation layer interacts with business layer using webservice. We need to store the object from the Business layer in the...
4
by: Kyote | last post by:
I'm trying to persist a list of filenames. I've made a custom collection and a FileName class: 'Class to hold file name information Public Class FileNames Public fullName As String Public...
1
by: Allan Ebdrup | last post by:
I get the error: "Cannot create an object of type 'CustomWizard' from its string representation 'CustomWizard1' for the CustomWizard Property." when I view my custom server web control in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.