Q.1 Explain “AutoPostBack”?
Ans: In ASP.NET if we want the control to automatically post back after any event, we should check it as true. For example in a Combo Box change we want to send the event immediately to the server side then check “AutoPostBack” attribute to true.
Q.2 Explain how to enable automatic paging in Data Grid?
Ans: Steps to enable paging in Data grid are:
(1) Set “Allow Paging” true.(2) In "PageIndexChanged" event set the current page index clicked.
(1) Set “Allow Paging” true.(2) In "PageIndexChanged" event set the current page index clicked.
Q.3 Explain what is "EnableViewState" property?
Ans: This property enables the viewstate on the page. It allows the page to save the users input on a form.
Q.4 How can we know that the Page is Post Back?
Ans: We can know that the page is PostBack by checking its “IsPostBack” property.
Q.5 Which valiation control is used to match values in two different controls?
Ans: CompareValidator Control
Q.6 How to assign page specific attributes?
Ans: Using the "@Page directive".
Q.7 Which method is invoked on the DataAdapter control to load your generated dataset with data?
Ans: Fill()
Q.8 Name the tags that you need to add within the asp:datagrid tags when you bind columns manually?
Ans: Set AutoGenerateColumns Property to false on the datagrid tag
Q.9 Explain AppSetting Section in “Web.Config” file?
Ans: It defines configuration for a web project. Using “AppSetting” section, we can define user-defined values. Example below defined is “Connection String”
section, which is used through out the project for database connection.
<Configuration>
<appSettings>
<add key="ConnectionString" value="server=xyz;pwd=www;database=testing" />
</appSettings>
section, which is used through out the project for database connection.
<Configuration>
<appSettings>
<add key="ConnectionString" value="server=xyz;pwd=www;database=testing" />
</appSettings>
Q.10 Which template is provided, in order to display data in a Repeater control?
Ans: ItemTemplate
Q.11 What are the two properties common in every validation control?
Ans: ControlToValidate property and Text property.
Q.12 What is the difference between inline and code behind.
Ans: Inline code is written along side the html in a page while Code-behind is code written in a separate file and referenced by the .aspx page.
Q.13 Name some validation controls are provided by ASP.NET?
Ans: Main types of validation controls are
RequiredFieldValidator
RangeValidator
CompareValidator
RegularExpressionValidator
CustomValidator
Validation Summary
RequiredFieldValidator
RangeValidator
CompareValidator
RegularExpressionValidator
CustomValidator
Validation Summary
Q.14 Explain RequiredFieldValidator.
Ans: It checks whether the control have any value. This control is used when you want the control should not be empty.
Q.15 Explain RangeValidator.
Ans: This control checks if the value in validated control is in that specific range. Example TxtCustomerCode should not be more than eight lengths.
Q.16 Explain CompareValidator.
Ans: This control checks that the value in controls should match some specific value. Example Textbox TxtPie should be equal to 3.14.
Q.17 Explain RegularExpressionValidator
Ans: When we want that the control, value should match with a specific regular expression.
Q.18 Explain CustomValidator
Ans: This control is used to define User Defined validation.
Q.19 Validation Summary
Ans: This control displays summary of all current validation errors on an ASP.NET page.
Q.20 In which event are the controls are fully loaded?
Ans: In Page load all controls are fully loaded.
Q.21 Which property on a Combo Box is used to set with a column name, prior to setting the DataSource, to display data in the combo box?
Ans: DataTextField property
Q.22 Explain event bubbling?
Ans: Server controls like Data grid, Data List, and Repeater can have different child controls inside them. For example Data Grid can have combo box inside data grid. These child controls pass there events to the container parent,which passed to the page as “ItemCommand” event. As the child control send events to parent it is termed as event bubbling.
Q.23 Explain "EnableViewState" property? Why would you need it on or off?
Ans: This property enables the viewstate on the page. It allows the page to save the users input on a form.