imgFlag extension function compile problem

Topics: Controls
Jun 4, 2012 at 5:21 AM

Hi.

I`m quite new in .NET 4 and after I upgraded Blogengine 2.0 to 2.6 I got different errors. I was anable solve lots of them than to Google (:-)) but this one still resist my effors. When compiling on the server or on local, I get this error. Or I`m missing the file with the definition imgFlag extension function or there is some using directive missing. I did not fiddle with source code, so i don`t know why this error.

Error 4 The name 'FlagUrl' does not exist in the current context D:\Data\Visual Studio 2010\WebSites\blog.yamasa.ws\news2\User controls\CommentView.ascx 58

<span class="CommentFlag">
<img id="imgFlag" src="<%= FlagUrl() %>" alt="Country flag" width="16" height="11" />
</span>


and 


Error 5 'UserControls.CommentView' does not contain a definition for 'imgFlag' and no extension method 'imgFlag' accepting a first argument of type 'UserControls.CommentView' could be found (are you missing a using directive or an assembly reference?) D:\Data\Visual Studio 2010\WebSites\blog.yamasa.ws\news2\User controls\CommentView.ascx.cs 892 18 D:\...\news2\

private void SetFlagImageUrl()
{
this.imgFlag.ImageUrl = !string.IsNullOrEmpty(this.ddlCountry.SelectedValue)
? string.Format(
"{0}pics/flags/{1}.png",
Utils.RelativeWebRoot,
this.ddlCountry.SelectedValue)
: string.Format("{0}pics/pixel.png", Utils.RelativeWebRoot);
}