注册 登录
编程论坛 ASP.NET技术论坛

为什么我删掉就出错误呢?新手问题本来是做ASP的现在来搞.NET

d778 发布于 2007-12-17 11:49, 1054 次点击
<asp:imagebutton id="AdvancedSearch_T" Runat="server" ImageUrl="/images/index/index_supserach_button.gif" AlternateText="aa"></asp:imagebutton>

这是一个 调用页的部分代码! 是一个图片按钮带一个联接!为什么我 删掉它就出现下面的错误提示!
我想把这个图片按钮改成文字的! 如

<a href="111.aspx">搜索</a>  也可以用这里面的连接  但是不懂哦!我是以前做ASP的但是 公司让我改.net真晕啦!看不懂,改了部分 这点难住了我!
先谢谢大家了!

下面错误:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   Project.Include.SearchEasy.InitializeComponent() +96
   Project.Include.SearchEasy.OnInit(EventArgs e) +27
   System.Web.UI.Control.InitRecursive(Control namingContainer) +321
   System.Web.UI.Control.InitRecursive(Control namingContainer) +198
   System.Web.UI.Control.InitRecursive(Control namingContainer) +198
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +692

 
5 回复
#2
huwei10242007-12-17 12:07
提示: 作者被禁止或删除 内容自动屏蔽,只有管理员可见
#3
d7782007-12-17 12:08
什么意思?
就是因为我不懂 我不会 我才来问!
不懂就问 很正常!
为什么你这个态度呢?
谁都一步一步来的

[[italic] 本帖最后由 d778 于 2007-12-17 12:12 编辑 [/italic]]
#4
冰彩虹2007-12-17 22:12
没听明白...
#5
yms1232007-12-19 16:17
楼主用的是.NET2003还是2005这个错误提示说发生System.NullReferenceException
空引用错误,也就是未将对象的引用设指导对象的实例错误。一般这种错误是声明了一个变量或对象,而没有实例化创建这个对象或初始化变量就要使用这个对象或变量,造成System.NullReferenceException
错误。
#6
菜鳥弎魛2007-12-19 17:24
可能是你调用问题
你看看你后台代码有没有调用这个IMGBUTTON,这种错误只有在对象未实例的情况下会报。
1