How do I insert text at runtime (but not in codebehind)

  • Thread starter Thread starter Alan Pretre
  • Start date Start date
A

Alan Pretre

I need to place a piece of text into a page but the specific text is not
known at the time of the build. How can the webmaster define a string that
gets inserted into the page ** without modifying the aspx page **. I'm
thinking along the lines of a .txt file or something that can be
"#included". The text wouldn't change (hardly ever) once it is defined by
the webmaster. Sorry if this is a dumb question.

Thanks!

-- Alan
 
You can sotre the text anywhere you like - File, Database, System Registry,
to name just a few persistent mediums. However, using a server-siode include
is generally not a good OOP practice to use. Try using a Label or
PlaceHolder instead.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Kevin Spencer said:
You can sotre the text anywhere you like - File, Database, System Registry,
to name just a few persistent mediums. However, using a server-siode include
is generally not a good OOP practice to use. Try using a Label or
PlaceHolder instead.

Thanks. That's what I'm getting at. How can I put it in a text file or
something on the site and have the label fetch it in? My only requirement
is that the text not reside in the aspx page.

-- Alan
 
You put a label in the page. In the Page_Load event handler you assign the
Text property of the label from your source.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top