I'm attempting to use the AJAX Control Toolkit's Rating control in a DataBinding scenario.
I have a ReuseRating column in my database that is a tinyint. It can hold values 1 through 5. Every record in the table has the value set to 1 currently.
If I do this in my ItemTemplate everything works fine. I get 1 star filled in on my rating control.
<act:Rating ID="ReuseRatingRating" runat="server"
CurrentRating='<%# Convert.ToInt16(Eval("ReuseRating")) %>'
MaxRating="5"
StarCssClass="ratingStar"
WaitingStarCssClass="savedRatingStar"
FilledStarCssClass="filledRatingStar"
EmptyStarCssClass="emptyRatingStar" />
Now I want to DataBind this in my EditTemplate like so.
<act:Rating ID="ReuseRatingRating" runat="server"
CurrentRating='<%# Convert.ToInt16(Bind("ReuseRating")) %>'
MaxRating="5"
StarCssClass="ratingStar"
WaitingStarCssClass="savedRatingStar"
FilledStarCssClass="filledRatingStar"
EmptyStarCssClass="emptyRatingStar" />
Note, that I changed my Eval to a Bind in the CurrentRating property. This throws the following error.
CS0103: The name 'Bind' does not exist in the current context
Can anyone help me out on this one? I've been knocking my head against the wall for a couple of hours now.