Create new URL for API results URL RRS feed

  • Question

  • User1122679459 posted

    I'm not sure how to explain what I'm trying to do but here it goes...

    I want to hide URLs and create a sort of reference URL in my app from the URLs that are being returned in the results of an API. So whey my URL is clicked, the original URL I received from the API will load in the browser.

    The API returns URLs as:


    I'd like to create my own, maybe something like:


    Tuesday, July 29, 2014 9:37 AM


All replies

  • User895691971 posted

    I was working with this functionality for really a very long time and I never understood how to handle the Query Strings on the very first page (Index.cshtml or Default.cshtml). However this very functionality always worked for me when I do it on some sub page, but not on the main page. 

    What I always got the answer from this forum was to use ASP.NET Url Routing. 


    This is a post, which might be helpfull for you to understand this function.

    Tuesday, July 29, 2014 11:57 AM
  • User1122679459 posted

    Thanks Afzaal, I read through it but really looking for other alternatives.

    Also want to mention that I'm not using web forms or MVC...if that matters.

    Anyone else have an idea?

    Tuesday, July 29, 2014 2:06 PM
  • User895691971 posted

    Web Forms and MVC just have the implementation differences, the code that can be used is same. So any idea that is working in MVC, you can use it in Web Pages just by changing it a little bit. 

    I used the very same thing in Web Pages, but as I mentioned, this feature doesn't work in the Default.cshtml page (atleast in my case). So you can't have that to work, untill you use Url Routing service in web.config or some other task like that. Web Pages, as far as I know, doesn't allow this feature in Default.cshtml.

    Tuesday, July 29, 2014 3:37 PM
  • User-1454326058 posted

    Hi olavarrieta,

    To hidden the original URL, we could use IIS Rewrite.

    More information, please refer to:

    # Creating Rewrite Rules for the URL Rewrite Module


    For the ASP.NET application, you may use ASP.NET Routing.

    More information, please refer to:

    # ASP.NET Routing



    Best Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 30, 2014 2:32 AM