인 경우 gridview가 있습니다. 데이터 소스는 데이터베이스에서로드 된 데이터 테이블입니다. 이 gridview에는 템플릿 열이 있습니다.Gridview 열 디자인의 조건이
<asp:TemplateField HeaderText="Product Type" SortExpression="ProductID">
<ItemStyle CssClass="MP-table-tb-display-item" />
<ItemTemplate>
<div class="MP-table-tb-display-main">
<asp:LinkButton ID="lnkview" CommandArgument='<%# Eval("ProductID") %>' CommandName="Viewproduct"
runat="server" CausesValidation="False" OnClick="lnkview_Click"><h4>
<%# Eval("Name") %>
</h4>
</asp:LinkButton>
</div>
<br />
<div class="MP-table-tb-display">
<p>
<span>KEY</span><%# Eval("[product_type_key]") %></p>
<br />
<a target="_blank" href='<%# Eval("SourceURL") %>'>Source</a>
</div>
</ItemTemplate>
</asp:TemplateField>
소스 내 하이퍼 링크는 <%# Eval("SourceURL") %>
에 데이터를 사용할 수있는 경우에만 표시합니다. SourceURL 값을 RowDatabound Event
으로 가져올 수없는 경우 나를 안내 해줘.
이 계획도 있지만 제대로 작동하지 않습니다.
<a target="_blank" href=' <%= Eval("SourceURL")!=null ? Eval("SourceURL") : "style='display: none'" %> />'> Source</a>