[Mono-bugs] [Bug 326288] New: Cannot add attributes to DropDownList's items
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Wed Sep 19 05:43:27 EDT 2007
https://bugzilla.novell.com/show_bug.cgi?id=326288
Summary: Cannot add attributes to DropDownList's items
Product: Mono: Class Libraries
Version: 1.2
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Sys.Web
AssignedTo: mhabersack at novell.com
ReportedBy: g.tardini at caleidoscopio.it
QAContact: mono-bugs at ximian.com
Found By: ---
Created an attachment (id=173268)
--> (https://bugzilla.novell.com/attachment.cgi?id=173268)
Test page
In a page containing a DropDownList, the following code
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
return;
for (int i = 1; i < 13; i++)
{
ListItem item = new
ListItem(CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(i),
i.ToString());
item.Attributes.Add("title", "tooltip of " + i.ToString());
DropDownList1.Items.Add(item);
}
}
causes an exception to be thrown during the page opening. After removing the
Attributes.Add call, the example works.
The exception thrown is:
System.Runtime.Serialization.SerializationException: Type
System.Web.UI.StateBag is not marked as Serializable.
at
System.Runtime.Serialization.Formatters.Binary.BinaryCommon.CheckSerializable
(System.Type type, ISurrogateSelector selector, StreamingContext context)
[0x00000]
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.GetObjectData
(System.Object obj,
System.Runtime.Serialization.Formatters.Binary.TypeMetadata& metadata,
System.Object& data) [0x00000]
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject
(System.IO.BinaryWriter writer, Int64 id, System.Object obj) [0x00000]
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance
(System.IO.BinaryWriter writer, System.Object obj, Boolean isValueObject)
[0x00000]
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects
(System.IO.BinaryWriter writer) [0x00000]
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph
(System.IO.BinaryWriter writer, System.Object obj,
System.Runtime.Remoting.Messaging.Header[] headers) [0x00000]
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
(System.IO.Stream serializationStream, System.Object graph,
System.Runtime.Remoting.Messaging.Header[] headers) [0x00000]
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
(System.IO.Stream serializationStream, System.Object graph) [0x00000]
at System.Web.UI.ObjectStateFormatter+BinaryObjectFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectArrayFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectArrayFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+TripletFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+TripletFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ArrayListFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+TripletFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ArrayListFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+TripletFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+PairFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+PairFormatter.Write
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter+ObjectFormatter.WriteObject
(System.IO.BinaryWriter w, System.Object o, System.Web.UI.WriterContext ctx)
[0x00000]
at System.Web.UI.ObjectStateFormatter.SerializeValue (System.IO.BinaryWriter
w, System.Object o) [0x00000]
at System.Web.UI.ObjectStateFormatter.Serialize (System.IO.Stream
outputStream, System.Object stateGraph) [0x00000]
at System.Web.UI.ObjectStateFormatter.Serialize (System.Object stateGraph)
[0x00000]
at System.Web.UI.HiddenFieldPageStatePersister.Save () [0x00000]
at System.Web.UI.Page.SavePageStateToPersistenceMedium (System.Object
viewState) [0x00000]
at System.Web.UI.Page.SavePageViewState () [0x00000]
at System.Web.UI.Page.InternalProcessRequest () [0x00000]
at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context)
[0x00000]
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list