Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to convert string to valid virtual path?

How to convert string to valid virtual path?

Scheduled Pinned Locked Moved ASP.NET
tutorialhelpquestionlounge
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    THE SK
    wrote on last edited by
    #1

    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

    N J 2 Replies Last reply
    0
    • T THE SK

      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

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • T THE SK

        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

        J Offline
        J Offline
        JimBob SquarePants
        wrote on last edited by
        #3

        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 *******************************************************************

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups