Click here to Skip to main content
15,885,921 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.
C#
protected void Page_Init(object sender, EventArgs e)
    {
      objDyn.GenerateTabControls("FM_FactoryMaster", out dynDiv, out gListDynamicControls, true, false, false);

}

thanks
Posted
Updated 15-May-12 0:49am
v3
Comments
sjelen 15-May-12 12:37pm    
objDyn is probably null. What is it? A control? Some custom class? Where do you initialize it?

Take a look here[^]
 
Share this answer
 
Comments
VJ Reddy 16-May-12 10:43am    
Useful reference for common questions. 5!
Maciej Los 16-May-12 10:56am    
Thank you, VJ ;)
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.
 
Share this answer
 
v3
Comments
ythisbug 15-May-12 5:29am    
gListDynamicControls this value is showing 0..
ythisbug 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 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 15-May-12 12:08pm    
write it on page_load event
ythisbug 15-May-12 5:38am    
hi sandeep
dynDiv is coming null.i put breakpoint and checkd..
write this code on page_load in place page_init
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900