Wrox Programmer Forums
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 26th, 2007, 03:46 PM
Friend of Wrox
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default question about Serialization


I looked the code of chapter 11 of the Wrox-book "Beginning with Asp.Net 2.0" and i have a question about Serialization.

There is a class defined as this:
<Serializable()> _
Public Class CartItem
Private _id As Integer = -1
Private _title As String = String.Empty
etc ...

which represents an item of the shoppingcart.

In web.config, there is this code for defining the profiles:
   <add name="Name" />
<add name="Cart" serializeAs="Binary" type="wrox.ShoppingCart"/>

My question: what does Serialization / serializeAs="Binary" exactly do? What are the adantages of coding this?


Old February 26th, 2007, 04:04 PM
Wrox Author
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons

This is a good article on Serialization and what it does/is http://www.interviewcorner.com/Answe...rCategoryId=19

However, I am not familiar with that web.config attribute.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET

Old February 27th, 2007, 04:03 PM
Friend of Wrox
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts

Thanksfor replying.

In whole the application, there is no method (Serialize()) for serialization of the Class, so i guess the serializeAs="Binary" does the same as the missing method?

Similar Threads
Thread Thread Starter Forum Replies Last Post
serialization taheernawaz ASP.NET 1.x and 2.0 Application Design 0 December 12th, 2007 03:32 AM
Complex Serialization abedijoo C# 2005 5 April 18th, 2007 10:38 AM
Question about error after adding serialization... davidd31415 BOOK: Ivor Horton's Beginning Visual C++ 2005 1 December 28th, 2006 04:58 AM
Hashtable for Serialization in C# sachin-csharp .NET Framework 2.0 0 July 27th, 2004 02:25 AM
XML Serialization rajeshnerenki General .NET 0 June 14th, 2004 08:50 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.