开发者

Changing columns in display based on variable

I currently have a table with a repeater that is being filled with data

<table width="100%" >
  <tr>
    <td class="add_border_bold" nowrap>Title</a></td>
    <td class="add_border_bold" nowrap>User</td>
  </tr>
  <asp:Repeater id="program_list" OnItemDataBound="Repeater1_ItemDataBound" runat="server">
    <ItemTemplate>
      <tr>
        <td class="add_border">
          <a href="page.aspx?id=<%# Eval("id") %>"><%# Eval("short_title") %></a>&nbsp;
        </td>
        <td class="add_border">
          <%# Eval("userid") %>&nbsp;
        </td>
      </tr>
    </ItemTemplate>
  </asp:Repeater>
<开发者_如何学运维;/table>

I'm currently converting this from coldfusion. In the previous application, I had multiple table layouts for displaying different kinds of information, for example, phone number instead of userid. (although, working with a lot more columns, I shortened it for posting). In coldfusion I would just wrap each table in a <cfif> tag controlled by a variable that said which view to use. I am unaware how to get multiple data displays into a single page controlled by a variable, like I was before. Mostly because, it appears that most of my logic is done in the code behind files, so I don't understand how to get those changes across in the .aspx, or how to manipulate them from the code behind file.

Thanks in advance.


I would utilize a MultiView control and determine which view to show from code-behind.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜