Intersoft WebDesktop Documentation
Direct Control Access in Template
See Also Send Feedback
Intersoft WebDesktop > Release History > V2.5 > WebDialogBox > Direct Control Access in Template

Glossary Item Box

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 ImageCopy Code
DropDownListdropdown = (DropDownList)dlgBox.FindControl("DropDownList1"); 


dropdown.Items.Add(new ListItem("Item 1", "Item 1"));

Now, you only need a single line of code:

C# Copy Code
this.DropDownList1.Items.Add(new ListItem("Item 1", "Item 1"));              

See Also

© 2012 Intersoft Solutions Corp. All Rights Reserved.