Wednesday, March 28, 2012

Modal Popup creation problem

I have a project that has several asp .net AJAX controls including a Tab Panel extender, a couple of updatepanels, and a modalpopup. Everything was doing OK (except for the tab panel that keeps disappering on hover over) until I added the modal popup. The page will load but I noticed that I was getting an "Done, but with errors on page" warning and the calendar that sets everything in motion didn't work.

It appears that the modalpopup isn't being created properly at runtime. I see this error message when I follow the error message in Firefox (Firebug):

this._popupElement has no properties
http://mycomputer/mysite/ScriptResource.axd?d=SpCqOYElt5QoLvf_3bBsv_BcFBS3DknA98So9KH3qtFJpwGddMmhi5Fqd8Ekf5Yggy7J5Sw9EaHCqlfKI150bSF4O1S83qGJROU-7k6SGQc1&t=633121015687656250
Line 66

Which further expands to:

initialize()ScriptResource.ax... (line 66)

Sys$Component$endUpdate()ScriptResource.ax... (line 2702)

Sys$Component$create(function(),Object BackgroundCssClass=modal CancelControlID=btnClose,null,null,input#Trigger)ScriptResource.ax... (line 2856)

(no name)()livereports.aspx (line 217)

_handler(Object _disposableObjects=[4] _components=Object,Object)ScriptResource.ax... (line 2503)

Sys$_Application$_doInitialize()ScriptResource.ax... (line 3792)

(no name)()

Why isn't there a comma between Object BackgroundCssClass=modal & CancelControlID=btnClose? Where are all of the properties that I set? This is how the modalpopupextender is set up in my project:

I am totally lost since I don't see much difference in the source code between mine and the AJAX samples function:

Mine:

Sys.Application.add_init(function() {

217 $create(AjaxControlToolkit.ModalPopupBehavior, {"BackgroundCssClass":"modal","CancelControlID":"btnClose","DropShadow":true,"DynamicServicePath":"/scmghd/livereports.aspx","OkControlID":"btnClose","PopupControlID":"gvResults","PopupDragHandleControlID":"pnl1","id":"ModalPopupExtender2"}, null, null, $get("HiddenModalTrigger"));

218});

AJAX Sample:

Sys.Application.add_init(function() {

314 $create(AjaxControlToolkit.ModalPopupBehavior, {"BackgroundCssClass":"modalBackground","CancelControlID":"ctl00_SampleContent_CancelButton","DropShadow":true,"OkControlID":"ctl00_SampleContent_OkButton","OnOkScript":"onOk()","PopupControlID":"ctl00_SampleContent_Panel1","PopupDragHandleControlID":"ctl00_SampleContent_Panel3","dynamicServicePath":"/AJAX/AjaxControlToolkit/Samples/ModalPopup/ModalPopup.aspx","id":"ctl00_SampleContent_ModalPopupExtender"}, null, null, $get("ctl00_SampleContent_LinkButton1"));

315});

This is the way I have the modalpopup set in Visual Web Dev:

<cc1:ModalPopupExtenderID="ModalPopupExtender2"runat="server"BackgroundCssClass="modal"TargetControlID="Trigger"PopupDragHandleControlID="pnl1"PopupControlID="gvResults"CancelControlID="btnClose"OkControlID="btnClose"DropShadow=true>

</cc1:ModalPopupExtender>

Again any help is appreciated!

I hate to be a bother but this project is very important...any help would greatly be appreciated.

Thanks

No comments:

Post a Comment