12-11-06 12:21 PM
Hallo svdkooij,
yes, this is possible solution, but I thing you are not bringing any
new data (otherwise you need to save a specified date state of
postings) into a placeholder. And doing this, you will store your
placeholders (into this bounded one) from a last time posting is
edited. (I would recommend you to keep number of placeholders as low as
possible - just for performance)
And it is possible to save posting's placeholder in you custom control,
use similar way you are reading your posting placeholders data. It is
not necessary to put it into SavePlaceholderContent (just for your
info).
bye, Martin
svdkooij napsal:[vbcol=seagreen]
> It has to be an placeholder webcontrol otherwise there is no good way
> to save the selected text to the BoundPlaceholder using the
> "SavePlaceholderContent()" methode.
>
> I managed to get the current channel from where to custom placeholder
> is operationg using:
>
> Channel channelCurrent = this.BoundPlaceholder.Posting.Parent as
> Channel;
>
> To get de DropDownList filled up I wrote the following code:
>
> protected override void CreateAuthoringChildControls(BaseModeCon
tainer
> authoringContainer)
> {
> if(this._autoFill) // _autoFill is public property set at design
> time (bool)
> {
> Channel channelCurrent = this.BoundPlaceholder.Posting.Parent as
> Channel; // get the current channel
> this._editDropDownList = new DropDownList();
> foreach( Posting p in channelCurrent.Postings)
> {
> string strPlaceholderContent =
> ((HtmlPlaceholder)p.Placeholders[this.PlaceholderToBind]).Html;
> this._editDropDownList.Items.Add(new
> ListItem(strPlaceholderContent, strPlaceholderContent));
> }
> authoringContainer.Controls.Add(this._editDropDownList);
> }
> else
> {
> // code when _autoFill is false (show normal textbox)
> }
> }
>
> I just have to figure out how to switch between the textbox and de
> dropdownlist. If the dropdownlist is always visible instead of the
> textbox no new line can be entered.
>
> markcz wrote:
[ Post a follow-up to this message ]
|