Click here to Skip to main content
15,167,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to make a comment page. i have stored comments in database, it is getting stored but my asp:repeater is not updating after postback. please help.
this is my code:

XML
<tr>
<asp:Repeater ID="repeater1" runat="server" DataSourceID="SqlDataSource1" >
<ItemTemplate>
<tr>
    <td>
        <%# Eval("Comment") %>
        <br />
    </td>


    <td align="right"> By: <%# Eval("UserName") %>
    <br />
    </td>
</tr>
</ItemTemplate>
</asp:Repeater>

</tr>
<tr>
<td><asp:TextBox ID="txtComment" runat="server" Height="110px" MaxLength="35565"
        Width="752px" TextMode="MultiLine"></asp:TextBox></td>
</tr>
<tr>
    <td align="right">
    <asp:Button ID="btnPost" runat="server" Text="Post" Visible="false"
            onclick="btnPost_Click" />
    &nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="btnCmmnt" runat="server" Text="Comment" onclick="btnCmmnt_Click"/>

    </td>
</tr>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:WebCommentConnectionString %>"
        SelectCommand="SELECT * FROM [Comment] where [Post_ID]=12"></asp:SqlDataSource>
</table>
Posted
Comments
ZurdoDev 1-May-13 14:55pm
   
What do you mean it is not updating?

Can you include the btnCmmnt_Click event, so we can see what's going on with your code?
   
i found solution. i just needed to refresh the page after storing comment into database. thank you.
   
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month



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