Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Issue: ModalPopupExtender and ValidationSummary not working on Page_Load [27024]

$
0
0
I have a ModalPopupExtender (mpeAddEdit) that shows on page load. In the ModalPopupExtender there is a ValidationSummary Control (vsDutyLog). If the validationsummary control is present or enabled, then when the call to how the ModalPopupExtender in Page_Load (mpeAddEdit.show() ) , generates an error in the javascript: 'Microsoft JScript runtime error: Object expected' at the line(s) in the javascript reading:

document.getElementById('cphBody_vsDutyLog').dispose = function() {
Array.remove(Page_ValidationSummaries, document.getElementById('cphBody_vsDutyLog'));
}
(function() {var fn = function() {Sys.Extended.UI.ModalPopupBehavior.invokeViaServer('cphBody_mpeAddEdit', true); Sys.Application.remove_load(fn);};Sys.Application.add_load(fn);})();

If the ValidationSummary control is not enabled, or is commented out, then there are no errors generated. Also, if the ModalPopupExtender is shown at any other time than page load, there are no errors (i.e. shown via clicking a link).

It seems like this was somewhat of an issue once before and that the issue related to incorrectly generated javascript (see http://forums.asp.net/t/1175339.aspx/1). The work around here defined seems to alleviate the issue, but then the ValidationSummary is not usable as it is diabled. (See also http://ajaxcontroltoolkit.codeplex.com/workitem/12835?ProjectName=ajaxcontroltoolkit for more information about a suitable interim workaround).

For me this is a high priority issue as it directly affects work I'm currently doing.
Comments: This solution worked for me: Modify Source File [AjaxControlToolkit Solution]\Server\AjaxControlToolkit\ModalPopup\ModalPopupExtender.cs Line 268 Change: "(function() {{" + "var fn = function() {{" + "Sys.Extended.UI.ModalPopupBehavior.invokeViaServer('{0}', {1}); " + "Sys.Application.remove_load(fn);" + "}};" + "Sys.Application.add_load(fn);" + "}})();", to: ";(function() {{" + "var fn = function() {{" + "Sys.Extended.UI.ModalPopupBehavior.invokeViaServer('{0}', {1}); " + "Sys.Application.remove_load(fn);" + "}};" + "Sys.Application.add_load(fn);" + "}})();", Rebuild and use new dll

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>