TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kavita Pharde
NA
44
79.2k
where to add rating changed in repeater control
Jun 29 2013 3:21 AM
i want to add rating control for articles but i am not sure where to add rating changed event in repeater control below is my code please help me
article.aspx:
<asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td class="Title articleLink">
<a href="Article.aspx?id=<%# Eval("ArticleId") %> &Caterory=<%# Eval("Category") %>">
<%# Eval("Title") %></a>
</td>
</tr>
<tr>
<td>
<%# Eval("Details") %>
</td>
</tr>
<tr>
<td class="name">
<%# Eval("AuthorName")%>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnLike" runat="server" Text="Like" CommandName="Like" CssClass="button" />
<asp:Button ID="btnComment" runat="server" Text="Comment" CommandName="Comment" CssClass="button" />
<asp:Button ID="btnShare" runat="server" Text="Share" CommandName="Share" CssClass="button" />
<asp:Label ID="lblPostDate" runat="server"><%# Eval("PostDate")%></asp:Label>
<br />
<asp:Panel ID="Panel1" Visible="false" runat="server">
<table>
<tr>
<td style="vertical-align: top">
Commnents :
</td>
<td>
<asp:TextBox ID="txtcomments" runat="server" Height="194px" Width="428px" MaxLength="500"
TextMode="MultiLine"></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="Button1" runat="server" CssClass="NormalButton" Text="Comment" />
<asp:Button ID="btncancel" runat="server" CssClass="NormalButton" Text="Cancel" />
</td>
</tr>
</table>
</asp:Panel>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Rating ID="Rating1" runat="server" EmptyStarCssClass="ratingEmpty" MaxRating="5"
FilledStarCssClass="ratingFilled" AutoPostBack="true" StarCssClass="ratingEmpty"
WaitingStarCssClass="ratingSaved" OnChanged="Rating1_Changed">
</asp:Rating>
</td>
</tr>
</table>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
article.aspx.cs:
protected void Rating1_Changed(object sender, AjaxControlToolkit.RatingEventArgs e)
{
SqlDataReader mdr;
mdr = (SqlDataReader)objGetArticles.AddRatingToArticle(Request.QueryString["id"].ToString(), Session["Pk_MemId"].ToString(), Rating1.CurrentRating, 2);
while (mdr.Read())
{
Rating1.CurrentRating = Convert.ToInt16(mdr["Rating"]);
}
mdr.Close();
Rating1.ReadOnly = true;
}
Reply
Answers (
1
)
how to remove bottom toolbar from html editor in asp.net
concatanation in datalist asp.net c#