|
下面的代码,很简单,在代码实例后面加了一段,就会出现 "未将对象引用设置到对象的实例。",真没有办法解决了
如果这个问题解决不了,我现在在做的项目只能更换别的控件了!!!多谢高人指点.
我在做的项目,页面全部弄好了,在写代码的时候发现此问题的,花了一个月时间布局页面,最后且碰到了这样的问题.很多页面都出现了这样的问题.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="FA_Base_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<extageManager ID="ageManager1" runat="server" />
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:Button ID="Button1" runat="server" Text="Button">
</ext:Button>
<ext:Button ID="Button2" runat="server" Text="Button">
</ext:Button>
<ext:Button ID="Button3" runat="server" Text="Button">
</ext:Button>
<ext:Button ID="Button4" runat="server" Text="Button" >
</ext:Button>
</Items>
</ext:Toolbar>
<ext:SimpleForm ID="SimpleForm1" BodyPadding="5px" LabelAlign="Right" Title="表单" runat="server">
<Items>
<extanel ID="anel2" ShowHeader="false" CssClass="x-form-item" ShowBorder="false"
Layout="Column" runat="server">
<Items>
<extabel ID="Label2" Width="80px" runat="server" CssClass="inline" ShowLabel="false"
Text="用户名:">
</extabel>
<ext:TextBox ID="TextBox2" Label="用户名" CssClass="mright" Required="true" runat="server">
</ext:TextBox>
<ext:Button ID="Button5" Text="按钮一" CssClass="mright" runat="server">
</ext:Button>
<ext:Button ID="Button6" Text="按钮二" runat="server">
</ext:Button>
</Items>
</extanel>
<extanel ID="anel1" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="x-form-item datecontainer"
runat="server">
<Items>
<extabel ID="Label1" runat="server" Width="80px" CssClass="inline" ShowLabel="false"
Text="起始时间:">
</extabel>
<extatePicker ID="DatePicker1" Width="150px" runat="server">
</extatePicker>
<extatePicker ID="DatePicker2" Width="150px" runat="server">
</extatePicker>
</Items>
</extanel>
<extanel ID="anel3" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="x-form-item datecontainer"
runat="server">
<Items>
<extabel ID="Label3" runat="server" Width="80px" CssClass="inline" ShowLabel="false"
Text="起始时间:">
</extabel>
<extatePicker ID="DatePicker3" ColumnWidth="50%" runat="server">
</extatePicker>
<extatePicker ID="DatePicker4" ColumnWidth="50%" runat="server">
</extatePicker>
</Items>
</extanel>
<extanel ID="anel4" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="x-form-item datecontainer"
runat="server">
<Items>
<extabel ID="Label4" runat="server" Width="80px" CssClass="inline" ShowLabel="false"
Text="工作时间:">
</extabel>
<ext:TextBox ID="TextBox1" Width="40px" runat="server">
</ext:TextBox>
<extabel ID="Label111" runat="server" Text=" 小时 "> </extabel>
<ext:TextBox Width="40px" ID="TextBox222" runat="server">
</ext:TextBox>
<ext:Label ID="Label5" runat="server" Text=" 分钟">
</ext:Label>
</Items>
</extanel>
<extanel ID="anel5" runat="server" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="x-form-item datecontainer">
<Items>
<ext:Label ID="Label6" runat="server" Width="80px" CssClass="inline" Text=" 规格型号:"> </ext:Label>
<ext:TextBox ID="txtGG" runat="server"> </ext:TextBox>
<ext:Label ID="Label9" runat="server" CssClass="inline" Text=" 计量单位:"> </ext:Label>
<extropDownList ID="dpDW" Width="134px" runat="server" Label="Label">
</extropDownList>
<ext:Label ID="Label10" runat="server" Text=" 数量:"> </ext:Label>
<ext:NumberBox ID="NumberBox1" runat="server" Label="Label" ></ext:NumberBox>--%>
</Items>
</ext:Panel>
</Items>
</ext:SimpleForm>
</form>
</body>
</html>
未将对象引用设置到对象的实例。 说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。
源错误:
执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。 |
堆栈跟踪:
[NullReferenceException: 未将对象引用设置到对象的实例。] ExtAspNet.ControlBase.RecoverPropertiesFromJObject(JObject state) +660 ExtAspNet.ControlBase.OnInit(EventArgs e) +105 System.Web.UI.Control.InitRecursive(Control namingContainer) +140 System.Web.UI.Control.InitRecursive(Control namingContainer) +311 System.Web.UI.Control.InitRecursive(Control namingContainer) +311 System.Web.UI.Control.InitRecursive(Control namingContainer) +311 System.Web.UI.Control.InitRecursive(Control namingContainer) +311 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +480 |
版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.272
|
|