How to convert string to valid virtual path?
-
Hi All I am facing a challenge regarding URL. I am generating URL at runtime 'http://mysitename//Pages//Category.aspx?cat=eSOLPublicationCatalogOnNet&category=General exams' And I am getting an error 'http://mysitename//Pages//Category.aspx?cat=eSOLPublicationCatalogOnNet&category=General exams' is not a valid virtual path. Here General exams is having an error .It is showing it is not a valid virtual path. If i replace blank spaces with %20 in "General exams".Then it is working fine. Please guide. Thanks Regards Sandeep Kalra
-
Hi All I am facing a challenge regarding URL. I am generating URL at runtime 'http://mysitename//Pages//Category.aspx?cat=eSOLPublicationCatalogOnNet&category=General exams' And I am getting an error 'http://mysitename//Pages//Category.aspx?cat=eSOLPublicationCatalogOnNet&category=General exams' is not a valid virtual path. Here General exams is having an error .It is showing it is not a valid virtual path. If i replace blank spaces with %20 in "General exams".Then it is working fine. Please guide. Thanks Regards Sandeep Kalra
You seem to have answered your own question, the url must be encoded http://msdn.microsoft.com/en-us/library/zttxte6w.aspx[^]
I know the language. I've read a book. - _Madmatt
-
Hi All I am facing a challenge regarding URL. I am generating URL at runtime 'http://mysitename//Pages//Category.aspx?cat=eSOLPublicationCatalogOnNet&category=General exams' And I am getting an error 'http://mysitename//Pages//Category.aspx?cat=eSOLPublicationCatalogOnNet&category=General exams' is not a valid virtual path. Here General exams is having an error .It is showing it is not a valid virtual path. If i replace blank spaces with %20 in "General exams".Then it is working fine. Please guide. Thanks Regards Sandeep Kalra
you can use HttpUtility.UrlEncode to add the %20.
JimBob SquarePants ******************************************************************* "He took everything personally, including our royalties!" David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager *******************************************************************