Raed:
Javascript, like C#, uses \ to escape values. So when you do
c:\\something\\else in c#, the string value is actually c:\something\else.
However, javascript also needs slashes escapes.
Two solutions is to change your string to:
"c:\\\\public\\\\user\\\\other";
or to escape it via:
@"c:\\public\\user\\other";
You should probably create a utility function which takes a string and
prepares it for javascript, namely escaping slashes as well as single
quotes.
Hope this helps
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Raed Sawalha" <Ra*********@discussions.microsoft.com> wrote in message
news:0E**********************************@microsof t.com...
i have an aspx page in the code behind i have
in aspx.cs
public string sPath = "C:\\Public\\User\\Other";
is aspx when I tried to get the string the slahes is gone i tried to alert
the string it gave me C:PublicUserOther , why?
<script language=javascript>
function CreateFolder()
{
var Path = '<%= sPath %>'l
alert('<%= sPath %>');
}
</script>
any help?