Click here to Skip to main content
15,880,854 members
Articles / Web Development / HTML

The AnywherePlaceHolder. Part 3. The AnywhereValidationSummaryPlaceHolder

Rate me:
Please Sign up or sign in to vote.
3.92/5 (4 votes)
8 Sep 20054 min read 29.6K   385   25  
Eliminating the boundaries of frames. Writing your ASP.NET controls on any desired location in any frame.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Function : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
		// You can choose to add controls programmatically or in the HTML designer.

		Button dosomething = new Button();
		dosomething.Text = "Do something";
		dosomething.UseSubmitBehavior = false;

		this.ButtonPlaceHolder.Controls.Add(dosomething);

		Button submit = new Button();
		submit.Text = "Submit";
		submit.UseSubmitBehavior = true;

		this.ButtonPlaceHolder.Controls.Add(submit);

		if (this.IsPostBack)
		{
			Label l = new Label();
			l.Text = "Page has been posted back";
			this.Form.Controls.AddAt(0,l);
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Netherlands Netherlands
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions