.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Differences in Json.Stringify implementation

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :ASP.Net

I noticed that when I use IE8's Json.Stringify for a japanese character, e.g. "????? ?????", it returns

\u52a0\u3048\u306a\u3055\u3044 \u3084\u3084\u65b0\u3057\u3044

However when I use Firefox's Json.Stringify, it returns

????? ?????

IE8's Json.Stringify('????? ?????')


\u52a0\u3048\u306a\u3055\u3044 \u3084\u3084\u65b0\u3057\u3044

Firefox's Json.Stringify('('????? ?????')')


'????? ?????'

What is the difference? My preferred outcome is the unicode escape version.

View Complete Post

More Related Resource Links

jQuery Date picker Implementation in ASP.NET

I've posted a wrapper ASP.NET around the jQuery.UI Datepickercontrol. This small client side calendar control is compact, looks nice and is very easy to use and I've added it some time back to my control library.

This is primarily an update for the jQuery.ui version, and so I spend a few hours or so cleaning it up which wasn't as easy as it could have been since the API has changed quite drastically from Marc's original implementation. The biggest changes have to do with the theming integration and the resulting explosion of related resources.

If you want to use this component you can check it out a sample and the code here:

RSS implementation code - need suggestion


Please suggest what is the best approach of coding for RSS implementation,


Implementation 1:

a) Add custom handler in web.config for .rss type

b) Create a handler class (RSSHandler.cs) in APP_Code

c) Create a Sample.rss file

d) Browse Sample.rss in browser

 Technical Solution:Utility Classes:I)                   

Debug implementation of URLrewriter.net



After some googling and help from the forum, I have integrated the the URLrewrting.net in my project. There are no error when I build the project, but the URL rewriting does not work. I am able to figure ot where the problem is. Is there a way to debug this. The code is as below:

 Web.config file

<?xml version="1.0"?>
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
		<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
			<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
				<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.W

WCF Data Service to JSON example? v4


I would like to take WCF Data Service and produce JSON output to consume on various mobile apps.

Can anyone give me a how-to on the JSON part?  I.e., what is different than normal XML outut?



Json Deserialization is giving error in IronPython



Have anyone tried json deserialization. When I tried:

>>> import json

>>> json.loads('["foo", {"bar":["baz", '"Test", 1.0, 2]}]')

I got following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\json\__init__.py", line
 307, in loads
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\json\scanner.py", line
42, in iterscan

.NET Remoting: Create a Custom Marshaling Implementation Using .NET Remoting and COM Interop


The .NET Framework offers several methods for customizing the presentation of native .NET and COM object types. One such technique, custom marshaling, refers to the notion of specializing object type presentations. There are times, like when a legacy COM component needs to implement a new interface or when you need to make calls across process or machine boundaries, when custom marshaling saves the day. Elements of COM Interop permit the customizing of COM types while .NET Remoting offers the developer the ability to tailor native .NET types. This article examines these techniques.

Jim Sievert

MSDN Magazine September 2003

Rotor: Shared Source CLI Provides Source Code for a FreeBSD Implementation of .NET


With over 9,000 files, and including some 1300 public classes to pore through, the Shared Source CLI can teach you quite a bit about the internal workings of the CLR. But the sheer amount of source code included can make just starting your exploration a monumental task. This article discusses some of the things you can learn from the source code facsimile of the CLR, like how JIT compilation works. It will also help you understand how to control execution along with debugging and loading classes. A walk through the steps involved in setting up the runtime will let you become familiar with the process.

Jason Whittington

MSDN Magazine July 2002

simple json post url api



I am a json newbie :)

I have this site that has an api that can provide city name if I send my zip code as a parameter. 


the result is returned as a json object. Now i just want to read the result in my js function.

I have tried the following but it always returns null:

function postnr() {
    var url = 'http://www.postnummersok.se/api?q=16447';

Writing Data to database with jQuery Forms, ASMX Webservice, & JSON - help!



Can someone point me in the right direction on how to submit data from a jQuery form to a ASMX webservice? I have gotten everything on the form ready to be submitted to the database and now I am stuck on how to send it over using $.ajax(). Everything I have read tells me how to get data from a webservice and display it with jQuery, but not the other direction nor how to access the json data within the within the webservice service(similar to a Request.Form approach with ASP.NET forms).

In other words: 

1. What do I need to do to my webservice to make sure it can receive data from the jQuery form. 

2. What do I need to do in jQuery to receive an acknowledgement the save on the server side was successful. 

I can explain more if need be, but if there is a comprehensive tutorial on not only reading, but also WRITING data with jQuery, JSON, etc. I would love to get pointed in that direction. 

Prevent Concurrent Logins ? [ Already logged in or currest session is still active implementation] ?


Hi Experts ,

I searched over the web but no luck so far and thought of getting some help form gurus .

Did any out really implemented a way to handle concurrent logins ?

Please not that i'm no using either forms authentication or Roles/Memberships , I do have custom authentication for my website .

I'm sure it is someway related  with global.asax file handling something in application events and session events but unable to figure this one out .

Any pointers will highly be valued and appreciated .

Thanks a tonne in advance .

JSON Deserialize into Entity Framework Object and setting the DataMemberAttribute "Name="




I'm in the process of deserializing a JSON object into an Entity Framework object.  The property names in the JSON do not match up totally with the property names in the Entity Framework Objects. What I'd like to do is set "Name=" on the  "DataContractAttribute" for the table and the "DataMemberAttribute" for the properties in the Designer.cs file.  I tried setting these in the Designer.cs file manually just to see if it would work - which it did (using JSON.Net) but of course when I went into the .edmx designer I lost all my changes.  Is there a way to do this?


Thanks in advance

unable to use wcf service with json in asp.net



I have developed a wcf service for asp.net ajax client. It includes the following steps.

(1) Created WCF sevice contract with the operation "DoWork()" which will take string as input and retun string as output.

(2)Implemented the above operation contract(attributed the implementation class with aspnetcompatibility requirement as enabled).

(3)Added the webscriptenabled to endpoint in web.config file.

(4)Hosted the wcf servie. 

(5)Downloaded the javascript file from the service.(e.g.,http://localhost/service1.svc/js)


(1)Opend new asp.net webapplication.

(2)Added the downloaded .js file.

(3)Given the scripts path for ajaxscript manager as both .js file and service url.


<asp:ScriptManager ID="id1"

Customizing the Converter for Json.NET


Many recently days, I thought about Json.net library that implemented by James. It is really a good library that I have ever used. I really impressed about many Converters that this library expose for user. I can list some converter of json.net at here:

+ BinaryConverter
+ BsonObjectIdConverter
+ DataSetConverter
+ DataTableConverter
+ EntityKeyMemberConverter
+ HtmlColorConverter
+ IsoDateTimeConverter
+ JavaScriptDateTimeConverter
+ KeyValuePairConverter
+ RegexConverter
+ StringEnumConverter
+ XmlNodeConverter

As you see, json.net have many converters, but still not enough for our necessary. So in this post, I try to explorer about 2 converters that I thought it is very useful for us. That are ArrayConverter and Object Converter (it is named by me). In 2 converter, I mainly implement it for return the object's interface, so it can be re-use and extension better. Now this is my code for implement it:
+ CustomObjectCreationConverter

    internal class 

make json call to send an email


the aspx:

<div class="contactSubmit">
                <asp:ImageButton ID="ibSubmit" runat="server" ValidationGroup="vgContact" /></div>


the jquery :

$(document).ready(function () {
            // Add the page method call as an onclick handler for the div.
            $(".contactSubmit").click(function () {
                    type: "POST",
                    url: "Home.aspx/GetDate",
                    data: "{}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (msg) {
                        // Replace the div's content with the page method's return.

The problem is that I need to use the text in a text box in my webmethod, and I can't because it's static, this results in a compilation error:

    public static string SendContactForm()


Implementation of Audit Fields and optimistic concurrency

What is the best way to implement Optimistic concurrency? Also, I have 4 audit columns in every table in my database. They are created date, updated date, created by, updated by. Application should populate these fields. I want to know how to populate created date , and updated date? From where application datetime or database datetime? On save button click, if I have to save data into 4 different tables, then I need to have same datetime in all 4 audit fields correct? What is the best way to implement this? What will be the design? Please let me know.  
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend