Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
hi am getting error in this line..can anyone tell me wat type of error that i can solve this..?am using dynamic in my project.
protected void Page_Init(object sender, EventArgs e)
    {
      objDyn.GenerateTabControls("FM_FactoryMaster", out dynDiv, out gListDynamicControls, true, false, false);
 
}
thanks
Posted 14-May-12 23:59pm
ythisbug2.1K
Edited 15-May-12 1:49am
Wes Aday94.3K
v3
Comments
sjelen at 15-May-12 12:37pm
   
objDyn is probably null. What is it? A control? Some custom class? Where do you initialize it?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Take a look here[^]
  Permalink  
Comments
VJ Reddy at 16-May-12 10:43am
   
Useful reference for common questions. 5!
losmac at 16-May-12 10:56am
   
Thank you, VJ ;)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

This error happens when you try to use a property or call a method of an object that is null. More details: here[^]

A simple use of Visual studio DEBUGGER can tell you the object because of which it is happening. Just look at the stack trace and put a debugger on that line. Check the objects of that line and see if any one is null and you are trying to use that objects property. Handle the same.
 
Above, looks like objDyn is NULL or one of the parameters passed assuming error is not raised in GenerateTabControls method.
  Permalink  
v3
Comments
ythisbug at 15-May-12 5:29am
   
gListDynamicControls this value is showing 0..
ythisbug at 15-May-12 5:31am
   
and in objDyna dt=null and dr also null..wat it means.so wat changes have to do??u have any idea..
Sandeep Mewara at 15-May-12 11:50am
   
What do you mean by 'coming null', have not these implemented/defined/written by you?
 
As Bernhard said, out params can be null. Step through and check the line where it bombs. Use F11.
Technoses at 15-May-12 12:08pm
   
write it on page_load event
ythisbug at 15-May-12 5:38am
   
hi sandeep
dynDiv is coming null.i put breakpoint and checkd..
Bernhard Hiller at 15-May-12 8:48am
   
C'mon, those are the OUT parameters - they can be null when you call the function. In case you get the error really exactly in the line shown, objDyn is null. Where is that instatiated?
But I am not sure if you have checked that the error was not raised in GenerateTabControls function...
Sandeep Mewara at 15-May-12 11:33am
   
Thanks for correcting me. Yes, only objDyn looks potential culprit. (Assuming error is not raised in the method!)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

write this code on page_load in place page_init
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 475
1 Maciej Los 339
2 Richard MacCutchan 225
3 BillWoodruff 219
4 Suraj Sahoo | Coding Passion 155
0 OriginalGriff 8,759
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,269
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411028.1 | Last Updated 15 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100