Well, I understand that my title is a bit confusing. I will give this as an example below.
<asp:ImageButton ID="imgButton" NavigateUrl="~/Presentation/Resources/Images/addFile.png" runat="server" />
In html, the control above will display as
<input type="image" name="imgButton" id="imgButton" src="../../Resources/Images/addFile.png" style="border-width:0px;">
I notice that it converts src from "~" to "../../". Automatically organizes its file level.
so in javascript i want to install it using this url:
~ / Presentation / Resources / Images / PDF.png
Unfortunately in html it will display as
<input type="image" name="imgButton" id="imgButton" src="~/Presentation/Resources/Images/addFile.png" style="border-width:0px;">
My question is: what should I write if I want to get the relative path "../../" with "~"? I tried this, but I can't get it.
<script type="javascript"> document.getElementById("<%= imgButton.ClientID %>").src = "~/Presentation/Resources/Images/PDF.png"; </script>
DEN Sep 13 2018-11-11T00: 00Z
source share