Alex Rivera | Logout

"The server tag is not well formed." What's wrong?

Asked 2010-11-12T06:07:51.290
9

I get the following parser error message. How can I fix this problem?

The server tag is not well formed.

Code:

<a href="#" class="mySprite id<%# ((int)DataBinder.Eval(Container,"ItemIndex")) % 6 + 1%>">
Edit
Report

1 Answer

14

First of all, your anchor is client side, you should add an attribute of runat="server" to this. Second, try using it like following.

<a href="#" runat="server" id="mySprite1" 
class='<%# "mySprite id" + ((int)DataBinder.Eval(Container,"ItemIndex")) % 6 + 1 %>'>
answered 2010-11-12T06:33:55.980

Your Answer