Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

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
Aug 31, 2005 12:18
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(...);
Aug 31, 2005 15:10
* 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.