Twitter and Facebook

Has anyone created a dynamic Twitter add and Facebook like buttons with aspx? I have been experimenting with a bit of code but I think I am going wrong somewhere. My content loads dynamically using StoryID=. I would like to add to the template so each dynamic page has the associated buttons to the StoryID=.