TLDR: Outbound rules are not applying within updatepanel partial postbacks
I'm Using the IIS 7.5 URL Rewriter to map image paths to a cdn.
Here's a simplified version of what's happening
<Repeater Goes Here> <img alt="alt text" src="<%#getImageSource(Eval("Filename").ToString() )%>"> <End of Repeater>
let's say the function getImageSource returns
"/images/someimage.jpg"
this in turn rewrites to
<img alt="alt text" src="http://img.cdn.com/someimage.jpg">
the outbound rule that makes this work is:
<rule name="Out_Rewrite_ServeCookieLessImages" preCondition="ResponseIsHtml" enabled="true"><match filterByTags="Img" pattern="^/Images/(.*)$"/><action type="Rewrite" value="http://img.cdn.com/{R:1}"/></rule><preConditions><preCondition name="ResponseIsHtml"><add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html"/><add input="{URL}" pattern="\.axd.*$" negate="true"/></preCondition></preConditions>
The problem is that when using the repeater inside an Update Panel
the actual html that's outputted after an async postback is
<img alt="alt text" src="/Images/someimage.jpg">
instead of
<img alt="alt text" src="http://img.cdn.com/someimage.jpg">
How would i make the updatepanel parse the output correctly?
Thanks in advance