开发者

What do I miss here so that my asp:Repeater does not work?

开发者 https://www.devze.com 2023-01-04 19:22 出处:网络
I have this class: public class RateResultsSummary { public RateResultsSummary(string labelText, string dataText)

I have this class:

public class RateResultsSummary
{
    public RateResultsSummary(string labelText, string dataText)
    {
        LabelText = labelText;
        DataText = dataText;
    }

    private string _labelText;
    public string LabelText
    {
        get { return _labelText; }
        set { _labelText = value; }
    }

    private string _dataText;
    public string DataText
    {
        get { return _dataText; }
        set { _dataText = value; }
    }
}

My .aspx page contains:

    <body>
        <form id="form1" runat="server">
        <div>
        <fieldset id="fsetSummaryLeastCostOption" runat="server" style="width: 200px;" visible="false">
        <legend>SUMMARY LEAST COST OPTION</legend>
        <asp:Repeater ID="repSummary" runat="server">
            <ItemTemplate>
             <asp:Label ID="lblLabel" runat="server"  
              Text='<%# ((RateResultsSummary)Container.DataItem).LabelText %>'></asp:Label>
            <asp:Label ID="lblData" runat="server"  
Text='<%# ((RateResultsSummary)Container.DataItem).DataText %>'></asp:Label>
           开发者_开发知识库      <asp:Label ID="lbl" runat="server" Text="Some static text"></asp:Label>
            <br />
            </ItemTemplate>
        </asp:Repeater>
    </fieldset>
        </div>
        </form>
    </body>

And I bind it in such a way:

 protected void Page_Load(object sender, EventArgs e)
    {

        List<RateResultsSummary> lstRateResultDataSource = new List<RateResultsSummary>();
        lstRateResultDataSource.Add(new RateResultsSummary("Carrier: ", "Xxx"));
        lstRateResultDataSource.Add(new RateResultsSummary("Mode: ", "Yyyy"));
        lstRateResultDataSource.Add(new RateResultsSummary("Service: ", "Zzz"));
        lstRateResultDataSource.Add(new RateResultsSummary("Transit: ", "Ccccc"));
        lstRateResultDataSource.Add(new RateResultsSummary("Total Cost: ", "Kkkkk"));

        repSummary.DataSource = lstRateResultDataSource;
        repSummary.DataBind();

    }

And I get an empty page only.

Do I miss something?

Thanks


You miss the

visible="false"

in third line on ...fieldset id="fsetSummaryLeastCostOption"...

0

精彩评论

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