You are on page 1of 4

ASP.

NET Q&A
Which property specifies primary key for Datagrid?
Ans1. Primarykey
Ans2. DataFieldKey
Ans3. DataKey
Ans4. IndexKey
Correct Answer : 2

How do you read value of ID column from current row in SQLDataReader object
called SDR
Ans1. sdr("id")
Ans2. sdr.columns("id")
Ans3. sdr.row("id")
Ans4. sdr.Items("id")
Correct Answer : 1

How do you send control to page in such a way after the page is executed
control is returned to caller page?
Ans1. Response.Redirect
Ans2. Server.Transfer
Ans3. Server.Execute
Ans4. Response.Include
Correct Answer : 3

What is wrong with the following ASPX?

1: <form>

2: <asp:textbox id="textbox1" runat="server" />

3: <asp:button id="submit" text="submit" runat="server" />

4: </form>

Ans1. ID attribute of button cannot be submit as it is a keyword.


Ans2. Form tag must have runat attribute set to server
Ans3. Form tag must have id attribute
Ans4. The form is fine and there is no error in it.
Correct Answer : 2

Which you feel is the most important advantage of ASP.NET over


other technologies such as JSP, PHP?
Ans1. Productivity
Ans2. Performance
Ans3. Acceptance
Ans4. Economical
Correct Answer : 1

Which of the following controls is completely driven by templates?


Ans1. GridView
Ans2. DetailsView
Ans3. FormView
Ans4. BulledtedList
Correct Answer : 3

What property of PAGE can be used to determine whether webform is being


loaded because of server-side event of a web control?
Ans1. AutoPostBack
Ans2. IsPostBack
Ans3. PostBackLoad
Ans4. PostBack
Correct Answer : 2

Which of the following is a property of server object


Ans1. SessionTimeout
Ans2. ScriptTimeout
Ans3. Variables
Ans4. IsCookieLess
Correct Answer : 1

Which property can be used to identify the first request of the client
Ans1. Request.IsNewSession
Ans2. Request.NewSession
Ans3. Request.IsFirstRequest
Ans4. Request.IsNew
Correct Answer : 1

Which namespace contains .NET data provider for Oracle


Ans1. System.Data.Oracle
Ans2. System.Data.OracleClient
Ans3. System.Oracle
Ans4. System.Oracle.OracleClient
Correct Answer : 2

Which command is used to send a cookie to client


Ans1. Response.Cookies.Add()
Ans2. Cookies.Add()
Ans3. Server.WriteCookie()
Ans4. Response.AddCookie()
Correct Answer : 1

I want to have two textboxes in the same page with corresponding buttons.
But only one of these two textboxes should be validated.
Which feature of ASP.NET 2.0 do you use?
Ans1. Custom validation
Ans2. Validation Summary
Ans3. RegualExpressionValidator control
Ans4. Validation Grouping
Correct Answer : 4

What is the difference between CACHE object and APPLICATION object?


Ans1. Data of Cache object is available to all applications whereas data of
application object is available only to one application
Ans2. Data of application object is available only to authenticated users
whereas data of cache object is available to everyone
Ans3. Cache object allows expire policy whereas application object does not
Ans4. Cache object is a sub set of Application object
Correct Answer : 3

How do you write Http headers to Client?


Ans1. Response.WriteHeader
Ans2. Response.AddHeader
Ans3. Response.AppendHeader
Ans4. Response.add
Correct Answer : 3

If you have to use data retrieved from database and use it even after
disconnecting from database which object do you use?
Ans1. DataReader
Ans2. Command
Ans3. DataSet
Ans4. DataSource
Correct Answer : 3

If you have to display a textbox with validation control in edit mode of


GridView
then what type of field do you use?
Ans1. BoundField
Ans2. TemplateFiled
Ans3. TextFiled
Ans4. ValidateFiled
Correct Answer : 2

When a web application is terminated?


Ans1. When all sessions related to application are terminated
Ans2. When first session of the application is terminated
Ans3. When web server is shutdown
Ans4. When you call Application.End() method from code
Correct Answer : 3

How do you access value of cookie with the name c1?


Ans1. request.cookies("c1")
Ans2. request.cookies.items("c1")
Ans3. request.cookies.values("c1")
Ans4. response.cookies.values("c1")
Correct Answer : 1

Which event in global.asax is used to handle all unhandled errors of the


application?
Ans1. Application_Error
Ans2. Page_Error
Ans3. Application_Exception
Ans4. Unhandled_Error
Correct Answer : 1
What property of PAGE can be used to determine whether validation control are
successful?
Ans1. Valid
Ans2. IsValid
Ans3. IsPostBackValid
Ans4. Validated
Correct Answer : 2

Which event of GridView occurs immediately after data is bound to GridView?


Ans1. DataBinding
Ans2. DataBound
Ans3. RowsBound
Ans4. DataCreated
Correct Answer : 2

You might also like