Suppose I want to write a method that can accept any Control like GridView, DetailsView etc as parameter and will make their visibility False, make them null etc.
So I write a method :
And try to call it in the following way :private void MakeObjectNull<T>(ref T obj)
{
}
Can anyone tell me what I should write in the method "MakeObjectNull" to do the following operation like :MakeObjectNull<DetailsView>(ref DetailsView1);
obj.Visible = false; obj.Dispose(); obj=null; etc






Bookmarks