Thanks for the reply. As a followup, is there a way to ensure that this
ie, just before the </form> tag.
"Steven Cheng[MSFT]" wrote:
> Hi Stech,
>
> Welcome to MSDN newsgroup.
> I think your question is such a good one that I really never noticed it
> before. As far as I know, there hasn't any good means to accomplish such a
> "singleton Html section" task since we are injecting the html block in a
> custom webcontrol. And I think your suggestion on using the Page's
> Context.Items to store a flag is a good idea. In addition, we may also use
> some tricks such as add a control in the Page's Controls collection as
> flag , for example:
>
> protected override void Render(HtmlTextWriter output)
> {
>
> Label ctrl = Page.FindControl("my_flag_control") as Label;
>
> if(ctrl == null)
> {
> output.Write("<br>Shared Html!");
> ctrl = new Label();
> ctrl.ID = "my_flag_control";
> Page.Controls.Add(ctrl);
> }
>
> output.Write("<br>Main Control Content!");
>
> }
>
> But I still prefer the using Context one you mentioned since it's more
> reliable.
>
> Thanks,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure!
www.microsoft.com/security > (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>