Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello All,
I have a dialog in the master HTML and I'm hiding it and showing it based on a button, which is also in the master HTML. Everything hides/shows fine in root pages but not on pages in subfolders. When these are displayed the dialog HTML code is never hidden and the button click doesn't do anything.
The Script in my master page is like this:
JavaScript
<script type="text/javascript">
        $(document).ready(function () {
            $('#Id_GL').click(function () {
                $('#div_GL').show();
                $('#div_AP').hide();
                $('#div_AR').hide();
            });           
        });
        </script>


Is there any way to get my master page to behave with subfoldered pages?
Please Help..!!
Posted
Updated 13-Jul-14 20:17pm
v2

1 solution

XML
I guess you are adding the script with respect to Master page location. If so change it to always point from the root by using ~.

Lets take this is your folder structure

<script>
<Subfodler1>
<Subfodler2>
-> Master Page

From root the script file a.js will be referred as /script/a.js. This will work for files in root but fails when you access a page from subfolder1. Because if will try to locate script within subfolder1 which doesn't exist. So to make accessible globally we need to change the script path in master page to point to root (~). i.e. ~/script/a.js so irrespective of the page location the script will be always loaded from root.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900