During project development, ASP. NET repeater controls are often used to add sequence columns, which may not be available for some new users. If you need them, you can refer
ASP. NET repeater
1. <itemtemplate>
<Tr> <td>
<% # Container. ItemIndex + 1%>
</Td> </tr>
</Itemtemplate>
2. <itemtemplate>
<Tr> <td>
<% # This. rpResult. Items. Count + 1%>
</Td> </tr>
</Itemtemplate>
3. Add <Label ID = "dd"> </Label> in <form> </form>
<Body nload = "show ()">
<Script. Language = "JScript">
Function show ()
{
Var bj = document. all. tags ("LABEL ");
For (I = 0; I <obj. length; I ++)
{
Document. all ["dd"] [I]. innerHTML = I + 1;
}
}
</Script>
4. Background implementation:
Add <asp: Label id = "Label1" Runat = "server"> </asp: Label> in. aspx
Add in. cs
** Void InitializeComponent ()
{
This. Repeater1.ItemDataBound + = new System. Web. UI. WebControls. RepeaterItemEventHandler (this. repeaterincluitemdatabound );
This. Load + = new System. EventHandler (this. Page_Load );
}
** Void repeaterincluitemdatabound (object source, System. Web. UI. WebControls. RepeaterItemEventArgs e)
{
If (e. Item. ItemType = ListItemType. Item | e. Item. ItemType = ListItemType. AlternatingItem)
{
(Label) e. Item. FindControl ("Label1"). Text = Convert. ToString (e. Item. ItemIndex + 1 );
}
}
Add html according to conditions
<% # Container. ItemIndex = 8? "<Br> <a href = 'HTTP: // www.ginchan.com.tw/'target = '_ blank'> </a> ":" "%>