If (E. Item. itemtype = listitemtype. Item) | (E. Item. itemtype = listitemtype. alternatingitem ))
{
Linkbutton lbnupdate = (linkbutton) E. Item. findcontrol ("lbnupdate ");
Linkbutton lbndel = (linkbutton) E. Item. findcontrol ("lbndel ");
Lbnupdate. Visible = false;
Lbndel. Visible = false;
If (session ["username"]! = NULL)
{
If (session ["flag"]. tostring () = "admin ")
{
Lbnupdate. Visible = true;
Lbndel. Visible = true;
}
}
}
They are item types. Of course, the listitemtype enumeration is not the two. There are many more. Use
If (E. Item. itemtype = listitemtype. Item | E. Item. itemtype = listitemtype. alternatingitem)
Because,ProgramThe requirement itself should be like this. This is the logic of People's programs. so you can't just judge E. item. itemtype = listitemtype. item E. item. itemtype can be used to determine which row is currently bound. It is an enumeration E. item. itemtype can be used to determine which row is currently bound. It is an enumeration
PS: that is to say, to compare the types of the options to all types, execute the following in the type:Code