English 中文(简体)
我在这里错了些什么,以便我的表象:Repeater不工作?
原标题:What do I miss here so that my asp:Repeater does not work?

我有这一类:

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; }
    }
}

页: 1

    <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>

我以这种方式约束:

 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();

    }

我只剩下一个空页。

我是否误解了什么?

增 编

最佳回答

你错了。

visible="false"

第3行,“id=”fsetSummaryLeastCostOption”。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签