Hadesara
Hadesara

Reputation: 159

convert guid tostring in javascript .net

How do I convert guid to string in javascript. I am getting guid from the querystring, and m not able to process it as is. I have tried the following ways to do it but it doesnt seem to work.

var guid = {<%=Request.QueryString["Guid"]%>}.toString();
var guid = <%=Request.QueryString["Guid"]%>.toString();
var guid = (string)<%=Request.QueryString["Guid"]%>;
var guid = (string){<%=Request.QueryString["Guid"]%>};

Any suggestions?

Upvotes: 2

Views: 8644

Answers (2)

Quintin Robinson
Quintin Robinson

Reputation: 82335

Try quoting the string, this should work...

var guid = '<%=Request.QueryString["Guid"]%>';

Upvotes: 4

Tony Abrams
Tony Abrams

Reputation: 4673

Have you tried just:

var guid = {<%=Request.QueryString["Guid"]%>}

Upvotes: 0

Related Questions