resource are in a subfolder off the project root or just the resource is in a
subfolder.
the code is as follows ( this is an example with the resourse in a
sub-folder called Resources):
private void RegisterScript( Control targetControl) {
String pageScriptName = "Cbs.Ui.Control s.Resources.Con trolScript";
if ( !this.Page.IsCl ientScriptBlock Registered(page ScriptName) ) {
using (System.IO.Stre amReader reader = new
System.IO.Strea mReader(typeof( Cbs.Ui.Controls .FirstFocus).As sembly.GetManif estResourceStre am(typeof(Cbs.U i.Controls.Firs tFocus),
"Cbs.Ui.Control s.Resources.Con trolScript.js") )) {
String script = "<script language='javas cript' type='text/javascript'
\r\n<!--\r\n" + reader.ReadToEn d() + "\r\n//-->\r\n</script>";
this.Page.Regis terClientScript Block(pageScrip tName, script);
}
}
the code failes on the using line with the error:
Value cannot be null. Parameter name: stream
Everything works fine if its all in the root and refer to the script as just
"ControlScript. js"
I understand that the fully qualified name of a resource in a sub-folder
should be <namespace>.<su bfolder>.<resou rcename>.<exten sion>.
Am i missing something?
Thanks,
Christian