Preheat oven to 350 degrees F (175 degrees C). Grease an 8×8 inch baking dish.
Heat oil in a small skillet over medium heat. Saute onion until translucent.
In a large bowl combine butter and cream cheese. Stir in whole kernel corn, creamed corn, chile peppers, and onions. Pour into prepared dish.
Bake in preheated oven for 15 minutes. Remove from oven and stir in half of the fried onions; sprinkle remaining onions on top. Bake 15 minutes more.