Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

VS 2005 (C#): Adding hyperlink to radio button list item

Aug 15, 2007 4:16AM PDT

Using C# in .NET 2.0 (Visual Studio 2005). I have a radio button list of cell phone models. Within this list I have hyperlinks to images of the phones and of the ESNs (serial numbers) of the phones to help the users identify which phone they have. My ListItem code looks like this:

<asp:ListItem Value="Sprint Kyocera">Sprint Kyocera <a href="images/Sprint_Kyocera.jpg" target="_blank">(image of phone)</a> <a href="images/Sprint_Kyocera_ESN.jpg" target="_blank"> (image of ESN)</a></asp:ListItem>

When i build my project I get a validation error saying "Error 1 Validation (Internet Explorer 6): The element 'a' cannot be nested within the element 'listitem'."

The page still loads and works just fine but I have to rebuild that section of code every time I go back into the designer because of this error.

I need to have the hyperlinks next to the text for each phone model name. How can I do this properly?

Discussion is locked