Posting the code might help identifying the problem.
I am trying to add the same from the resource editor.... i am not trying to achieve the same dynamically
I am having trouble using the resource editor itself