Home/ASP.NET Forums/General ASP.NET/MVC/how to do not route images, css,js etc

how to do not route images, css,js etc [Answered]RSS

33 replies

Last post Mar 17, 2010 03:53 PM by CeOfFuture

My .NET blog : http://msprogrammer.serviciipeweb.ro/ |2012 Programmer tools
  • CeOfFuture

    CeOfFuture

    Member

    218 Points

    397 Posts

    Re: how to do not route images, css,js etc

    Mar 16, 2010 01:45 PM|CeOfFuture|LINK

    ignatandrei


  • lblPokmemonImage.Text = "<img src='" + ResolveUrl("~/images/pokemons/" + dsPokedex.Tables[0].Rows[0]["PokemonId"].ToString() +  
  •           dsPokedex.Tables[0].Rows[0]["Name"].ToString().Replace(" """).Replace(".""") + ".png\")' ) +  
  •        " title=\"" + dsPokedex.Tables[0].Rows[0]["Name"].ToString() + " (Pokemon)\" " +  
  •        " alt=\"" + dsPokedex.Tables[0].Rows[0]["Name"].ToString() + " (Pokemon)\"  />";  


    And please,please do not use code behind in ASP.NET MVC

  • thnx for the replay


    this is working after i corrected the code


    lblPokmemonImage.Text = "<img src=" +ResolveUrl("~/images/pokemons/" + dsPokedex.Tables[0].Rows[0]["PokemonId"].ToString() +
               dsPokedex.Tables[0].Rows[0]["Name"].ToString().Replace(" ", "").Replace(".", "") + ".png")+
            " title=\"" + dsPokedex.Tables[0].Rows[0]["Name"].ToString() + " (Pokemon)\" " +
            " alt=\"" + dsPokedex.Tables[0].Rows[0]["Name"].ToString() + " (Pokemon)\"  />";


    i can edit all images but also i have problem with my master page references :D


    can you also tell me how to fix these kind of refs


    <link rel="stylesheet" href="main_menu_not_logged_tr_files/cbcscbmain_menut_logged_tr.css" type="text/css" />


    Browser MMORPG Monster Game developer better online Pokemon games.
    Url routing : MonsterDex
  • ignatandrei

    ignatandrei

    All-Star

    155635 Points

    25645 Posts

    Moderator

    MVP

    Re: how to do not route images, css,js etc

    Mar 16, 2010 01:54 PM|ignatandrei|LINK

    CeOfFuture

    <link rel="stylesheet" href="main_menu_not_logged_tr_files/cbcscbmain_menut_logged_tr.css" type="text/css" />  

    <style type="text/css">
            @import '<%= ResolveUrl("~/main_menu_not_logged_tr_files/cbcscbmain_menut_logged_tr.css") %>';
     
        </style>

    My .NET blog : http://msprogrammer.serviciipeweb.ro/ |2012 Programmer tools
  • CeOfFuture

    CeOfFuture

    Member

    218 Points

    397 Posts

    Re: how to do not route images, css,js etc

    Mar 16, 2010 02:01 PM|CeOfFuture|LINK

    ignatandrei

    CeOfFuture

    <link rel="stylesheet" href="main_menu_not_logged_tr_files/cbcscbmain_menut_logged_tr.css" type="text/css" />  

    <style type="text/css">
            @import '<%= ResolveUrl("~/main_menu_not_logged_tr_files/cbcscbmain_menut_logged_tr.css") %>';
     
        </style>



    thnx a lot for all answer

    also i am gonna fix image problem with this


    runat="server" src="~\main_menu_not_logged_tr_files/ebbtcbmain_menut_logged_tr1_0.gif"

    Browser MMORPG Monster Game developer better online Pokemon games.
    Url routing : MonsterDex
  • CeOfFuture

    CeOfFuture

    Member

    218 Points

    397 Posts

    Re: how to do not route images, css,js etc

    Mar 16, 2010 02:06 PM|CeOfFuture|LINK

    one more thing

    i will import javascript with this right ?


    <script  type="text/javascript">
            @import '<%= ResolveUrl("~/main_menu_not_logged_tr_files/cbjscbmain_menut_logged_tr.js") %>';
    </script>


    also how can i import iframe htm files


        <iframe  frameborder="0"   style=" width:62px; height:32px;" scrolling="no" src="Paypal.htm"></iframe> 


    Browser MMORPG Monster Game developer better online Pokemon games.
    Url routing : MonsterDex
  • ignatandrei

    ignatandrei

    All-Star

    155635 Points

    25645 Posts

    Moderator

    MVP

    Re: how to do not route images, css,js etc

    Mar 16, 2010 02:19 PM|ignatandrei|LINK

    for js use

    <script type="text/javascript" src='<%= ResolveUrl("~/path to script ")%>'></script>


    And for iframe the same for script

    My .NET blog : http://msprogrammer.serviciipeweb.ro/ |2012 Programmer tools
  • CeOfFuture

    CeOfFuture

    Member

    218 Points

    397 Posts

    Re: how to do not route images, css,js etc

    Mar 16, 2010 02:36 PM|CeOfFuture|LINK

    i solved javascript with this way


    working very well



    <script language="javascript" src="<%=ResolveUrl("~/main_menu_not_logged_tr_files/cbjscbmain_menut_logged_tr.js")%>" type="text/javascript"></script>


    Browser MMORPG Monster Game developer better online Pokemon games.
    Url routing : MonsterDex
  • CeOfFuture

    CeOfFuture

    Member

    218 Points

    397 Posts

    Re: how to do not route images, css,js etc

    Mar 16, 2010 05:32 PM|CeOfFuture|LINK

    i spent to much time to solve problems


    but at the end i can not use this method as i wished


    because my all paths are relative

    all images etc


    this would take huge time to fix them

    even if i do fix most of them i wont be able to fix my menus javascript files because it is generated by a software and very complicated


    :/


    so i am gonna use this method


    domain.com/variable1-variable2-variable3

    Browser MMORPG Monster Game developer better online Pokemon games.
    Url routing : MonsterDex
  • CeOfFuture

    CeOfFuture

    Member

    218 Points

    397 Posts

    Re: how to do not route images, css,js etc

    Mar 17, 2010 03:53 PM|CeOfFuture|LINK

    here you can check my final result


    check pokemon name urls :)

    Pokedex

    Browser MMORPG Monster Game developer better online Pokemon games.
    Url routing : MonsterDex
  • ‹ Previous Thread|Next Thread ›