How to create a new unique ID for a control?

ControlName.ID = “ControlName” + Guid.NewGuid().ToString(); //Make use of the Guid class

How can we set the Focus on a control in ASP.NET?

TxtBox123.Focus (); OR Page.SetFocus (NameOfControl);

How to make sure that value is entered in an asp:Textbox control?

Use a RequiredFieldValidator control.

Difference between datagrid and repeater?

Repeator Control:
1)Read-only; no inherent support for selection or editing ·
2)No inherent look; you lay out the list by creating templates.
3)List can be vertical, horizontal, all on one line, or in any format you specify. ·
4)No default paging; all data is displayed in a single list. ·
5)Separators between elements can be defined using a template

1)Default look is a grid (customizable table) ·
2)Can customize look of table extensively. ·
3)Options for auto-formatting. ·
4)Can specify output using bound columns, columns of buttons or hyperlinks, and custom
columns created using templates. ·
5)No separator template. However, the grid renders in a table, and you can specify table border size and color. ·
6)WYSIWYG template editing ·
7)Items support styles for custom look. ·
8)Editable contents, including deletion ·
9)Single and multiple selection ·
10)Optional paged output ·Support for sorting ·
11)Support for custom functionality that can be applied to items

What are trace switches?

Trace switches helps us to control and govern the tracing behavior of a project.

What is the property you need to set for the custom validator control that specifies the event handler?


What is Regular Expression Validator?

When we want the control, value should match with a specific regular expression.