Your question is too vague to make any real sense or give a concrete answer. Normally when giving a reply function, the id of the post you are replying to is passed on the querystring if the "reply" option is a link;
reply.aspx?postid=123
or if it is a button then you can put the button in a form that has the id
<form action="reply.aspx" method="post">
<input type=hidden name=postid value="123"/>
<input type=submit value="Reply"/>
</form>
Or if it's done by ajax then you'll have some other mechanism to pass the id.