Search code examples
.netjavascriptguidrequest.querystring

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?


Solution

  • Try quoting the string, this should work...

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