Re: object reference not set to an instance of an object
From: Ken Dopierala Jr. (kdopierala2_at_wi.rr.com)
Date: 12/02/04
- Next message: Ian Suttle: "RE: Visual Studio question"
- Previous message: John M Deal: "Re: problem with default button pressed on ASPX page."
- In reply to: louise raisbeck: "RE: object reference not set to an instance of an object"
- Next in thread: Kevin Spencer: "Re: object reference not set to an instance of an object"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 2 Dec 2004 12:42:33 -0600
Hi,
Do you have the runat="server" tag in your btnEdit? Also, where and when
are you getting the error? Are you sure it happens on the
btnEdit.Attributes line? Also I would definitely switch your syntax to what
Kevin showed, that's how I've always done it. Try commenting out the
attributes line and do something else with the button. Like btnEdit.Visible
= True, if this gives you the same error then there is a problem with either
your button tag or your button declaration, if no error then we have
narrowed it down to how you are adding your attribute. Good luck! Ken.
-- Ken Dopierala Jr. For great ASP.Net web hosting try: http://www.webhost4life.com/default.asp?refid=Spinlight If you sign up under me and need help, email me. "louise raisbeck" <louiseraisbeck@discussions.microsoft.com> wrote in message news:3728851E-41F0-4369-81A1-6181B8FFA60D@microsoft.com... > yes i did actually try that syntax. same error message: > > System.NullReferenceException: Object reference not set to an instance of an > object > > "louise raisbeck" wrote: > > > hi there, > > > > I looked up posts on how to get a javascript confirm on the onclick of a > > button to determine whether to run server code and i wrote this on the page > > load.. > > > > string jsalert = "javascript:if(confirm ('Is the employee a rehire?') == > > false) return false"; > > btnEdit.Attributes["onclick"]=jsalert; > > > > however I'm getting the error message in my subject heading. what have i > > done wrong? when i start to write it i get intellisense so i know it > > recognises btnEdit.
- Next message: Ian Suttle: "RE: Visual Studio question"
- Previous message: John M Deal: "Re: problem with default button pressed on ASPX page."
- In reply to: louise raisbeck: "RE: object reference not set to an instance of an object"
- Next in thread: Kevin Spencer: "Re: object reference not set to an instance of an object"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|