473,398 Members | 2,389 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,398 software developers and data experts.

.NET 3.5 version of code

Hi

I'm having difficulty finding out what the latest version of the .NET
framework's C# code equivalent is for the following:

using System.Web.Script.Serialization;

JavaScriptSerializer ser = new JavaScriptSerializer();
result = ser.Deserialize<MyType>(JSON_encoded_string);
Any help would be appreciated.
Cheers
Matt
Jun 27 '08 #1
4 941
This should help you :

http://msdn.microsoft.com/en-us/library/bb355316.aspx

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Matty J" <ma*********@gmail.comwrote in message
news:74**********************************@v26g2000 prm.googlegroups.com...
Hi

I'm having difficulty finding out what the latest version of the .NET
framework's C# code equivalent is for the following:

using System.Web.Script.Serialization;

JavaScriptSerializer ser = new JavaScriptSerializer();
result = ser.Deserialize<MyType>(JSON_encoded_string);
Any help would be appreciated.
Cheers
Matt

Jun 27 '08 #2
Thanks Juan.

I'm confused - is that not the same code as in my example?

When I compile my project using Visual Studio 2008 it tells me:
Warning
1 'System.Web.Script.Serialization.JavaScriptSeriali zer.JavaScriptSerializer()'
is obsolete: 'The recommended alternative is
System.Runtime.Serialization.DataContractJsonSeria lizer.' C:\inetpub
\Website\members\default.aspx.cs 53 32 WebProject

Any further ideas?
Cheers
Matt
Jun 27 '08 #3
re:
!obsolete

Obsolete ?

Even ScottGu wonders why :

http://weblogs.asp.net/scottgu/archi...g-net-3-5.aspx

Read the sample code there, as well, as the user comments and Scott's replies.

Also, note that "obsolete' doesn't mean you can't use it, even if you get a warning.

<quote>
The JavaScriptSerializer is currently marked obsolete - although I'm
not sure why (was going to ask someone about this today). It is very handy.

Note that obsolete doesn't mean removal in .NET 3.5
- it will be supported at least another version or two (or longer if I can convince them <g>)
</quote>

Your code should work...with a warning.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Matty J" <ma*********@gmail.comwrote in message
news:7a**********************************@u36g2000 prf.googlegroups.com...
Thanks Juan.

I'm confused - is that not the same code as in my example?

When I compile my project using Visual Studio 2008 it tells me:
Warning
1 'System.Web.Script.Serialization.JavaScriptSeriali zer.JavaScriptSerializer()'
is obsolete: 'The recommended alternative is
System.Runtime.Serialization.DataContractJsonSeria lizer.' C:\inetpub
\Website\members\default.aspx.cs 53 32 WebProject

Any further ideas?
Cheers
Matt

Jun 27 '08 #4
Great, thanks Juan, that's what I needed to know.
Cheers
Matt
Jun 27 '08 #5

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

Similar topics

0
by: Anthony Baxter | last post by:
To go along with the 2.4a3 release, here's an updated version of the decorator PEP. It describes the state of decorators as they are in 2.4a3. PEP: 318 Title: Decorators for Functions and...
0
by: Willem | last post by:
Based on MK's TSI_SOON (http://www.trigeminal.com/)I've created a nifty little procedure that - whenever you compact you db you get an incremental backup copy. Given that you have a table with...
4
by: Earl T | last post by:
When I try to get the netscape version for version 7, I get the HttpBrowserCapabilities class returning the version as 5 and not 7. (see code and output below) CODE HttpBrowserCapabilities...
9
by: shorti | last post by:
I reviewed a similar post on an older version of DB2. I was wondering if there was anything available now that is more precise in gathering the db2 version for the new v8 calls. I am running...
1
by: Andrew | last post by:
In ASP.NET 1.1 I used to retreive the version of my code-behind assembly using following syntax: Assembly.GetExecutingAssembly().GetName().Version The version was defined in AssemblyInfo.cs using...
4
by: Mike L | last post by:
Error occurs on "System.Deployment.Application.ApplicationDeployment.CurrentDeployment" ** Here is my code private void frmMain_Load(object sender, System.EventArgs e) {...
2
by: Hongbo | last post by:
Hi, I have a web site built in ASP.Net 1.1 running on production server. It's the version 1.0. Now I need to build the version 2.0 for this web site. The version 2.0 will be built based on the...
1
by: Sky | last post by:
Yesterday I was told that GetType(string) should not just be with a Type, but be Type, AssemblyName. Fair enough, get the reason. (Finally!). As long as it doesn't cause tech support problems...
0
by: ev951 | last post by:
I am not that familiar with XML or XSL and I am trying to sort application version number strings in an XML file that my team uses for application installations on our Linux servers. I have tried...
8
by: schaf | last post by:
Hi Ng! My application (version 1 a1) communicates with a service (version 1 s1). Now I would like to update the service and create a service version 2 (s2). The new function calls within s2 are...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.