views:

494

answers:

1

The following line gives an error (cannot convert type "string" to "System.Guid")

userId = Request.QueryString["id"];

is there any solution to pass Guid variable in http header Get?

+3  A: 
try {
    userId = new Guid(Request.QueryString["id"]);
} catch (FormatException e) {
    /*
     * It's possible that the guid is not properly formatted and an
     * exception will be thrown, so handle that here.
     */
}
Sean Bright
Thanks, it works, I spent long time searching for a solution
ahmed
Really, did you ??
Cerebrus