I am getting the error on the below code in asp.net 4.0
You can use ResolveUrl with Eval like this. No external code needed.
ResolveUrl
Eval