D
Dariusz Tomoñ
Hello,
I'd like to include JS from C# code (ASP.NET 2.0). I'm trying not directly
from i.e. default.aspx.cs code but from a class belonging to DLL, which is
referred in my project.
The code is as follow:
Page.ClientScript.RegisterClientScriptInclude(Page.GetType(),"swfobject.js","swfobject.js");
string scriptBlock = "<script type=\"text/javascript\"
language=\"JavaScript\">" +
"var fo = new SWFObject(\"" + path + "\", \"\", \""+szerokosc+"\",
\""+wysokosc+"\", \"6\", \"#FFFFFF\");" +
"fo.write(\"" + layer + "\");" +
"</script>";
All the time I get error in the line -
Page.ClientScript.RegisterClientScriptInclude(Page.GetType(),"swfobject.js","swfobject.js");
telling that reference to the object is not set for object occurence (I
cannot provide the error message because it's in my language - I have got
polish version of Win2003Serv. At the occasion: Is it possible to force my
environment to throw english errors not polish?).
I tried to change Page.GetType() to this.GetType() but without any effect.
Thank you for any suggestion.
Darek T.
I'd like to include JS from C# code (ASP.NET 2.0). I'm trying not directly
from i.e. default.aspx.cs code but from a class belonging to DLL, which is
referred in my project.
The code is as follow:
Page.ClientScript.RegisterClientScriptInclude(Page.GetType(),"swfobject.js","swfobject.js");
string scriptBlock = "<script type=\"text/javascript\"
language=\"JavaScript\">" +
"var fo = new SWFObject(\"" + path + "\", \"\", \""+szerokosc+"\",
\""+wysokosc+"\", \"6\", \"#FFFFFF\");" +
"fo.write(\"" + layer + "\");" +
"</script>";
All the time I get error in the line -
Page.ClientScript.RegisterClientScriptInclude(Page.GetType(),"swfobject.js","swfobject.js");
telling that reference to the object is not set for object occurence (I
cannot provide the error message because it's in my language - I have got
polish version of Win2003Serv. At the occasion: Is it possible to force my
environment to throw english errors not polish?).
I tried to change Page.GetType() to this.GetType() but without any effect.
Thank you for any suggestion.
Darek T.