I am creating a visual web-part that has a few images, a CSS file and a java-script file, but i'm having issues. Can someone please tell me what I am missing or doing wrong?
I have added the files to my project and made them "embedded resources" via the property window. I have also added the following to my "AssemblyInfo.cs" file.
//Embedded Resources for this Assembly are the following
[assembly: System.Web.UI.WebResource("LibrarySlider.SliderWebPart.style.css", "text/css")]
[assembly: System.Web.UI.WebResource("LibrarySlider.SliderWebPart.slider.js", "text/javascript")]
[assembly: System.Web.UI.WebResource("LibrarySlider.SliderWebPart.arrows-2.png", "image/jpg")]
[assembly: System.Web.UI.WebResource("LibrarySlider.SliderWebPart.arrows-3.png", "image/jpg")]
[assembly: System.Web.UI.WebResource("LibrarySlider.SliderWebPart.arrows-4.png", "image/jpg")]
[assembly: System.Web.UI.WebResource("LibrarySlider.SliderWebPart.arrows.png", "image/jpg")]
in my ascx.cs file i have the following methods:
- createChildControls
- Render(HtmlTextWriter writer)
- OnPreRender(EventArgs e)
in my prerender i have the folowing code:
string styleSheetUrl = Page.ClientScript.GetWebResourceUrl(this.Parent.GetType(), "LibrarySlider.SliderWebPart.style.css");
string srptLoc = Page.ClientScript.GetWebResourceUrl(this.GetType(), "LibrarySlider.SliderWebPart.slider.js");
My web-parts Render(HtmlTextWriter writer) content is displaying but when i view he source i don't see the CSS or java-script file linking in. And secondly how would i get the images?
Thanks in advanced for any help!!