Click here to Skip to main content
15,911,132 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to get the ID of the posted answer when the user post a comment for a particular answer just like posting comments on stackoverflow or codeproject sites. Assume that there is a Datalist and it is displaying 3 answers for a particular question and each answer is having a comment button.

What I have tried:

Tried to figure it out but could not get it......
Posted
Updated 15-Apr-16 1:13am
Comments
Karthik_Mahalingam 15-Apr-16 7:12am    
what is the purpose,
using developer tools you can get the id ?
but y?

1 solution

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

HTML
<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.
 
Share this answer
 
Comments
AP900 15-Apr-16 7:33am    
But both answer and its comments are on same page. Can it use DataKey of datalist to store id?
F-ES Sitecore 15-Apr-16 7:37am    
Like I said, it depends on how you're implementing the "reply" link. We can't give a concrete answer with no specifics about implementation.
AP900 15-Apr-16 7:34am    
Thanks in advance

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900