Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Client Script Changing/encoding Values 1

Status
Not open for further replies.

Dashley

Programmer
Dec 5, 2002
925
US
Hi,

I'm running this code"
Code:
Dim ShowArchiveFileIs as string = ("Articles\bbn07282015.htm")

       Dim url As String = ShowArchiveFileIs
                Dim sb As New StringBuilder()
                sb.Append("<script type = 'text/javascript'>")
                sb.Append("window.open('")
                sb.Append(url)
                sb.Append("');")
                sb.Append("</script>")
                ClientScript.RegisterStartupScript(Me.GetType(), "script", sb.ToString())

When the page opens it fails and shows the url as "
Seems it's encoding a piece of my string. the "\b" is getting encoded to %08

Is there a way to prevent this from happening

Thanks

-dan
 
Hi Dan,

use a foreslash. URLs do not use backslashes.
Code:
Dim ShowArchiveFileIs as string = ("Articles/bbn07282015.htm")
;-)

"Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family." (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
Hi MakeItSo

HA HA I knew that. Key word is "knew" Geesh do I feel a bit dumb.
Thank you very much :)

-dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top