Thursday, 29 December 2011

Dynamic Calendar Extender in Ajax Control Toolkit

Here we are going to create a textbox and Ajax Calendar Extender dynamically.

TextBox textbox = new TextBox();
textbox.ID = this.ID + "Textbox";
textbox.Text = this.EditableField.TextValue;
textbox.TextChanged += new EventHandler(HandleTextboxTextChanged);
textbox.Width = new Unit(100, UnitType.Pixel);
CalendarExtender calExender = new CalendarExtender();
calExender.PopupButtonID = "Image1";
calExender.TargetControlID = textbox.ID;

The form should contain toolkit script manager.

No comments:

Post a Comment