bizform widget in code behind

Rita Mikusch asked on September 7, 2018 23:00

Hi,

I have a webpart with the following html:

<asp:PlaceHolder runat="server" ID="plcHolder">
<asp:Label ID="DisplayContent" runat="server" Text=""></asp:Label>
</asp:PlaceHolder>

The string in DisplayContent.text contains the following bizform widget ... oops, I'm going to have to resolve this dynamic control:
{^widget|(name)BizForm|(BizFormName)ChapterFeedbackForm|(widget_displayname)On-line+form^}

So as described in the API, I take the parent control and resolve it's dynamic controls ... BUT THIS DOESN'T WORK:
ControlsHelper.ResolveDynamicControls(this.plcHolder);

My other idea was to use resolve the macros in the string ... BUT THIS DOESN'T WORK EITHER:
DisplayContent.Text = MacroResolver.Resolve(DisplayContent.Text);

That bizform widget is not being resolved ... the text string still contains:
{^widget|(name)BizForm|(BizFormName)ChapterFeedbackForm|(widget_displayname)On-line+form^}

Does anybody have any ideas on how to make this work? From the VERY LITTLE I've been able to google, this should work ... but doesn't.

Thank you.

Recent Answers


Jan Hermann answered on September 9, 2018 10:34

ResolveDynamicControls is correct method to call. Is it executed after the literal is resolved?

0 votesVote for this answer Mark as a Correct answer

Rita Mikusch answered on September 10, 2018 21:43

Thank you! Since "ResolveDynamicControls" is the correct tool to use, I must be doing something else wrong.

I simply take the text that contains the bizform, and assign it to the text field of a label control:
DisplayContent.Text = VariableContainingBizFormText;

Here are the exact HTML controls I use:

<asp:PlaceHolder runat="server" ID="plcHolder">
<asp:Label ID="DisplayContent" runat="server" Text=""></asp:Label>
</asp:PlaceHolder>

Then I run ResolveDynamicControls on the parent control of the control that contains that "bizform text".
ControlsHelper.ResolveDynamicControls(this.plcHolder);

Maybe the label control is the wrong control to use for this? Or there's something else I need to 'turn on'?

thank you!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.