Link to home
Start Free TrialLog in
Avatar of scm0sml
scm0sml

asked on

using repeater data for a texbox attribute

Hi,

I have a textbox within a repeater:
<asp:TextBox ID="txtActionStartDate" CssClass="actionStartDate<%#DataBinder.Eval(Container.DataItem, 'ID')%>" runat="server"></asp:TextBox>

Open in new window


As you can see I am trying to set a css class containing a dynamic value.

I'm getting:
The server tag is not well formed.

How can I do this?
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Try this
<asp:TextBox ID="txtActionStartDate" CssClass="actionStartDate<%=DataBinder.Eval(Container.DataItem, 'ID')%>" runat="server"></asp:TextBox>

Open in new window

Avatar of scm0sml
scm0sml

ASKER

thats actually rendering the code as text:
 class="actionStartDate<%=DataBinder.Eval(Container.DataItem, 'ID')%>" type="text"
ASKER CERTIFIED SOLUTION
Avatar of scm0sml
scm0sml

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scm0sml

ASKER

got my own solution in the end.