Results 1 to 10 of 10

Thread: [2005]Auto App_Theme path (ASP 2.0)

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    [2005]Auto App_Theme path (ASP 2.0)

    Is there a way to use a URL to point to the current app_theme folder ie

    |App_Theme|Reporting\MyFile.jpg

    It HAS to be a URL, I can't get round it using a SkinID.

  2. #2
    Addicted Member senthilkumartd's Avatar
    Join Date
    Feb 2005
    Posts
    206

    Re: [2005]Auto App_Theme path (ASP 2.0)

    I can't understand ur requirement
    God has been pleased to place as a king or cobbler do the work sincerely

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: [2005]Auto App_Theme path (ASP 2.0)

    I'm not sure I can make it any simplier. I have to enter a URL for a file.
    ie MyImages/Myimage.jpg

    When my image is dependant on a theme, the theme directory can be modified by the website to choose the best theme for themselves. So if the current theme is "default" the path of the file would be

    App_Themes/default/MyImages/MyImage.jpg

    So, if they changed the theme to "simple" the location of the file would be

    App_Themes/simple/MyImages/MyImage.jpg

    I need a method/way to allow me to automatically change a URL to match the current theme. You can do this with the data path with something like this

    |Data|MyFile.XML

    Is there a way to do this for a URL?
    Last edited by Grimfort; Sep 5th, 2007 at 03:17 AM.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005]Auto App_Theme path (ASP 2.0)

    Sorry... you still don't make sense.

    The first part makes sense, but this doesn't:

    I need a method of this URL to automatically change to match the current theme.
    What do you have in the themes folder that you're trying to access in there?

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: [2005]Auto App_Theme path (ASP 2.0)

    Edited for clarity.

    Mostly I am getting images for say a grid control or a tree view control that only allows me to specify the URL of the image for entries/nodes.

    Heres another post asking exactly the same question:
    http://forums.asp.net/t/1001497.aspx
    Last edited by Grimfort; Sep 5th, 2007 at 04:28 AM.

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005]Auto App_Theme path (ASP 2.0)

    It appears that you are looking for creating Skins for your controls.

    http://msdn2.microsoft.com/en-us/library/ykzx33wh.aspx

    Does that give you a good idea of what to do?

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: [2005]Auto App_Theme path (ASP 2.0)

    Thanks for the investiagation, however as I posted in my first post, I can't use Skins.

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005]Auto App_Theme path (ASP 2.0)

    Ah, sorry, we're in circles.

    So you could then derive the path to the theme folder you want.

    "~/App_Themes/" + Page.Theme + "/restofthepath";

    That should be close enough to what you need.

  9. #9

    Thread Starter
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    Re: [2005]Auto App_Theme path (ASP 2.0)

    Well, if the page.theme is set to the current theme (from the config.xml) then I can make that up. I'll just have to modify everything by code and wont get to see it in the designer. Spose I could use a default value actually so that might work as well. I'll try it on Monday, thanks.

  10. #10
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005]Auto App_Theme path (ASP 2.0)

    If you're using a master page or a base page, create a public property that does a bit of this 'logic' for you and access it from the 'child' pages.

Posting Permissions

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



Click Here to Expand Forum to Full Width