|
| |
| IluDeR | Asp.Net User |
| Master Pages And Themes - Images Path question | 1/11/2006 6:15:56 PM |
0/0 | |
|
Hi!
I've been doing some work in the new Visual Studio, and i've encounter some problems in the reference of images when using a Theme.
I've got this directory structure in my web project:
root\ App_Theme\ Default\ Images\ Controls\ Tree\ Tree.Gif Docs\ DOcuments.aspx MainMasterPage.Master DocsMasterPage.Master
I've got the "DocsMasterPage.Master" Inherits from the MainMasterPage.Master. And the "Documents.aspx" inherits from the "DocsMasterPage.Master".
I've got a TreeView control in the "DocsMasterPage.Master", and i need to reference the image inside the theme folder to a node. Something like this..
<asp:TreeNode NavigateUrl="" Value="ID=1" Text="ROOT" ImageUrl="Images/Controls/Tree/root.gif">
How do i put the imageurl? I've tried, like the example above, like "~/images" and "/images", none of that worked.
Can anyone help me?
Thanks in advance.
__________________________________________ IluDeR Portuguese |
| taniam | Asp.Net User |
| Re: Master Pages And Themes - Images Path question | 1/11/2006 11:17:37 PM |
0/0 | |
|
You want to use the "~/" format, but you'll need to specify the complete path, which in your case would look like "~/App_Theme/Default/Images/Controls/Tree/Tree.gif".
Hope this helps!
Tania
ASP.NET Team
This posting is provided "AS IS" with no warranties, and confers no rights. |
| taniam | Asp.Net User |
| Re: Master Pages And Themes - Images Path question | 1/12/2006 12:25:21 AM |
0/0 | |
|
Oh, sorry, I glossed over the themes aspect of the question.
After reading more closely I set up a web like yours and was able to get the image to display by setting ImageUrl="Images/controls/tree/tree.gif". I put the skin file for the default theme in the Default directory. Is that where yours is?
I also just noticed that in your web structure the image file is listed as "tree.gif", but the treenode is trying to use a "root.gif". If that's not a type in the post, that could be the source of the problem.
Tania
ASP.NET Team
This posting is provided "AS IS" with no warranties, and confers no rights. |
| IluDeR | Asp.Net User |
| Re: Master Pages And Themes - Images Path question | 1/12/2006 11:02:47 AM |
0/0 | |
|
taniam wrote: You want to use the "~/" format, but you'll
need to specify the complete path, which in your case would look like
"~/App_Theme/Default/Images/Controls/Tree/Tree.gif".
Hope this helps!
Hi...that worked. It's not the best way to do this, but until i can
apply a specific skin to a treenode, this was the only solution that
worked. Now, i just have to alter the string, using the current theme.
Thank you Tania.
__________________________________________ IluDeR Portuguese |
| NamelessParanoi | Asp.Net User |
| Re: Master Pages And Themes - Images Path question | 8/13/2007 1:48:53 PM |
0/0 | |
|
jcasp: The way you're explicitly referencing the Image sub-directory within the App_Theme goes counter to how Theme should be used. Instead, you should be defining a SkinFile(s) under the App_Theme directory (another subdirectory for the skin) that contains the definition for the control involved (minus the ID or other page specific attributes) so that changing the Theme value later makes everything portable (contained within each Theme directory). Any other resources that are not related to Theme should not be kept under the App_Theme directory in order to avoid the exact issue you're facing. Took me quite a while to realise that what Star said actually alludes to the solution (though it doesn't state it outright). If you reference an image from a content page or master page using ImageUrl it simply will not work. It assumes you are referencing a file in the root directory rather than converting that reference according to the currently applied theme for the content page. The only way to reference images in a theme from any page (without hardcoding a reference to "App_Themes/MyTheme/resource.bmp", which COMPLETELY defeats the point of themes and is a fairly pointless exercise) is to create a skin that defines the url of various types of images and apply them on the page by declaring an <asp:Image ...> object with the appropriate SkinID reference.
So, for a structure of: root\ App_Theme\ Default\ skin file goes here under theme root directory Images\ imagename1.Gif imagename2.Gif
Docs\ DOcuments.aspx MainMasterPage.Master ContentPage.aspx Create the .skin file with <asp:Image runat="server" ImageUrl="images/imagename1.gif" SkinID="imageTypeID1" /> <asp:Image runat="server" ImageUrl="images/imagename2.gif" SkinID="imageTypeID2" /> Then apply the theme in the content page and set up the images using the following markup in the content/master page: <asp:Image runat="server" SkinID="imageTypeID1" /> <asp:Image runat="server" SkinID="imageTypeID2" /> |
| J_D_Cebrian | Asp.Net User |
| Re: Master Pages And Themes - Images Path question | 11/9/2007 8:25:20 AM |
0/0 | |
|
I have a GridView with two columns.
In the first column I will show an Item's Description. In the second column I will show an Item's current Status represented by an image.
Using your "SkinID" approach I think I could get the Status Image using the Current Theme.
But how can I set a "Themed" image on the column header? The "HeaderTemplate" comes with a "HeaderImageUrl" property, but it comes without any "SkinID".
<asp:GridView ID="gv" runat="server"> <Columns> <asp:BoundField HeaderText="Item Description" DataField="Description" > <asp:TemplateField HeaderText="Item Status" HeaderImageUrl="??? HOW CAN I MAKE THIS PATH THEMEABLE ???"> <ItemTemplate> <asp:Image ID="imgItemStatus1" runat="server" SkindId="imgSkinItemStatus1" Visible='<%# Eval("ItemStatus") == 1 %>' /> <asp:Image ID="imgItemStatus2" runat="server" SkindId="imgSkinItemStatus2" Visible='<%# Eval("ItemStatus") == 2 %>' /> <asp:Image ID="imgItemStatus2" runat="server" SkindId="imgSkinItemStatus3" Visible='<%# Eval("ItemStatus") == 3 %>' /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>
Does somebody have any ideas on how to accomplish this without using server side code?
Thanks in advance. |
|
| |
Free Download:
Books: Pro ASP.NET 2.0 in VB 2005: From Professional to Expert Authors: Laurence Moroney, Matthew MacDonald, Pages: 1253, Published: 2006 Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages Authors: Jacob J. Sanford, Pages: 474, Published: 2007 ASP.NET 2.0 Black Book: black book Authors: Dreamtech Software, Dreamtech Software, Charul Shukla, Anil Kumar Barnwal, Dreamtech Software India, Pages: 1167, Published: 2006 Practical Mono Authors: Mark Mamone, Pages: 403, Published: 2005 Dictionary of Biblical Imagery: An Encyclopedia Exploration of the Images, Symbols, Motifs, Metaphors, Figures of Speech, Literary Patterns and Universal Master Images of the Bible Authors: Leland Ryken, Jim Wilhoit, James C. Wilhoit, Tremper Longman, Colin Duriez, Douglas Penney, Daniel G. Reid, Pages: 1058, Published: 1998 Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008 Giancarlo De Carlo: Layered Places Authors: John McKean, Giancarlo De Carlo, Pages: 207, Published: -1 ASP.NET 2.0: Your Visual Blueprint for Developing Web Applications Authors: Chris Love, Pages: 339, Published: 2007 The Writer's Path: A Guidebook for Your Creative Journey : Exercises, Essays, and Examples Authors: Todd Walton, Mindy Toomay, Pages: 256, Published: 2000 Web:Master Pages And Themes - Images Path question - ASP.NET Forums Re: Master Pages And Themes - Images Path question ... Re: Master Pages And Themes - Images Path question ... Referencing images (path) in MasterPages - ASP.NET Forums . also if you are using master pages with themes... your style sheet will ... Master Pages and Themes Master Pages and Themes. U. sing the techniques you’ve learned so far, ..... a content page in another subfolder, the image path is interpreted relative to ... master pages question - ASPnix Web Hosting - Forums master pages question. Last post 11-14-2006 5:56 PM by himawari. 6 replies. ... This image will not display on pages inside the members folder. HELP? ... ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps Apr 11, 2006 ... Master pages use the theme specified by the page that is using them. ... NET will rebase the path to the gif file. The master page only ... ASP.NET Master Pages Overview For example, you might put an Image control on a master page and set its ImageUrl ... However, themes are applied to master pages under these circumstances: ... Customizing and Managing Your Site's Appearance / Part 3 - Page 2 It uses master pages to specify the structure of the site, themes, ... The master page contains both an advertisement banner image that is customized by ... Creating a Layout Using Master Pages This section discusses the Master Pages feature in ASP.NET 2.0. ... like images or stylesheet or page references using a relative-path syntax, for example: ... SharePoint Branding Tool (Themes, Master pages, Site Logos ... SharePoint Branding Tool (Themes, Master pages, Site Logos. .... -Different SharePoint language version support (Dynamic install path support - for Spanish ... Themes & Master Pages - Are they enough ? Don’t get me wrong here, of the two, Master Pages and Themes, Master Pages are my ... Anyway, thanks for the great question, and allowing me to answer! ... Videos: www.moldytoaster.com may know with what pains we prepare ourselves for them. Besides, when BULWER thinks it right that the world should know that the idea of "La Vaili\'c... |
|
Search This Site:
|
|