ASP.NET 3.5 and above only

Poll - Templates - Item Templates

Favorite Movie
What is your favorite movie?
  • The Shawshank Redemption
  • The Godfather
  • Star Wars
  • Schindler's List
  • Pulp Fiction
Show Results
The items of the Poll can be customized using templates. You can embed any content inside an item template, including HTML markup and ASP.NET server controls (any control from the Obout suite may be added to a template).

In order to set up an item template, use the AnswerTemplate property of the Poll. When using item templates, the OnGetSelectedItem and OnSetSelectedItem events should also be employed for getting/setting the selected answer.
<%@ Register Assembly="Obout.Ajax.UI" Namespace="Obout.Ajax.UI.Poll" TagPrefix="obout" %>
<obout:Poll runat="server" ID="Poll1" DataSourceID="SqlDataSource1"
     Title="Favorite Movie" Question="What is your favorite movie?"
     AllowedVotesPerUser="1" OnGetSelectedItem="Poll1_GetSelectedItem"
        <img src="../resources/images/<%# Container.Item.Text %>.jpg" alt="" height="80" />
        <obout:OboutRadioButton ID="OboutRadioButton2" runat="server" Text='<%# Container.Item.Text %>'
         GroupName="PollItem" />
    <ResultStyle DisplayVotes="true" />
protected void Poll1_GetSelectedItem(object sender, PollAnswerEventArgs e)

protected void Poll1_SetSelectedItem(object sender, PollAnswerEventArgs e)

"The grid itself is excellent. I'm amazed by what you have accomplished with it. It has become the main control for our pages due to our customers responses to layouts with it."

Mark Butler
Achieve Technology

Random testimonial   All testimonials