|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Object reference not set to an instance of an object.WebControl button = (WebControl)Page.FindControl("btn_Delete");
button.Attributes.Add("onclick", "return confirmDelete (this.form);"); confirmDelete is the method written in Javascript. I am getting following error message as, Object reference not set to an instance of an object. Hy Kiran,
Are you sure that this control exists on the page? FindControl returns a null reference if it doesn't find the control. This seems to be your problem, that is the caus of your exception. Yvonne Kiran schrieb: Show quoteHide quote > WebControl button = (WebControl)Page.FindControl("btn_Delete"); > > button.Attributes.Add("onclick", "return confirmDelete (this.form);"); > > confirmDelete is the method written in Javascript. > > > I am getting following error message as, > > Object reference not set to an instance of an object. Maybe just set the OnClientClick property of the button instead of
going to the trouble of trying to find it.
Login control - image button with text over it
how to get selectedvalue of radiobuttonlist in Javascript? looping through formview controls List Box : help preventing duplicate items Searching for a powerfull calendar addon GridView EnableSortingAndPagingCallBacks Select command. User Control used in Repeater, but no output Accessing USER CONTROL which is inside Masterpage through Another USER Control inside normal page. Use CSS in themes Session sharing between ASP and ASP.NET |
|||||||||||||||||||||||