This is a migrated thread and some comments may be shown as answers.

[Solved] working with embeded resources

12 Answers 204 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vjeran
Top achievements
Rank 2
Vjeran asked on 02 Sep 2008, 09:32 AM
Hi! I was reading that, all images and css is included in dll. Well, i wonder, how can i add this and use it in my project? Like, image resource="something or ...."? I would like to use resources to get my icons and stuff.

12 Answers, 1 is accepted

Sort by
0
Missing User
answered on 02 Sep 2008, 10:04 AM
Hi Vjeran,

You can use GetWebResourceUrl. The GetWebResourceUrl method returns a URL reference to a resource embedded in an assembly. The returned reference is not URL encoded. Resources can be script files, images, or any static file. The following code example demonstrates the use of the GetWebResourceUrl method. The type parameter in this example is set to the type of class in the assembly containing the resource. The resourceName parameter is specified with the fully qualified path to the resource, which includes the default namespace.

<%@ Page Language="C#"%> 
<%@ Import Namespace="Samples.AspNet.CS.Controls" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<script runat="server"
 
  public void Page_Load(Object sender, EventArgs e) 
  { 
    // Define the resource name and type. 
    String rsname = "Samples.AspNet.CS.Controls.script_include.js"
    Type rstype = typeof(ClientScriptResourceLabel); 
 
    // Get a ClientScriptManager reference from the Page class. 
    ClientScriptManager cs = Page.ClientScript; 
 
    // Write out the web resource url. 
    ResourcePath.InnerHtml = cs.GetWebResourceUrl(rstype, rsname); 
 
    // Register the client resource with the page. 
    cs.RegisterClientScriptResource(rstype, rsname); 
 
  } 
</script> 
<html  > 
  <head> 
    <title>ClientScriptManager Example</title> 
  </head> 
  <body> 
     <form    id="Form1" 
            runat="server"
     The web resource path is  
     <span  id="ResourcePath" 
            runat="server"/>. 
     <br /> 
     <br /> 
     <input type="text"  
            id="Message" />      
     <input type="button"  
            onclick="DoClick()"  
            value="ClientClick" /> 
     </form> 
  </body> 
</html> 
 


Sincerely yours,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Vjeran
Top achievements
Rank 2
answered on 02 Sep 2008, 04:02 PM
Yes. but what would be fully qualified path to Skins/Outlook/Grid/Delete.gif that is located in the C:\Program Files\Telerik\RadControls for ASPNET AJAX Q2 2008\Skins\Outlook\Grid folder?
is there some naming shema to use resources that come with telerik controls?

0
Dimo
Telerik team
answered on 03 Sep 2008, 07:05 AM
Hi Vjeran Ivičić,

The Skins subfolder in your RadControls installation folder is simply a storage for the non-embedded versions of our skins. It is not intended for direct use by web applications. If you need an image or CSS file from the Skins subfolder, please copy it to your web application folder and reference it like an ordinary file.

Greetings,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bohdan Cherchyk
Top achievements
Rank 1
answered on 17 Feb 2010, 04:13 PM
is it possible to configure telerik control to load css/js and images from static files. especially from folders that came with installation.
0
Bohdan Cherchyk
Top achievements
Rank 1
answered on 17 Feb 2010, 04:21 PM
We can use ImagesPath. Is there a way to specify path to js folder?
0
Dimo
Telerik team
answered on 17 Feb 2010, 04:37 PM
Hello Bohdan,

You can set ImagesPath to point to any folder. What is a "js folder" ?

Regards,
Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Bohdan Cherchyk
Top achievements
Rank 1
answered on 17 Feb 2010, 05:28 PM

"js folder" is a JavaScript folder :)

there are "Scripts" and "Skins" folders in RadControls ZIP file.
I am wondering how to point control (Calendar for example) to load JavaScript files from "\Scripts\Calendar"
so if I've changed JavaScript, control will pickup these changes.

Also after I set ImagesPath to not existed folder Calendar still loads background image from dlls.

basically my question is How manually point control to javascript and css files?".
0
Bohdan Cherchyk
Top achievements
Rank 1
answered on 17 Feb 2010, 07:09 PM
to load JavaScript manually look here Disabling embedded resources


0
Dimo
Telerik team
answered on 18 Feb 2010, 08:59 AM
Hi Bohdan,

ImagesPath only controls where RadGrid takes its button icons from. The background images used for headers and rows will still be taken from the embedded skin. If you want to use only non-embedded skin resources, you should set EnableEmbeddedSkins="false" and register a RadGrid CSS file manually (there is no way to point a RadControl to register non-embedded CSS files automatically)

http://www.telerik.com/help/aspnet-ajax/createcustomskin.html


Sincerely yours,
Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Dimo
Telerik team
answered on 18 Feb 2010, 09:23 AM
P.S.

In addition, you can use CDN with a custom BaseUrl to control where the scripts/skins are downloaded from:

http://www.telerik.com/help/aspnet-ajax/radscriptmanager-cdn-support.html

http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.cdnsettings_members.html

http://blogs.telerik.com/telerik_vsxteam_blog/09-12-09/radcontrols_for_asp_net_ajax_cdn_support_and_visual_studio_extensions.aspx

CdnSettings can be defined for RadScriptManager and RadStyleSheetManager.

Regards,
Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Bohdan Cherchyk
Top achievements
Rank 1
answered on 18 Feb 2010, 04:01 PM
thank you
also I have another question about embeded resources

I have a control declaration:
<telerik:RadEditor runat="server" EnableEmbeddedScripts="false" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false" />

regarding to Disabling embedded resources
I added

            <asp:ScriptReference Path="~/RadControls/Scripts/Common/Core.js" />
            <asp:ScriptReference Path="~/RadControls/Scripts/Common/jQueryPlugins.js" />
            <asp:ScriptReference Path="~/RadControls/Scripts/Common/Popup/PopupScripts.js" />
            <asp:ScriptReference Path="~/RadControls/Scripts/Editor/RadEditor.js" />
            <asp:ScriptReference Path="~/RadControls/Scripts/Common/LayoutBuilder/LayoutBuilderEngine.js" />
            <asp:ScriptReference Path="~/RadControls/Scripts/Spell/SpellCheckService.js" />
            <asp:ScriptReference Path="~/RadControls/Scripts/Editor/Modules.js" />
            <asp:ScriptReference Path="~/RadControls/Scripts/Dialogs/RadDialogOpenerScripts.js" />
            <asp:ScriptReference Path="~/RadControls/Scripts/Common/Animation/AnimationScripts.js" />
            <asp:ScriptReference Path="~/RadControls/Scripts/Window/RadWindow.js" />

as a result javascript works excellent

now let's add css:

I added references:
/RadControls/Skins/Editor.css
/RadControls/Skins/Default/Editor.Default.css

I guessed probably I need radwindow so I also added
/RadControls/Skins/Window.css
/RadControls/Skins/Default/Window.Default.css

but still content in popup without styles

Question:
does Telerik have table of references for css files (like http://www.telerik.com/help/aspnet-ajax/disabling_embedded_resources.html for javascript)???

Thank you
0
Rumen
Telerik team
answered on 19 Feb 2010, 12:43 PM
Hi Bohdan,

Please, see the following KB article which provides guidance how to style the editor dialogs by setting the DialogsCssFile property and importing the needed listed in the article css files: Registering an external skin of RadEditor.

Greetings,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Vjeran
Top achievements
Rank 2
Answers by
Missing User
Vjeran
Top achievements
Rank 2
Dimo
Telerik team
Bohdan Cherchyk
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or