Hey everyone,
I have a string with special characters insert in different places. For example:
string myString = "This is a textbox: ##";
I would like to replace the ##
with a control (namely, a textbox).
The Replace
method only allows the string to be replaced with another string or character (understandably). But what would be the best way to dynamically replace the ##
with a control in its position?
I was thinking maybe I could replace it with HTML markup which would be executed, but not quite sure how that would be achieved.
Thanks
EDIT: To clarify some details. The strings are being retrieved from a database, so I can't use the PlaceHolder control. The user selects a string from a drop-down list. The value of the item is the string with special characters. When the postback occurs from the item selection, I would like to display the string on the site, but replace the special characters with a fully working control (in this case, a textbox)