|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Inline Expression ResolutionI have a particular situation where I'd like to serve up the content of essentially static html coming out of a database for a website. I've created a generic user control to actually handle retrieving the html text and I've overridden the RENDER method to render the html at the point the control is rendered (the static text actually sits inside a master template page and the static control is dynamically created on the master page) All this works fine as it is. However, I'd like to be able to use small inline expressions (of the form <%= FunctionName() %> at various places in the otherwise static html and have those expressions evaluated when the page is rendered, just like a normal ASPX or ASCX page. But that doesn't seem to work, when you write the text as output through the HTMLTextWriter you get through the RENDER method I assume I'm not inserting the html early enough in the rendering pipeline. Would anyone have any ideas how to go about doing this (or maybe there's a better way to accomplish the same thing that I'm not familiar with? Thanks Darin Instead of using Render, place the html into the text property of a literal,
then your html will display, and your code will execute when the page is rendered. Show quoteHide quote "Darin" wrote: > Hi everyone: > > I have a particular situation where I'd like to serve up the content of > essentially static html coming out of a database for a website. > > I've created a generic user control to actually handle retrieving the > html text and I've overridden the RENDER method to render the html at > the point the control is rendered (the static text actually sits inside > a master template page and the static control is dynamically created on > the master page) > > All this works fine as it is. > > However, I'd like to be able to use small inline expressions (of the > form > <%= FunctionName() %> at various places in the otherwise static html and > have those expressions evaluated when the page is rendered, just like a > normal ASPX or ASCX page. But that doesn't seem to work, when you write > the text as output through the HTMLTextWriter you get through the RENDER > method > > I assume I'm not inserting the html early enough in the rendering > pipeline. > > Would anyone have any ideas how to go about doing this (or maybe there's > a better way to accomplish the same thing that I'm not familiar with? > > Thanks > Darin > >
databind - XmlNodeList to DropDownList
Need reviews and advice on web and data control tools and vendors custom web controls and conversion to inline code DataGrid NOT Paging No Frames?? how to get client cpu id Reach UserControl from ASPX codebehind? Programmatically changing CssStyle on Panels depending on DB values A program about get value from datagrid cell PHP guy turned ASP needs pointers |
|||||||||||||||||||||||