ASP. NET development internship Day 1

Source: Internet
Author: User

Although I learned this language when I was in my sophomore year, it was useless for a long time. It was easy to design the course. Now I am in the internship unit. I have to start from scratch. The following are basic things. Let's take a look ....

1. <asp: TemplateField HeaderText = "itinerary" ItemStyle-Width = "80px" ItemStyle-HorizontalAlign = "Left"> <ItemTemplate> <asp: hyperLink ID = "Routing" runat = "server" Target = "_ blank" Enabled = '<% # Convert. toBoolean (Eval ("IsLockedPartyInfo "). toString () = "empty "? "False": Eval ("IsLockedPartyInfo "). toString () = false %> 'text = '<% # Eval ("PartyPlanJourney") %> 'navigateurl =' <% # "Routing. aspx? Id = "+ Eval (" ID ") +" "%> '> </asp: HyperLink> </ItemTemplate>

 


This section is about binding a hyperlink. However. I do not understand <% # Convert. ToBoolean (Eval ("IsLockedPartyInfo"). ToString () = "empty "? "False": Eval ("IsLockedPartyInfo"). ToString () = false %. So we have the following explanation.

 


<% # Eval ("Id ","~ /Search. aspx? Id = {0} ") %> This is the format of the bound data

For example, <% # Eval ("Id", "{0}") %>, the previous id indicates the id field or alias in the database, the following {0} indicates that the first parameter is output. The first parameter here is the id

Therefore, <% # Eval ("Id ","~ /Search. aspx? Id = {0} ") %> the output is ~ /Search. aspx? Id = 120. Here, 120 is the output format of {0 }.

 

 

This is the data binding format. {0} indicates the first data in the array. The first one here is id. Eval is the data value obtained from the database from the bound data source, and id is the data table field you obtained.

Example <% # Eval ("Id, Name ","~ /Search. aspx? Id = {0} & name = {1} ") %> here, 1 is the name value read by the database. Of course, name is random, this field is required in your data column. The sequence of the array starts from 0, so 0 represents what we think 1.

 

 


 

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.