수색…
통사론
- ItemTemplate : 목록 내의 항목의 내용과 레이아웃을 구성 합니다 . 필수 항목입니다. 필수 항목입니다.
- AlternatingItemTemplate : 언급 된 경우 대체 항목의 내용과 레이아웃을 결정합니다. 언급되지 않은 경우 ItemTemplate이 사용됩니다.
- SeparatorTemplate : 언급 된 경우 항목간에 항목이 렌더링됩니다. 언급되지 않은 경우 구분 기호는 렌더링되지 않습니다.
- SelectedItemTemplate : 언급 된 경우 선택한 항목의 내용과 레이아웃을 결정합니다. 언급되지 않은 경우 ItemTemplate (AlternatingItemTemplate)이 사용됩니다.
- EditItemTemplate : 언급 된 경우 편집중인 항목의 내용과 레이아웃을 결정합니다. 언급되지 않은 경우 ItemTemplate (AlternatingItemTemplate, SelectedItemTemplate)이 사용됩니다.
- HeaderTemplate : 언급 된 경우 목록 헤더의 내용과 레이아웃을 결정합니다. 언급되지 않은 경우 헤더가 렌더링되지 않습니다.
- FooterTemplate : 언급 된 경우 목록 바닥 글의 내용과 레이아웃을 결정합니다. 언급되지 않은 경우 바닥 글은 렌더링되지 않습니다.
asp.net에서 데이터 바인딩
Aspx
<asp:DataList runat="server" CssClass="sample" RepeatLayout="Flow" ID="dlsamplecontent" RepeatDirection="Vertical" OnItemCommand="dlsamplecontent_ItemCommand">
       <ItemStyle CssClass="tdContainer" />
           <ItemTemplate>
             //you code 
                    </ItemTemplate>
                </asp:DataList>
Aspx.cs
public void GetSamplingContentType()
    {
        try
        {
            ErrorLogger.gstrClientMethodName = this.GetType().FullName + "_" + System.Reflection.MethodBase.GetCurrentMethod().Name + " : ";
         DataTable dt = new DataTable();
            dlsamplecontent.DataSource = dt;
            dlsamplecontent.DataBind();
        }
        catch (Exception ex)
        {
            ErrorLogger.ClientErrorLogger(ex);
        }
    }
항목 인수 및 명령 인수를 사용하여 ID 검색
 protected void dlsamplecontent_ItemCommand(object source, DataListCommandEventArgs e)
    {
        try
        {
            int BlogId = Convert.ToInt32(e.CommandArgument.ToString());
            if (e.CommandName == "SampleName")
            {
               //your code 
            }
        }
        catch (Exception ex)
        {
            ErrorLogger.ClientErrorLogger(ex);
        }
    }
Modified text is an extract of the original Stack Overflow Documentation
        아래 라이선스 CC BY-SA 3.0
        와 제휴하지 않음 Stack Overflow