This new enhancement enables developers to access the controls in the DialogBox's ContentTemplate directly in the code behind without have to use FindControl method. This enhancements increases code efficiency and reduce complexity. It also avoid the need to perform casting.
![]() |
If you have developed Web form using the previous version of WebDialogBox, your Web form should be able to run properly without the need to perform upgrades. However, it is highly recommended that you take advantage of the benefits introduced with this new enhancement. |
Previously, you will need the following codes to access a server control in ContentTemplate of a WebDialogBox:
| C# | Copy Code |
DropDownListdropdown = (DropDownList)dlgBox.FindControl("DropDownList1");
| |
Now, you only need a single line of code:
| C# | Copy Code |
this.DropDownList1.Items.Add(new ListItem("Item 1", "Item 1")); | |
Related Sections
Keep Visible On Scroll
Background Shadow Color and Opacity
Show Dialog with Animation
Modeless mode
Vista-style animation
Other Resources
V2.5

Copy Code