Rank: Devotee
Joined: 12/15/2006 Posts: 40
|
Hi, This must be a common scenario, so I'm wondering what the best method is.
I have a user control which displays a form and that requires a large block of html content to be displayed after the form is submitted. Eg. "Thank you for submitting my form."... although it will be more complicated than that.
The same user control is used on a few different pages and I want each page to have different content displayed after the form is submitted. I would like to be able to edit this content in Umbraco.
The normal way of passing values to a user control, using public properties and macro properties, doesn't allow for large amounts of rich html.
Alternatively, I could use the umbraco library's GetProperty method to access a "richtext" property on the containing page. I dislike doing this though because it violates the layered architectural approach in which umbraco is my bottom layer, hidden from the user control. For example, if I changed the name of the property I would have to remember to recompile the user control too. But if this is the only way, then I can do it.
Is there another alternative?
Also, I would like to be able to pass in "wildcards" that the user control can replace. For example: "Thank you #username# for submitting my form". #username# will then be replaced with the name of the person using the form.
This shouldn't be too hard to achieve just using string.Replace, but again this is a ugly from a layered-architecture/information-hiding point of view.
Any thoughts?
|
 Rank: Addict
Joined: 7/19/2006 Posts: 790 Location: Århus, Denmark
|
Maybe you could modify your own suggestion with displaying a richtextfield. You could pass the property alias of the field to be shown as a parameter like fieldalias="myThankYouFieldAlias" Or do you not want the usercontrol to be umbraco specific at all?
|
Rank: Devotee
Joined: 12/15/2006 Posts: 40
|
Actually that does sounds like a good compromise. Great idea!
|