Tuesday, September 23, 2008

This occures after copy&paste action - strange isn't it huh?

Posted by: Eran Nachum (c)
Post Date: 9/23/2008 2:50:28 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Sunday, September 14, 2008

Check this out - http://java.dzone.com/videos/video-hug-a-developer-today

So sad and true...

Funny | Life
Posted by: Eran Nachum (c)
Post Date: 9/14/2008 3:10:15 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Wednesday, September 10, 2008

I am building these days another WCF service in order to perfom some actions, but the different between this WCF than others is that I have a base class that implements and describes common peroperties fro the derived classes, because I want to perfom actions generically.

Now, when I called the service method and sending the generic base class (that 'holds' the explicit class type of course) I bimped into a CommunicationException that claimed that the service failed to serialize thet the specific parameter that has been sent.

The solution for this failure is to add KnownType attribute above the base entity in order to specify types that should be recognized by the DataContractSerializer when serializing or deserializing a given type.

Some code snippet:

[DataContract]
[KnownType(typeof(User))]
public abstract class Entity
{
   [DataMember(IsRequired = true)]
   public int Id { get; set; }

   [DataMember(IsRequired = true)]
   public string Name { get; set; }

   public Entity() { }
}

[DataContract]
public class User : Entity
{
   [DataMember(IsRequired = true)]
   public List<string> PossibleActions { get; set; }
}

This should solve the problem in the definition of KnownType in the base class. Now you can call your service method using non excplicit type (Entity) smoothly.

WCF
Posted by: Eran Nachum (c)
Post Date: 9/10/2008 9:50:55 AM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Wednesday, June 18, 2008

Long time no written.... I know - have lot of work on my head, on daily work, on allrise.com, on other things that on my mind - but I love it, I love to be busy, the disadvantage of it is the fact that the when you're busy the time runs too fast (mmm.. maybe I'll post a claim about it on allrise.com site).

I bumped into a great post (sent to me by my allrise.com co-founder - Erez Eden) which outlines some great tools to help you develop fatser web pages (I sure of it that you already know some of them, if not - you may take a look and discover it).

You can find it here.

Promise to post some more, I have great materials to share with you.. on the meanwhile bye bye!

Posted by: Eran Nachum (c)
Post Date: 6/18/2008 12:47:23 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Sunday, May 11, 2008

Congratulations to us!!!

I am (very) excited - I admit it; AllRise.com has been selected as one of the 10 finalist projects to be presented in Startup 2.0 in Barcelona.

As AllRise.com co-founder and CTO, this event and accomplishment is one of a kind, we actually did it after hard work which just started again...

Some information about the competition:

StartUp2.0 is a competition of European web 2.0 sites whose objectives are to promote and reward the European startups (either created or willing to do so in the future) that work in the field of 2.0 technologies.

The number of projects (brands) that were participated in the first election was 174, and only 10 of them (were selected by the jury and bloggers) (which include us) are going to present in the competition itself.

The competition will be set at on May, 21th, wish us good luck!

The official startup 2.0 site is here.

Posted by: Eran Nachum (c)
Post Date: 5/11/2008 3:15:46 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #
 Wednesday, May 07, 2008

I faced a 'problem' while needed to add a postback event to the server while generating client code from the server on runtime.

You could think about a way of creating server control in the code behind and attaching it an event to its OnClick (or other event), but this one is good enough only to server controls that knows to do postback.

What will you do if you'll want to add postback event to a generic client control such as html-table-cell of other client controls that doesn't need to contact the server beside the postback event?

The GetPostBackEventReference method of the Page object's ClientScript property supports this action and let you perform this action. By MSDN property summary, this one "Returns a string that can be used in a client event to cause postback to the server. The reference string is defined by the specified control that handles the postback and a string argument of additional event information".

// ...

TableCell tc = new TableCell();
// Add some attributes or styling...
tc.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(this, <argument>));

// Do you stuff (add the cell to the table) etc.

Posted by: Eran Nachum (c)
Post Date: 5/7/2008 3:40:56 PM (Jerusalem Standard Time, UTC+02:00)
Disclaimer | | Trackback   #