"Cannot get inner content of frm1 because the contents are not literal." error in building a dynamic form within other HTML

Hi, 
I am trying to build an aspx form dynamically but I have to user some HTML tags among controls. I am getting the error "Cannot get inner content of frm1 because the contents are not literal." in my 
oForm.InnerHtml += "</fieldset>";
instruction. If I put it before adding the text and button controls to the form the error is gone. What am I doing wrong, if I want the controls to be inside a <fieldset> ... </fieldset> tag?
public void LoadForm()
HtmlForm oForm = new HtmlForm();
oForm.ID = "frm1";
oForm.Action = "";
oForm.InnerHtml += "<fieldset>";
oForm.InnerHtml += "<legend> ### TITALO ### </legend>";
HtmlInputText oText = new HtmlInputText();
oText.ID = "txt";
HtmlInputSubmit oSubmit = new HtmlInputSubmit();
oSubmit.ID = "btn";
oSubmit.Value = "submit";
oForm.Controls.Add(oText);
oForm.Controls.Add(oSubmit);
oForm.InnerHtml += "</fieldset>";
main.Controls.Add(oForm);
Thanks, regards. 
Bruno

According to articles (e.g.
http://forums.asp.net/t/939432.aspx?Panel+GroupingText), in order to include a
<fieldset>, you can use a Panel control having GroupingText
attribute. Therefore, instead of dealing with InnerHtml, try this:
var panel = new Panel { GroupingText = "### TITALO ###" };
panel.Controls.Add(oText);
panel.Controls.Add(oSubmit);
oForm.Controls.Add(panel);
main.Controls.Add(oForm);

Similar Messages

Maybe you are looking for

  • Conversion Error in IDOC  : Unicode to Non-Unicode System

    EBP system (Unicode) posting goods movement to 4.6C (non-Unicode) using message type MBGMCR ( Function module - IDOC_INPUT_MBGMCR). **In Non-Unicode System*** Idoc INBOUND error : Status 51 An error has occurred assigning data (E1BP2017_GM_ITEM_CREAT

  • Email HTML page

    I want to create the sort of HTML page that automatically shows in an email. I've got Adobe Creative Suite 3. I've searched all the manuals and help sites but drawn a blank so far. It doesn't help that I don't even know what it is officially called.

  • Need to find mail on TIme Machine backup

    My wife uses our POP mail account from AT&T. She had a couple of E-mails flagged in OSX mail and they disappeard earlier this week. I am backing up my HD with time machine. How can I go back in time, to find the E-mails that have disappeard? Thanks i

  • How do I post an animation in my email

    I would like to have an animation run in some emails automatically. for example a horse running in the email. Is this possible?

  • E-rec: Can we delete a Job Posting?

    e-rec experts, Our users inadvertently create Job Postings in the Requisition.  We need to get rid of the unwanted postings. Is there a way to delete Job Postings. -Dominic