What is an Associated ControlID?

This is the property defined for a Label control in 2.0, which provides linking to an interactive control such as textbox,button,listbox and other asp.net controls. It defines a hot key which moves the input focus to the control defined in the property. <asp:Label ID=’Label1′ runat=’server’ AssociatedControlID=’TextBox1′ Text=’Enter Ur Details’ Width=’86px’></asp:Label> <asp:TextBox ID=’TextBox1′ runat=’server’></asp:TextBox> In the above code, TextBox1 gets focused on clicking the Label1, sinced its AssociatedControlID is set to TextBox1.

How can an ListItem in the ListControl can be avoided from being displayed but it must remain in the collection?

In ASP.NET 2.0 List by setting Enabled=’False’ to the individual list item, entries avoids it from being displayed but it remains in the collection. It can be coded as below. <asp:ListBox ID=’ListBox1′ runat=’server’ > <asp:ListItem Enabled=’False’>Item 1</asp:ListItem> <asp:ListItem>Item 2</asp:ListItem> <asp:ListItem>Item 3</asp:ListItem> <asp:ListItem>Item 4</asp:ListItem> <asp:ListItem>Item 5</asp:ListItem> <asp:ListItem>Item 6</asp:ListItem> </asp:ListBox> Here Item1 remains in the collection but will not be displayed.

How can I check whether the file exists?

For all the File manipulation function the namespace System.IO; has to be included. The existence of a file can be checked by the following syntax , File.Exists(path); where path is the path of the file name. The code can be as. if(File.Exists(‘C:\\dict.txt’)) { Response.Write(‘File Exists’); } else { Response.Write(‘File Not Found’); }

How can I include file through the ASPX?

The files can be included by the following syntax <!–include file=’filename’–> <table> <tr> <td> <!–#include file=’sample.html’–> </td> </tr> </table> Now the sample.htm will be displayed in the aspx page.