views:

441

answers:

1

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.

A: 

I think it's a bug with IE8 and the Ajax Control Toolkit in Update Panel. My Rating Control does not work in IE8 either

Mercatus3