<%var i=1;%>
<%foreach (var commentitem in item.commentsModelList)
{
<table border="0" class="commentbox">
<tr>
<td>
<%: Html.DisplayFor(modelItem => commentitem.CommentClob)%>
</td>
</tr>
<tr>
<%var rid = "reply" + i;%>
<td> <input id="<%:rid %>" type="button" value="reply"/>
</td>
<td>
<%--addded--%>
<div id="<%:rboxid %>">
<input id="Text1" type="text" />
<input id="postreply" type="button" value="postreply" />
</div>
</td>
</tr>
</table>
<% i++;}%>
I have the following query
1.
I want to display alert boxes when different hyperlink with different reply id is clicked.
Edited
2.
i want a to hide these div on page load and show div with id replybox1 when link with id reply1 is clicked and same for other divs
3.Is there any way to create div dymaically and performing the same functionality
To get an alert of the id when clicking on the input button, you can use this script. ( Assuming you have jQuery available in your page)
As Hasan already mentioned. you should probably use the
comentItemIdinstead of using theivariableEDIT As per the update in question, This script will hide all divs in the page load and show only those div with id
replybox1when input withreply1being clicked.