Reputation: 159
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
Reputation: 82335
Try quoting the string, this should work...
var guid = '<%=Request.QueryString["Guid"]%>';
Upvotes: 4
Reputation: 4673
Have you tried just:
var guid = {<%=Request.QueryString["Guid"]%>}
Upvotes: 0