I have a div with a background image who's url is not being bound when the page loads. The URL is set in a get method in the code behind. Not sure what I'm doing wrong here.
The HTML:
<div class="decorator" style="background: transparent url(<%# HeadlineBackgroundImagePath %>) top center no-repeat; height: <%# HeadlineBackgroundImageHeight %>px;">
The code behind:
protected string HeadlineBackgroundImagePath
{
get
{
return ($CompanyContext.Entity as IPPCUpdateEntity).HeadlineBackground.ShortSrc;
}
}
protected int? HeadlineBackgroundImageHeight
{
get
{
return ($CompanyContext.Entity as IPPCUpdateEntity).HeadlineBackground.Height;
}
}
When the page loads, I get something like this (notice nothing is in the URL):
<div class="decorator" style="background: transparent url() top center no-repeat; height: px;">
I've gone into debugger, set a breakpoint on the property, but the site doesn't even call up the property.