Ask a Question related to ASP Components, Design and Development.

  1. #1

    Default 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

  2. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139