“为什么我的DropDownList在页面生命周期的这一点上为空?

时间:2015-05-25 07:19:09

标签: c# asp.net

我收到此错误

  

对象引用未设置为对象的实例

在这一行。

this.ddlUtilityName.DataSource = PurLogicEntities.BLL.Rates.SelectAllUtilityType();

in aspx page the following control.
 <asp:DropDownList ID="ddlUtilityName" AppendDataBoundItems="true" runat="server" class="form-control">
<asp:ListItem Text="Please Select" Value="0" />
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlUtilityName"ErrorMessage="Utility Type is required." Display="Dynamic" InitialValue="0"></asp:RequiredFieldValidator>

0 个答案:

没有答案