Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URL Rewriter - Relative Links DO Not Work anymore

Status
Not open for further replies.

rf222

Programmer
Jan 29, 2004
94
US
The MSDN article about URL Rewwriter is great but it does not address the issue with relative paths. If the rewritten URL has a different path than the originnal the relative links on the page will not work Is there a way to resolve this problem?

Original link:


Rewritten link:


This is the link created on CSK catalog page:

<ItemTemplate>

<a href="catalog.aspx?cid=<%#Eval("categoryid") %>" class="subcategory"><%#Eval("categoryName") %></a><br/>


</ItemTemplate>

It will become:


yet it should really be:


The item template SHOULD USE the rewritten path, which is instead of using the original path
 
rf222: not sure how your m=13 is getting into the link since:
Code:
<a href="catalog.aspx?cid=<%#Eval("categoryid") %>" class="subcategory"><%#Eval("categoryName") %></a><br/>

..tanslates to:

"../catalog.aspx?cid=10"
Have you tested the Server.MapPath("catalog.aspx") approach? If it is just the hyperlink not behaving seems like a simple adjustment of the "../" or "./" syntax should take care of it. Just a thought rf, let us know how its coming along.
 
Thanks,

just ignore m parameter my mistake...

I did this using HTTP rerwiter... The problem is there are hundreads of links in the application and the new update is coming once in a while...
 
I was thinking if I could

Change or Overwrite the bahaviour of the way full path is connstructed by .NET based on relative link

property, event???

 
I see what you're trying to shoot for. Perhaps one of the other assistants here can drop by in the morning (or later tonite) and give you some more detailed guidance.

My first impression would be to circumvent the string in code (string append, etc) - without having to overwrite or re-create conditions, etc. - but of course in the end that could be what you exactly need. Wish I could be of more help f222 - get a lead going of some sort (perhaps do a quick search on Google groups (date restrict to say last 18 months) and see what you come up with. I think we'll get to the bottom of this.
 
Thanks, I afraid that this is a core bahaviour of ASP.NET engine (machine code) and can not be rwritten. Wonder what property of the Resposnse object it is exactly using to translate relative link to full link.

I would guess it is my rewritten path, that is why the relative links do not work...

Wonder if there is any work around. Here is corrected URL Rewriting schema:

Original link:


Rewritten link:


Please notice different path in above, that is why relative links do not work...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top