Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Guid in Querystring is being transformed somehow

I am not sure why this is occuring but here are a few details that may help to find a solution:

  • It seems to work correctly on most computers firefox and IE
  • It occurs to certain Guids as others work
  • We put the firewall in monitor mode and still occurs

This is the line in PageModify.aspx building the query string:

Response.Redirect(string.Format("Editor.aspx?id={0}", pageId,
    CultureInfo.CurrentCulture));

This is the output of the query string when all goes correctly:

https://example.com/Editor.aspx?id=1dfz342b-3a4d-4255-8054-93916324afs6

This is what is viewed in the browser when redirected to Editor.aspx:

https://example.com/Editor.aspx?id=1dfz342b-3a4d-xxxxxxxxxxxxxxx324afs6

Of course we get an invalid guid error when this line runs:

_PageEditId= new Guid(Request.QueryString["id"]);

Has anyone seen this? Could it be IIS settings? Nothing special is being done here and everyone's systems has the same baseline. It occurs to inside and outside customers.

like image 916
Zippy Avatar asked Nov 09 '11 14:11

Zippy


1 Answers

A Guid is a Structure, so you have to parse it when it comes through the querystring as a String:

Guid PageEditId = Guid.Parse(Request.QueryString["id"]); //add null checks or use TryParse
like image 142
rick schott Avatar answered Nov 19 '22 22:11

rick schott