i want set class for repeater when doPostBack for those dataID i wan but dun noe can/cannot?
below code is just for example showing:
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server" EnablePageMethods="true" />
<asp:UpdatePanel ID="UpdatePanel2" runat="server" >
<ContentTemplate>
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="dsInbox">
<ItemTemplate>
<tr id="trInbox">
<td width="370px" height="25px"><div align="left" class="style95"> <%# DisplaySubject(Eval("inbSubject").ToString(), Eval("inbMsg").ToString())%></div></td>
<td width="80px" height="25px"><div align="left" class="style95"> <%# Eval("inbCreatedAt","{0:MM-dd-yyyy}") %></div></td>
<td width="94px" height="25px"><div align="left" class="style95"> <%# Eval("DataId") %></div></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
in behind Code C# i can create the class/style i wan
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
Repeater1.DataBind();
//find the data row ID and set class/style when loaded
}
}
If you are wanting to set a class per each row bound, and need the data ID, then your best approach is to handle it as each row is bound:
and in code-behind: