The Product Review User Control

Because the product review functionality could be viewed from multiple places in the site, it made sense to encapsulate the functionality in a reusable fashion. For this reason, we created the ProductReview.ascx user control.

The product review user control is made up of a user interface piece and a code behind class. The user interface portion is called ProductReview.ascx, and the code behind class is called ProductReview.ascx.cs.

ProductReview.ascx controls the basic layout, user interface, of the control. It displays each review and its associated rating. The code for this control is shown in Listing 10.4.

Listing 10.4. The ProductReview.ascx User Control
 <%@ Control Language="c#" AutoEventWireup="false" src="ProductReview.ascx.cs" ...

Get Building e-Commerce Sites with the .NET Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.