Container.CurrentPage won't use Codebehind...

Hi, hope someone can help I am using this within my .aspx file: <%#getanswer(container.currentpage)%> and I have this Code behind: protected string GetAnswer (PageData page) { if ( this.CurrentPage["CharactersToShow"] == null ) return string.Empty; int MaxCharacters = (int)this.CurrentPage["CharactersToShow"]; return "nuts" + MaxCharacters.ToString(); //return TextIndexer.StripHtml( page["MainBody"] as string, MaxCharacters ); } Characters to show is on the parent page, but I can't get the code behind to execute. Anyone got an idea on this? Cheers Warren
Mar 25, 2008 19:33
Hello! <%#...%> is the data binding expression syntax. Is this part of the code included in a server control that is databound? If not, this code will never be executed. Try using <%=...%> which is short for Response.Write(...);
Mar 25, 2008 19:43
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.