public sealed class RegisteredDisposeScript\r
{\r
readonly Control _control;\r
+ readonly UpdatePanel _updatePanel;\r
readonly string _script;\r
\r
- internal RegisteredDisposeScript (Control control, string script) {\r
+ internal RegisteredDisposeScript (Control control, string script, UpdatePanel updatePanel) {\r
_control = control;\r
_script = script;\r
+ _updatePanel = updatePanel;\r
}\r
\r
public Control Control {\r
public string Script {\r
get { return _script; }\r
}\r
+\r
+ internal UpdatePanel UpdatePanel {\r
+ get { return _updatePanel; }\r
+ }\r
}\r
}\r
string _controlIDToFocus;
bool _allowCustomErrorsRedirect = true;
string _asyncPostBackErrorMessage;
- List<DisposeScriptEntry> _disposeScripts;
+ List<RegisteredDisposeScript> _disposeScripts;
List<ScriptReferenceEntry> _scriptToRegister;
bool _loadScriptsBeforeUI = true;
AuthenticationServiceManager _authenticationService;
StringBuilder sb = new StringBuilder ();
sb.AppendLine ();
for (int i = 0; i < _disposeScripts.Count; i++) {
- DisposeScriptEntry entry = _disposeScripts [i];
+ RegisteredDisposeScript entry = _disposeScripts [i];
if (IsMultiForm)
sb.Append ("Sys.WebForms.PageRequestManager.getInstance($get(\"" + Page.Form.ClientID + "\"))._registerDisposeScript(\"");
else
}
public ReadOnlyCollection<RegisteredDisposeScript> GetRegisteredDisposeScripts () {
- throw new NotImplementedException ();
+ if (_disposeScripts == null)
+ _disposeScripts = new List<RegisteredDisposeScript> ();
+ return new ReadOnlyCollection<RegisteredDisposeScript> (_disposeScripts);
}
public ReadOnlyCollection<RegisteredExpandoAttribute> GetRegisteredExpandoAttributes () {
return;
if (_disposeScripts == null)
- _disposeScripts = new List<DisposeScriptEntry> ();
- _disposeScripts.Add (new DisposeScriptEntry (updatePanel, disposeScript));
+ _disposeScripts = new List<RegisteredDisposeScript> ();
+ _disposeScripts.Add (new RegisteredDisposeScript (control, disposeScript, updatePanel));
}
static UpdatePanel GetUpdatePanel (Control control) {
if (_disposeScripts != null)
for (int i = 0; i < _disposeScripts.Count; i++) {
- DisposeScriptEntry entry = _disposeScripts [i];
+ RegisteredDisposeScript entry = _disposeScripts [i];
if ((_panelsToRefresh != null && _panelsToRefresh.IndexOf (entry.UpdatePanel) >= 0) || (_childUpdatePanels != null && _childUpdatePanels.IndexOf (entry.UpdatePanel) >= 0))
WriteCallbackOutput (output, scriptDispose, entry.UpdatePanel.ClientID, entry.Script);
}
}
}
- sealed class DisposeScriptEntry
- {
- readonly UpdatePanel _updatePanel;
- readonly string _script;
-
- public UpdatePanel UpdatePanel { get { return _updatePanel; } }
- public string Script { get { return _script; } }
-
- public DisposeScriptEntry (UpdatePanel updatePanel, string script) {
- _updatePanel = updatePanel;
- _script = script;
- }
- }
-
internal void RegisterProxy (ScriptManagerProxy scriptManagerProxy) {
if (_proxies == null)
_proxies = new List<ScriptManagerProxy> ();