Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: javascript and other style sheets

  1. #1
    ncoppola is offline Member
    Join Date
    Sep 2005
    Posts
    49

    Default javascript and other style sheets

    Can anyone advise how to setup references to javascript files and additional stylesheets within ASPDNSF. I read that the reference to style.css is maintained internally, but what if your template uses js or another style sheet?

    Thank you,

    - Nick
    Nick Coppola
    Lead Developer
    The Everest Information Technologies Group, LLC
    Email Me

    Development/Customization/Integration Experience:

    VB.NET, C#.NET
    MS SQL Server
    InsiteCreation
    AspDotNetStorefront
    Interprise Suite
    Tradepoint360
    Custom Business Applications

  2. #2
    connectinfosoft is offline Junior Member
    Join Date
    Aug 2011
    Location
    New delhi
    Posts
    7

    Default Reply from www.connectinfosoft.com

    You need to put all the reference on template.master page.

  3. #3
    bradg is offline Junior Member
    Join Date
    May 2012
    Posts
    13

    Default

    That may not be the best approach if you only need to access a script or style sheet across a few separate pages. If that's the case, add a ContentPlaceHolder to the head tag in the .master file:

    Code:
    <head id="Head1" runat="server">
    <asp:ContentPlaceHolder ID="HeaderContent" runat="server"></asp:ContentPlaceHolder>
    </head>
    Then, on the page that needs access to the file(s):

    Code:
    <asp:Content ID="Header" runat="server" ContentPlaceHolderID="HeaderContent">
        <script src="jscripts/example.js" type="text/javascript"></script>
    </asp:Content>
    This will prevent files from being loaded on pages that do not use them.
    Last edited by bradg; 07-13-2012 at 09:41 AM.