Link to home
Start Free TrialLog in
Avatar of gonzalogn
gonzalogn

asked on

Using the operator ~ asp.net in Client Elements.

How can I use the operator ~ in Client Elements.

I need to use the operator ~ in client elements like is used in asp.net server controls.
By example :
1)      Writing javascript code:  parent.location.href('~/Pages/Test.aspx');
2)      body1.Style.Add("background-image", "url(~/imagens/back_logo_co.jpg)");

I was using Request.ApplicationPath but not worked.

Thanks for your help.
Avatar of mrwad99
mrwad99
Flag of United Kingdom of Great Britain and Northern Ireland image

Have a read of http://msdn2.microsoft.com/en-us/library/ms178116.aspx,.  This describes it all.

HTH
Avatar of gonzalogn
gonzalogn

ASKER

Dear mrwad99,

The link is the same of Microsoft documentation help but not resolving my problem.

I found the solution myself,  the method ResolveClientUrl(“~”), but only works in .NET Framework version 2.0

The Microsoft documentation sometimes is difficult to find alternatives options.
By example: I was seeking the ~ asp.net operator and doesn’t have any link alternative documentation to find ResolveClientUrl or ResolveUrl.

Thanks anyway!
OK, if you have found the solution, request refund of your points in community support :)
ASKER CERTIFIED SOLUTION
Avatar of AnnieMod
AnnieMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial