Well, i understand my title is a bit confusing. I will state it clearly below with the example.
<asp:ImageButton ID="imgButton" NavigateUrl="~/Presentation/Resources/Images/addFile.png" runat="server" />
In html, the control above will be rendered as
<input type="image" name="imgButton" id="imgButton" src="../../Resources/Images/addFile.png" style="border-width:0px;">
I notice that,it will convert the src from "~" to "../../" .It auto arrange it will the file level.
so in javascript, i want to set it the control with this url :
~/Presentation/Resources/Images/PDF.png
unfortunately, in html it will be rendered 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 wanna get the "../../" relative path with "~" ? I have tried this,but i cant get it.
<script type="javascript">
document.getElementById("<%= imgButton.ClientID %>").src =
"~/Presentation/Resources/Images/PDF.png";
</script>