Last post Jul 30, 2014 02:32 AM by Starain chen - MSFT
Jul 29, 2014 09:37 AM|olavarrieta|LINK
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:
Jul 29, 2014 11:57 AM|Afzaal.Ahmad.Zeeshan|LINK
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.
Jul 29, 2014 02:06 PM|olavarrieta|LINK
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?
Jul 29, 2014 03:37 PM|Afzaal.Ahmad.Zeeshan|LINK
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.
Jul 30, 2014 02:32 AM|Starain chen - MSFT|LINK
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.
# ASP.NET Routing