only My site

Tuesday, August 30, 2011

JSON & .NET

using System.Web.Script;

Employee oEmployee1 = new Employee { Name = "Pini", ID = "111", Age = "30" };
Employee oEmployee2 = new Employee { Name = "Yaniv", ID = "Cohen", Age = "31" };
Employee oEmployee3 = new Employee { Name = "Yoni", ID = "Biton", Age = "20" };

List oList = new List() { oEmployee1, oEmployee2, oEmployee3 };

Serialization.JavaScriptSerializer serializer = new Serialization.JavaScriptSerializer();

string jsonString = serializer.Serialize(oList);
List oListNew = new List();

oListNew = serializer.Deserialize>(jsonString);
//ser.Deserialize(new StreamReader(response.GetResponseStream()).ReadToEnd());

Saturday, August 20, 2011

Thought of the day

There are two forces in the world. one is to keep them top and make others suppress. these force will not recognize and accept the other one. This makes the world unbalanced and this is the cause for the instability in the universe. One have more than they required, and others don't have the basic needs...If you watch the world politics this situation is common across the world.

Oh God! Make the world better place to live in.

Tuesday, August 16, 2011

JQuery - Found Solution for Nested Droppable items

http://www.designerstalk.com/forums/programming/64268-jquery-droppable-div-created-fly-not-working.html#post777326


$(".myDropClass").droppable(
{
accept: '.myDragClass',
drop: function (event, ui) {
//remove old item
alert('Dropped');
$(this).find(".myDragClassPlaceHolder").remove();

var listHtml = "
  • " +
    "
    " +
    "New Droppable area" + ui.draggable.text() + "
  • ";
    alert('Added1');
    $(this).append(listHtml);
    alert('Added');
    $(this).find('#ontheflyDiv').droppable({
    drop: function(event, ui)
    {
    alert('Set the droppable behavior to the newly created element');
    $(this).append("hello");

    }
    });

    }
    });