A: 

It doesn't look like it's complaining about the CssClass...it looks like it's complaining that the foregroundElement is null...what's your markup that creates your ModalPopup?

Jonas
A: 

You can set the ModalPopupExtender's backgroundCssClass within the actual HTML markup.

Example from the asp.net modal popup page:

<ajaxToolkit:ModalPopupExtender ID="MPE" runat="server"
TargetControlID="LinkButton1"
PopupControlID="Panel1"
**BackgroundCssClass="modalBackground"** 
DropShadow="true" 
OkControlID="OkButton" 
OnOkScript="onOk()"
CancelControlID="CancelButton" 
PopupDragHandleControlID="Panel3" />
Jack Marchetti
A: 

Ha-ha, I remember more then 2 years ago in AJAX beta not setting the BackgroundCssClass property caused modal popup not to be really modal, but just popup. I remember setting a style class solved the problem. I haven't used AJAX for a long time, it's funny if similar problems still persist. Anyway, create stylesheet class inside your ASPX page or in CSS file referenced form it and set the property value to it. Maybe, this will also help.

Dmitry Tashkinov