Problem with registering jquery


I have an ASP.NET application with the structure Next:

ProjetoWeb (raiz projeto)

Compartilhado (pasta)
|---Scripts (pasta)

Masters (pasta)

Cadastros (pasta)

Relatorio (pasta)
|----Vendas (pasta)

I have registered the script on the Master page:

<script src="../Compartilhado/Scripts/jquery.responsivetable.min.js"></script>

For all pages that only have one folder level, it works normally (ex: the page ListCADS.ASPX)

but pages with more levels (eg Sales.ASPX) do not finalize.

I've already changed to:

<script src="../../Compartilhado/Scripts/jquery.responsivetable.min.js">

But then the other pages stopped working.

How to solve this?

asked by anonymous 21.10.2015 / 19:49

1 answer


Try this way, if I remember well to use C# in ASPX this is how it states:

<script src="<%= ResolveClientUrl("~/Compartilhado/Scripts/jquery.responsivetable.min.js") %>">

Using the ResolveClientUrl function it always returns the relative URL.

21.10.2015 / 19:57