views:

39

answers:

1

Ive got Note field with FullHTML turned on. I'm trying to storage an image tag with src that points to the server I'm currently on. I set the field to:

<img src="http://servername/_layouts/images/Company/test.jpg" />

I then immediately try to read the value back out, and I get:

<img src="/_layouts/images/Company/test.jpg" /> 

SharePoint has graciously stripped it's own servername out of the url to make it relative. This is going out in an e-mail so I need it to be absolute.

Anyone know how to stop this behavior?

A: 

This is good behavior, if you migrate the site somewhere else it will still work :) You could probably write an event handler on your list to undo this.

How does the "This is going out in an e-mail so I need it to be absolute." work?

Seems like a custom process? Why don't you add making absolute links there.

ArjanP
I agree in most scenarios it is good behavior, just not desirable in this one. The value of the field is sent out in the body of an HTML e-mail. There is a whole process the e-mail generation goes through with these URLs. The URLs in the e-mail needed to be fixed up to be absolute beforehand which was no problem and was in fact taken care by an event handler somewhere else. Before the e-mail is sent though, it's information is saved and re-queried from the list (not my decision) so my URLs are relative again. I was just hoping to not have to perform the same fix-up in two different places.
CNutt