Ask a Question related to ASP Components, Design and Development.
-
Wizzard #1
WebResources
Hi I'm developing a server component to embed Flash files with detection of
version etc.
I'm embeding resources one javascript file and one image(gif) file the
embeded javascript is referenceable and the gif shows in VS2005 designe view
but when I view the page with the component on it in explorer the script
executes but the image fails to show :(
extra lines in my Assembly.cs file
[assembly:
System.Web.UI.WebResource("NotAClue.Web.UI.WebCont rols.WebResources.Resources.get_flash_player.gif", "image/gif", PerformSubstitution = true)]
[assembly:
System.Web.UI.WebResource("NotAClue.Web.UI.WebCont rols.WebResources.Resources.popup.js", "text/javascript")]
My Render function
protected override void Render(HtmlTextWriter output)
{
output.WriteBeginTag("img");
output.WriteAttribute("src",
this.Page.ClientScript.GetWebResourceUrl(typeof(Im ageResource),
"NotAClue.Web.UI.WebControls.WebResources.Resource s.get_flash_player.gif"));
output.WriteAttribute("alt", "Get Macromedia Flash Player");
output.Write(" />");
output.WriteBeginTag("script");
output.WriteAttribute("src",
this.Page.ClientScript.GetWebResourceUrl(typeof(Im ageResource),
"NotAClue.Web.UI.WebControls.WebResources.Resource s.popup.js"));
output.Write(">");
output.WriteEndTag("script");
output.Write("\n<input type='submit' value='Click Me'
name='button1' OnClick='DisplayMsg();'>");
}
I just dont know why the js file should be available but not the gif.
--
wizzard <|:-)
Wizzard Guest
-
Wizzard #2
RE: WebResources
I'll reply to myself then... ;-)
the WebResource entries in the AssemblyInfo.cs file MUST for some reason
appeare right after the "using" statements at the beginning of the file.
--
wizzard <|:-)
"Wizzard" wrote:
> Hi I'm developing a server component to embed Flash files with detection of
> version etc.
> I'm embeding resources one javascript file and one image(gif) file the
> embeded javascript is referenceable and the gif shows in VS2005 designe view
> but when I view the page with the component on it in explorer the script
> executes but the image fails to show :(
>
> extra lines in my Assembly.cs file
> [assembly:
> System.Web.UI.WebResource("NotAClue.Web.UI.WebCont rols.WebResources.Resources.get_flash_player.gif", "image/gif", PerformSubstitution = true)]
> [assembly:
> System.Web.UI.WebResource("NotAClue.Web.UI.WebCont rols.WebResources.Resources.popup.js", "text/javascript")]
>
> My Render function
> protected override void Render(HtmlTextWriter output)
> {
> output.WriteBeginTag("img");
> output.WriteAttribute("src",
> this.Page.ClientScript.GetWebResourceUrl(typeof(Im ageResource),
> "NotAClue.Web.UI.WebControls.WebResources.Resource s.get_flash_player.gif"));
> output.WriteAttribute("alt", "Get Macromedia Flash Player");
> output.Write(" />");
>
> output.WriteBeginTag("script");
> output.WriteAttribute("src",
> this.Page.ClientScript.GetWebResourceUrl(typeof(Im ageResource),
> "NotAClue.Web.UI.WebControls.WebResources.Resource s.popup.js"));
> output.Write(">");
> output.WriteEndTag("script");
> output.Write("\n<input type='submit' value='Click Me'
> name='button1' OnClick='DisplayMsg();'>");
> }
>
> I just dont know why the js file should be available but not the gif.
> --
> wizzard <|:-)Wizzard Guest



Reply With Quote

