c# - How to remove Client Script Resource in the lifecycle? -
in base class, pre-render adds javascript page. in derived class, want replace javascript 1 of own resource script.
if script being added in base class:
this.page.clientscript.registerclientscriptresource(typeof(geomappingeditor), "somespace.resources.scripts.geomapping.js");
then can this:
protected override void onprerender(eventargs e) { base.onprerender(e); //how overwrite javascript file here? }
the reason why thought may possible because javascript added onto page key this:
this.page.clientscript.registerclientscriptinclude("geomapping", this.apiscript);
so know can add script in page "geomapping" being key , overwrite previous script. not seem there key "registerclientscriptresource". ideas on how achieve this?
in base class, add virtual/overridable method register script, , in base class, override method , don't call base implementation. override it.
also,
Comments
Post a Comment