London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Container.CurrentPage won't use Codebehind...

Vote:
 
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
#17438
Aug 31, 2005 12:18
Vote:
 
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(...);
#18202
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.