gridview template function not called

R

russganz

I have a gridview that displays user ratings as 'stars' from a jpg
file. The template field is defined as

<asp:TemplateField HeaderText="User Rating">
<ItemTemplate>
<img src='<%# ProductRatingURL(Container.dataitem)
%>' />
</ItemTemplate>
</asp:TemplateField>

The list of records to display is based upon what the user enters in
the criteria fields of the page. I then dynamically change the values
of the sql data source parameters and then rebind the data source and
the grid view.

The first time I run the page the function ProdRatingURL is called and
all the rows have the proper jpg corresponding to the avg user rating.
However, if I enter other search criteria and press the submit button a
second time, the correct records are displayed on the gridview but the
template column is blank because the ProductRatingURL function is not
called.

I can't figure out why the function does not get called since the
gridview has been refresh. The only thing I could think of was that
something gets catched and the function does not get called but why
does no image show up in this column.

Thanks

Russ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top