method to display the controls in the GridView based on the values bound by the eval () function _ Practical Tips

Source: Internet
Author: User

Copy Code code as follows:

<asp:templatefield headertext= "Action" showheader= "False" >
<ItemTemplate>
<asp:linkbutton id= "btn_zhiding" runat= "Server" Commandname= "tranfer" commandargument= ' <% #Eval ("ARTICLE_ID") %> ' text= ' <% #Eval ("betop") = = "Top"? "Cancel the top": "Top"%> ' oncommand= "Rowcommand" ></asp:LinkButton>
<asp:placeholder id= "PlaceHolder1" runat= "visible=" <% #Eval ("betop") = = "Top"%> ' >
<asp:imagebutton id= "Imgbtn_orderup" runat= "Server" Imageurl= "~/pic/up. jpg" commandname= "OrderUp"
Commandargument= ' <% #Eval ("article_id")%> ' oncommand= ' Rowcommand '/>
<asp:imagebutton id= "Imgbtn_orderdown" runat= "Server" Imageurl= "~/pic/down. jpg" commandname= "Orderdown"
Commandargument= ' <% #Eval ("article_id")%> ' oncommand= ' Rowcommand '/>
</asp:PlaceHolder>
</ItemTemplate>

<itemstyle horizontalalign= "Center"/>
</asp:TemplateField>


Dynamically displays the controls in each row of the GridView, depending on the value of the binding.

With <asp:placeholder runat= "server" visible= ' <% #Eval ("betop") = = "Top"%> ' >

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.