ASP. NET C # eval about front-end bindings

Source: Internet
Author: User

Long time no use of ASP. NET do Web site, today encountered a small problem, is about to bind data in the front page, with some judgment, a moment forgot how to write

1<bll:templatefield headertext="Stream Input Mode"sortexpression="Channel.streaminputmode"Isoptional="true"defaultsortdirection="Descending">2<ItemTemplate>3<%--<%# (int) Eval ("Channel.streaminputmode")==1?"Multicast":"AV Network"%>--%>4<%# Streamname ((int) Eval ("Channel.streaminputmode"))%>5</ItemTemplate>6                            7</bll:TemplateField>

Code in the background:

1       Public stringStreamname (inttemp)2         {3             if(temp==1)4             {5                 return "Multicast";6             }7             Else if(temp = =2)8             {9                 return "AV Network";Ten             } One             Else A             { -                 return "Network Flow"; -             } the}

is to write a method in the background, put in the foreground call on the line.

  

ASP. NET C # eval about front-end bindings

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.