Professional Documents
Culture Documents
B. Webforms
C. Winforms
Ans: Webforms
B. To store the global information and variable definitions for the application
Ans: To store the global information and variable definitions for the application
A. LinkCounter
B. Counter
C. AdRotator
D. File Access
Ans: LinkCounter
A. Page_Init()
B. Page_Load()
C. Page_click()
Ans: Page_Init()
A. Server.CreateObject("Scripting.FileSystemObject")
B. Create("FileSystemObject")
C. Create Object:"Scripting.FileSystemObject"
D. Server.CreateObject("FileSystemObject")
Ans: Server.CreateObject("Scripting.FileSystemObject")
A. RegSvr.exe
B. GacUtil.exe
C. GacSvr32.exe
D. GacMgr.exe
Ans: GacUtil.exe
9. What class does the ASP.NET Web Form class inherit from by default?
A. System.Web.UI.Page
B. System.Web.UI.Form
C. System.Web.GUI.Page
D. System.Web.Form
Ans: System.Web.UI.Page
A. Session Objects
B. Application Objects
C. Viewstate
11. Attribute must be set on a validator control for the validation to work.
A. ControlToValidate
B. ControlToBind
C. ValidateControl
D. Validate
Ans: ControlToValidate
B. DataCaching
C. a and b
Ans: a and b
13. What is used to validate complex string patterns like an e-mail address?
A. Extended expressions
B. Basic expressions
C. Regular expressions
D. Irregular expressions
A. .Web
B. .ASP
C. .ASPX
Ans: .ASP
A. asp:label
B. asp:listitem
C. asp:button
Ans: asp:label
C. No use
A. ExecuteScalar
B. ExecuteStream
C. Open
D. ExecuteReader
Ans: Open
18. Which DLL translate XML to SQL in IIS?
A. SQLISAPI.dll
B. SQLXML.dll
C. LISXML.dll
D. SQLIIS.dll
Ans: SQLISAPI.dll
A. StateServer
B. Session Object
C. InProcess
Ans: InProcess
A. EcmaScript
B. VBScript
C. PERL
D. JavaScript
Ans: VBScript
21. How do you get information from a form that is submitted using the "post" method?
A. Request.QueryString
B. Request.Form
C. Response.write
D. Response.writeln
Ans: Request.Form
22. Which object can help you maintain data across users?
A. Application object
B. Session object
C. Response object
D. Server object
23. Which of the following ASP.NET object encapsulates the state of the client?
A. Session object
B. Application object
C. Response object
D. Server object
24. Which of the following object is used along with application object in order to ensure that only one
process accesses a variable at a time?
A. Synchronize
B. Synchronize()
C. ThreadLock
D. Lock()
Ans: Synchronize()
25. Which of the following control is used to validate that two fields are equal?
A. RegularExpressionValidator
B. CompareValidator
C. equals() method
D. RequiredFieldValidator
Ans: CompareValidator
A. InProc
B. StateServer
C. SQL Server
A. View state
B. Cookies
C. Hidden fields
D. Request object
28. You can have only one Global.asax file per project.
A. Yes
B. No
Ans: Yes
29. ______________ element in the web.config file to run code using the permissions of a specific user
30. __________ is a special subfolder within the windows folder that stores the shared .NET component.
A. /bin
B. GAC
C. Root
Ans: GAC
A. requestQueue limit
B. maxWorkerThreads
C. maxIdThreads
D. All
Ans: All
A. SQLDataReader
B. Data Set
Ans: SQLDataReader
33. Which of the following is the way to monitor the web application?
B. Performance logs
C. Alerts Snap-ins
D. ALL
Ans: ALL
34. The ________________ property affects how the .Net Framework handles dates, currencies, sorting
and formatting issues.
A. CurrentUICulture
B. CurrentCulture
Ans: CurrentCulture
35. Where do we include the user lists for windows authentication?
A. < Credential>
B. < authorization>
C. < identity>
D. < authentiation>
A. < credential>
B. < authorization>
C. < Identity>
D. < authentication>
37. Which of the following authentication is best suited for a corporate network?
A. Windows
B. Form
C. User
D. All
Ans: Windows
38. What attributes do you use to hide a public .Net class from COM?
A. DLLImport Attributes
B. ComVisible attributes
C. COM Interop
D. All
39. By default, code written with the Debug class is stripped out of release builds.
A. Yes
B. No
Ans: Yes
40. _________ tests make sure that new code does not break existing code.
A. Regression tests
B. Integration tests
C. Unit tests
D. Load test
A. RMT
B. CLR
C. RCT
D. RC
Ans: CLR
42. In ASP.NET in form page the object which contains the user name is ______ ?
A. Page.User.Identity
B. Page.User.IsInRole
C. Page.User.Name
Ans: Page.User.Identity
43. Find the term: The .NET framework which provides automatic memory management using a
technique called ______________ ?
A. Serialization
B. Garbage Collection
C. Assemblies
D. Overriding
44. Which of the following denote ways to manage state in an ASP.Net Application?
A. Session objects
B. Application objects
C. ViewState
45. What is the base class from which all Web forms inherit?
A. Master Page
B. Page Class
C. Session Class
47. Which of the following must be done in order to connect data from some data resource to Repeater
control?
C. Both A. and B.
A. Server.Transfer
B. Response.Redirect
C. Both A. and B.
Ans: Server.Transfer
50. If one has two different web form controls in a application and if one wanted to know whether the
values in the above two different web form control match what control must be used?
A. DataList
B. GridView
C. CompareValidator
D. Listview
Ans: CompareValidator
51. Which of the following is used to send email message from my ASP.NET page?
A. System.Web.Mail.MailMessage
B. System.Web.Mail.SmtpMail
C. Both A. and B.
52. In my .NET Framework I have threads. Which of the following denote the possible priority level for
the threads?
A. Normal
B. AboveNormal
C. Highest
53. In .NET the operation of reading metadata and using its contents is known as ______?
A. Reflection
B. Enumeration
C. Binding
D. Serialization
Ans: Reflection
54. In ASP.NET the < authorization > section contain which of the following elements?
C. Both A. and B.
A. Server-side code
B. Client-side code
C. Both A. and B.
A. CLR
B. RCT
C. RCW
D. GAC
Ans: CLR
A. inetinfo.exe
B. aspnet_isapi.dll
C. aspnet_wp.exe
Ans: aspnet_wp.exe
A. Response.Write()
B. Response.Output.Write()
C. Both A. and B.
Ans: Response.Output.Write()
59. Which of the following denote the property in every validation control?
A. ControlToValidate property
B. Text property
C. Both A. and B.
A. One
B. Two
C. None
D. Many
Ans: Many
61. Suppose one wants to modify a SOAP message in a SOAP extension then how this can be achieved.
Choose the correct option from below:
C. Both A. and B.
D. One must override the method ProcessMessage
62. Which of the following can be used to add alternating color scheme in a Repeater control?
A. AlternatingItemTemplate
B. DataSource
C. ColorValidator
Ans: AlternatingItemTemplate
63. Suppose a .NET programmer wants to convert an object into a stream of bytes then the process is
called ______________ ?
A. Serialization
B. Threading
C. RCW
D. AppDomain
Ans: Serialization
64. The technique that allow code to make function calls to .NET applications on other processes and on
other machines is
A. .NET Threading
B. .NET Remoting
C. .NET RMT
65. The namespace within the Microsoft .NET framework which provides the functionality to implement
transaction processing is ....................
A. System.EnterpriseServices
B. System.Security
C. System.Diagnostics
D. System.Data
Ans: A
66. Which of the following method is used to obtain details about information types of assembly?
A. GetTypes
B. GetType
C. Both A. and B.
68. What tags one need to add within the asp:datagrid tags to bind columns manually?
69. Which method do you invoke on the DataAdapter control to load your generated dataset with data?
A. Load ( )
B. Fill( )
C. DataList
D. DataBind
Ans: Fill( )
A. Session.Dump
B. Session.Abandon
C. Session.Exit
Ans: Session.Abandon
71. Which of the following languages can be used to write server side scripting in ASP.NET?
A. C-sharp
B. VB
C. C++
D. A and B
Ans: D
72. When an .aspx page is requested from the web server, the out put will be rendered to browser in
following format.
A. HTML
B. XML
C. WML
D. JSP
Ans: A
73. The Asp.net server control, which provides an alternative way of displaying text on web page, is
Ans: A
A. Page_Load()
B. Page_Init()
C. Page_click()
Ans: B
A. Winforms
B. HTMLForms
C. Webforms
Ans: C
76. What namespace does the Web page belong in the .NET Framework class hierarchy?
A. System.web.UI.Page
B. System.Windows.Page
C. System.Web.page
Ans: A
77. Which method do you invoke on the Data Adapter control to load your generated dataset?
A. Fill( )
B. ExecuteQuery( )
C. Read( )
Ans: A
78. How do you register a user control?
Ans: C
A. User controls are displayed correctly in the Visual Studio .NET Designer
C. User and Custom controls are displayed correctly in the Visual Studio .NET Designer.
Ans: C
A. TagPrefix
C. Assemblyname
Ans: B
A. System.Web.UI.Webcontrol
B. System.Web.UI.Customcontrol
C. System.Web.UI.Customcontrols.Webcontrol
Ans: D
B. Scripting is separated from the HTML, Code is compiled as a DLL, the DLLs can be executed on
server
C. Code is separated from the HTML and interpreted Code is interpreted separately
Ans: C
Ans: B
84. Why is Global.asax is used?
C. No use
Ans: C
A. True
B. False
Ans: A
A. .Asmx
B. .Ascx
C. .Aspx
Ans: A
Ans: B
88. The number of forms that can be added to a aspx page is.
A. 1
B. 2
C. 3
D. More than 3
Ans: C
A. Session Objects
B. Application Objects
C. Viewstate
Ans: A
90. Which property of the session object is used to set the local identifier?
A. SessionId
B. LCID
C. Item
D. Key
Ans: D
A. Output Caching
B. DataCaching
C. a and b
Ans: B
A. InProcess
B. StateServer
C. Session Object
D. al of the above
Ans: C
A. Event-driven
B. Static
C. Linear
D. Topdown
Ans: A
94. Does the EnableViewState allows the page to save the users input on a form?
A. Yes
B. No
Ans: A
A. SQLISAPI.dll
B. SQLXML.dll
C. LISXML.dll
D. SQLIIS.dll
Ans: A
96. What is the maximum number of cookies that can be allowed to a web site?
A. 1
B. 10
C. 20
D. More than 30
Ans: A
97. Select the control which does not have any visible interface.
A. Datalist
B. DropdownList
C. Repeater
D. Datagrid
Ans: C
A. Session.Close( )
B. Session.Discard( )
C. Session.Abandon
D. Session.End
E. Session.Exit
Ans: C
A. ExecuteReader
B. ExecuteScalar
C. ExecuteStream
D. Open
E. CommandText
Ans: C
MVC ASP.Net Multiple choice Questions and Answers for 3+ Years experienced
1. Which is the best approach to assign a session in MVC?A)
System.Web.HttpContext.Current.Session["LoginID"] =7;
B) Current.Session["LoginID"] =7;
C) Session["LoginID"] =7;
D) None
Ans: B
4. What is ActionResult() ?
A) It is an abstract Class
B) It is a Concrete Class
C) Both A and B
D) None
Ans: A
5. What is ViewResult() ?
A) It is an abstract Class
B) It is a Concrete Class
C) Both A and B
D) None
Ans: B
Ans: B
18. The Razor View Engine uses to render server side content.
A) @
B) <%= %>
C) Both A & B
D) None
Ans: A
19. The ASPX View Engine uses to render server side content.
A) @
B) <%= %>
C) Both A & B
D) None
Ans: B
20. Which is more faster between ASPX View Engine and Razor View Engine.
A) ASPX View Engine
B) Razor View Engine
C) Both A & B
D) None
Ans: A
Ans: B
23. If you have already implemented different filters then what will be order of these filters?
1) Authorization filters
2) Action filters
3) Response filters
4) Exception filters
24. Can you specify different types of filters in ASP.Net MVC application?
1) Authorization filters (IAuthorizationFilter)
2) Action filters (IActionFilter)
3) Result filters (IResultFilter)
4) Exception filters (IExceptionFilter)
30. Does MVC 6 allow only save change, hitting the save but then refreshing the browser to
reflect changes?
A) Yes
B) No
C) Both A & B
D) None
Ans: A
31. Does vNext is now Open Sourced via the .NET Foundation and open to public
contributions.
A) Yes
B) No
C) Both A & B
D) None
Ans: A
32. Can vNext runs on both Mac and Linux today (Mono Version)?
A) Yes
B) No
C) Both A & B
D) None
Ans: A
33. What is the difference between MVC (Model View Controller) and MVP (Model View
Presenter)?
Answer: MVC controller handles all the requests, MVP handles as the handler and also
handles the all requests as well.
41. Which is the way to render Partial View using ASP.Net MVC Razor Engine?
A) @Html.Partial("_PartialHeader")B) @Html.PartialView("_PartialHeader")
C) @Html.PartialHtml("_PartialHeader")
D) B and C
E) None
Ans: A
42. Which Namespace is used to "Display" in Data Annotation using MVC ?
A) System.ComponentModelB) System.ComponentModel.DataAnnotations
C) Both A and B
D) None
Ans: A
43. Which Namespaces are required to Data Annotation using MVC ?
A) System.ComponentModel
B) System.ComponentModel.DataAnnotations
C) Both A and BD) None
Ans: C
44. Are both TempData/ViewData require typecasting in MVC?
A) Both (TempData/ViewData) requires type casting to avoid null exception.B) No,
these (TempData/ViewData) does not require type casting.
C) Both A) & B)
D) None
Ans: A
45. Is ViewBag slower than ViewData in MVC?
A) YesB) No
C) Both A) & B)
D) None
Ans: A
46. Is ViewData faster than ViewBag in MVC?
A) YesB) No
C) Both A) & B)
D) None
Ans: A
47. Are both TempData/ViewData property of Controller base class in MVC?
A) YesB) No
C) Both A) & B)
D) None
Ans: A
48. Does TempData used to pass data from one page to another page in MVC?
A) YesB) No
C) Both A) & B)
D) None
Ans: A
49. Can ASP.Net Web API specialize to XML or JSON ?
A) YesB) No
C) None
Ans: A
50. Does Web API (ASP.Net) supports to non SOAP based like XML or JSON ?
A) YesB) No
C) None
Ans: A
51. Does Web API (ASP.Net) supports to both version mobile apps and others ?
A) YesB) No
C) Both A & B
D) None
Ans: A
52. Can ASP.Net Web API, it works HTTP standard verbs like POST, GET, PUT, DELETE
(CRUD Operations) ?
A) YesB) No
C) Both A & B
D) None
Ans: A
53. Can ASP.Net Web API ability to both self hosting (outside of IIS) and IIS ?
A) YesB) No
C) None
Ans: A
54. Can ASP.Net Web API has ability to transport non HTTP protocols like TCP, UDP,
Named Pipes etc ?
A) Yes
B) NoC) None
Ans: B
55. What is AuthConfig.cs in ASP.Net MVC ?
A) AuthConfig.cs is used to configure route settings
B) AuthConfig.cs is used to configure security settings including sites oAuth Login.C)
None
D) All
Ans: B
56. What is BundleConfig.cs in ASP.Net MVC ?
A) BundleConfig.cs in MVC is used to register filters for different purposes.
B) BundleConfig.cs in MVC is used to register bundles used by the bundling and
minification, serveral bundles are added by default like jQuery, jQueryUI, jQuery
validation, Modernizr, default CSS references.C) All
D) None
Ans: B
57. What is FilterConfig.cs in ASP.Net MVC ?
A) FilterConfig.cs is used to register global MVC filters, HandleErrorAttribute is
registered by default filter. We can also register other filters.B) FilterConfig.cs is used to
register global MVC bundles.
C) None
D) All
Ans: A
58. What is RouteConfig.cs in ASP.Net MVC?
A) RouteConfig.cs is used to register MVC config statements, route config.B)
RouteConfig.css is used to register global MVC bundles.
C) None
D) All
Ans: A
59. What is the difference between HtmlTextbox and HtmlTextboxFor using ASP.Net MVC
Razor Engine?
A) @Html.TextBox is not strongly typed, @Html.TextBoxFor is strongly typed that is
why should be use @Html.TextBoxFor in MVC Razor Engine.B) @Html.TextBox is
strongly typed, @Html.TextBoxFor is not strongly typed that is why should be use
@Html.TextBox in MVC Razor Engine.
C) None
D) Both A and B
Syntax
@Html.Partial("_viewname"); Ans: A
60. What is the benefits of Html.RenderPartial using ASP.Net MVC Razor Engine?
A) @Html.RenderPartial Returns response, moreover requires to create action.B)
@Html.RenderPartial Returns nothing (void), it is faster than @Html.Partial, moreover
requires not to create action.C) NoneD) Both A and BSyntax
@Html.Partial("_viewname");@Html.RenderPartial("_viewname");Ans: B
61. What is the benefits of Html.Partial using ASP.Net MVC Razor Engine?
A) @Html.RenderPartial Returns response, moreover requires to create action.B)
@Html.RenderPartial Returns string value, it is slower than @Html.RenderPartial, moreover
requires not to create action.
C) NoneD) Both A and BSyntax@Html.Partial("_viewname");Ans: B
62. How to check Request coming from which controller using MVC ASP.Net?
A) var _controller =
HttpContext.Current.Request.RequestContext.Values["Controller"].ToString();
B) var _controller =
HttpContext.Current.Request.RequestContext.RouteData.Values["Controller"].ToString();
C) var _controller = RouteData.Values["Controller"].ToString();
D) None
Ans: B
Ans: B
64. Which Name space is used to create chart using ASP.Net MVC?
A) using System.Web.MVC;
B) using System.Web.Helpers;
c) using System.Web.Chart;
D) All
Ans: B
Ans: C
Ans: C
72. Which name space using can send email in ASP.Net MVC?
A) using System.Net.Mail;
B) using System.Net;
C) using System.Mail;
D) None
MailMessage mail = new MailMessage();
Ans: A
73. If Razor View Engine need to add JQuery function and contain @ special character then
how we can write it in Razor View?
A) Replace @ to @@@ (tripple)
B) Replace @ to @@ (double)
C) None
D) Both (A & B)
Ans: B
74. How to set Default Value to Hidden Input Box using ASP.Net MVC?
A) @Html.HiddenFor(m => m.Name, "Jack")
B) @Html.HiddenFor(m => m.Name, new { Value = "Jack"})
C) @Html.Hidden(m => m.Name, new { Value = "Jack"})
D) None
Ans: B
Ans: B
81. Can you list the main types of result using ASP.Net MVC?
There are total 10 main types of result, ActionResult is main type and others are sub types
of results as listed below:
System.Web.Mvc.ActionResult
System.Web.Mvc.ContentResult
System.Web.Mvc.EmptyResult
System.Web.Mvc.FileResult
System.Web.Mvc.HttpStatusCodeResult
System.Web.Mvc.JavaScriptResult
System.Web.Mvc.JsonResult
System.Web.Mvc.RedirectResult
System.Web.Mvc.RedirectToRouteResult
System.Web.Mvc.ViewResultBase
82. Which filter will be execute at first using ASP.Net MVC?
A) Action filters
B) Authorization filters
C) Response filters
D) Exception filters
Ans: B
3. In a ASP.NET page, which is the best way to find if the contents of a TextBox
has changed after the form containing the TextBox has been posted back to the
server
A. By comparing the old value with the new value
B. By checking the NewValue property of the TextBox control
C. By handling the TextBox control’s TextChanged event
D. By checking the HasChanged property of the TextBox
Ans: C
7. You are performing Form validations with Validation controls. You need to
group all the errors at the top of the page and also show error messages
besides each element. The messages besides each element need to be detailed
and hence different from the messages at top of the page
A. You can use the ValidationSummary Control to summarize the messages set
in theErrorMessage property of the Validation controls. The messages set in
the Text property of the Validation controls can be displayed besides each
element.
B. The error messages set in the SummaryText property of each Validation
control havingisSummary=true will be automatically grouped at the top of the
page and the messages set in the Text property can be displayed besides each
element.
C. The error messages in the Validation control can only be displayed in a
popup
D. The Validation controls cannot be used in the given scenario
Ans: A
10. You require to create an ASP.NET page with the functionality to allow a user
to upload a file to the server
A. You need to use the System.Web.Upload namespace
B. You need to use a COM component to save the file on the server
C. You need to use the SaveAs method of the HttpPostedFile class
D. The ASP.Net application automatically loops through all the and saves the
uploaded files to a virtual folder called “uploads”
Ans: C
11. You need to programmatically add a user control without using the Register
directive in your code
A. Use AddUserControl
B. Use cannot programmatically add a user control
C. Use UserControl.Add
D. Use LoadControl
Ans: D
12. You need to develop a business component myComp.dll in .Net and use it
in your ASP.NET page
a. You require to register the component using regsvr32.exe
b. You require to register the component using TlbExp.exe
c. You require to copy the component to the /bin directory in your applications
root directory
d. You require to copy the component to the /bin directory in your applications
root directory and register the component using regsvr32.exe
Ans: C
13. Is it possible for multiple aspx pages to use the same code-behind file, if
required
A. Yes
B. No
Ans: A
15. Which namespace would you use if you need to create an ASP.NET
application with Microsoft SQL Server 2000 as the database.
A. System.Data.SQLServer
B. System.Data.SQLClient
C. System.Data.OleDb
D. System.Data.Microsoft
Ans: B
16. Which namespace would you use if you need to create an ASP.NET
application with Oracle as the database.
A. System.Data.SQLServer
B. System.Data.SQLClient
C. System.Data.OleDb
D. System.Data.NonMS
Ans: C
17. Which statement among the following is correct while opening a connection
using theSQLConnection class
A. You cannot specify a connection string
B. You need to specify a Provider parameter for the connection string
C. You need to use a System DSN
D. You cannot use a DSN
Ans: C
18. What method of the Command object would you use if you need to retrieve
a single value (for example an aggregate value. from a database
A. ExecuteScalar(.
B. ExecuteReader(.
C. ExecuteSingle(.
D. ExecuteNonQuery(.
Ans: A
19. Which are the two things you need to take care of in your ASP.Net
application to take advantage of connection pooling (select two.
A. You need to set the Pooling property of the Connection object to True
B. You need to use the same exact connection string whenever you open a
database connection
C. You need to call the ReleaseToPool(. method after the connection is closed
D. You need to explicitly close the connection with the Close(. method
Ans: B,D
21. You need to retrieve only schema information about the columns contained
in a database table without retrieving data. Which of the following is the best
way to retrieve it
A. Use the GetSchemaTable(. method of the DataReader in conjunction
withCommandBehaviour.SchemaOnly
B. Use the SchemaOnly property of the Command class
C. Use the GetSchemaOnly(. method of the DataReader
D. You cannot retrieve only schema information without retrieving data
Ans: A
23.What will be the values assigned to the two Label controls lblMessage1 &
lblMessage2 respectively
A. 2 & 3
B. 3 & 3
C. 3 & 4
D. 4 & 4
Ans: C
23. You need to customize the display format of the DataList control
A. Set the DisplayFormat property of the DataList control to Custom
B. Set the CustomFormat property of the DataList control to True
C. ItemTemplate will allow you to format the appearance of each DataList item
D. The display format of the DataList control is predefined and cannot be
customized
Ans: C
24. You have a DataList control containing a LinkButton. What would you do to
raise theDeleteCommand event in the DataList by clicking on the LinkButton.
A. Set CommandName=”delete” in the LinkButton
B. Set the OnDelete property of the DataList to the ID of the LinkButton
C. A DataList control cannot raise an event in response to events raised by its
child controls
D. A DataList control cannot contain child controls
Ans: A
25. The Products table has a column named ProductName and a primary key
column namedProductID. When a user selects an item in the DataList, you want
to retrieve the value of theProductID column associated with it.
A. In the DataList control set PrimaryKeyField=”ProductID”
B. In the DataList control set DataKeyField=”ProductID”
C. In the DataList control set KeyField=”ProductID”
D. In the DataList control set id=”ProductID”
Ans: B
26. You need to enable paging for a DataGrid control
A. You can use a DataReader
B. You can use a DataTable
C. You can use either the DataReader or DataTable
D. A DataGrid does not support paging
Ans: B
29. How can you load an XML file directly into a DataSet
A. By setting the XML property of the DataSet class
B. By using the GetXML(. method of the DataSet class
C. By using the ReadXml(. method of the DataSet class
D. You cannot load an XML file directly into a DataSet
Ans: C
30. Your site has been restructured and the paths of few pages have changed.
Which method would you use to redirect users requesting for a pages using
the old URL
A. Create an ISAPI filter to do the above task
B. Create an entry in the section of the Web.Config file
C. Use the Application.Config file
D. Handle the Application_BeginRequest event and use the RewritePath(.
method
Ans: D
31. Which statement about the Web.Config file is the most accurate
A. The Web.Config file can be only placed in the root of a Web Site to override
settings in theMachine.Config file for all applications in a particular Web Site
B. The Web.Config file can only be placed in the root of a particular virtual
directory
C. The Web.Config file can be placed in the root of the Web Site and the root of
a virtual directory. The settings from the file in the virtual directory overrides
the settings from the file in the Web Site
D. The Web.Config file can be placed in the root of the Web Site and the root of
a virtual directory and in any subdirectory of an application. The settings from
a file at a particular level override the settings from the ones above it.
Ans: D
37. You are preparing to deploy an ASP.NET Web application. You are currently
creating the deployment project. You have started the Web setup project, which
is namedAccountManagerDeploy, and added the application output to the
project, and now you need to set the directory on the Web server to which the
application will be installed. Which of the following procedures should you use
to do so (Choose two. Each correct answer presents part of the solution..
A. Set the VirtualDirectory property in the Properties window.
B. Select the Web Application Folder in the File System Editor.
C. Select the AccountManagerDeploy project in the Solution Explorer.
D. Set the Folder property in the Properties window.
E. Select the Primary output from AccountManagerDeploy icon in the Solution
Explorer.
Ans: A, B
38. You are part of a team that is using Visual Studio .NET to develop a Web
application. You are looking through the files in the application, and you see
the following files:
createmembership.aspx
createmembership.aspx.vb
Which two of the following statements most accurately describe these two files
(Select two..
A. The createmembership.aspx.vb file is a Web form, which displays a user
interface to the user
B. The createmembership.aspx file is a code file, which contains code that
interacts with the user interface in the Web form
C. The createmembership.aspx file is an uncompiled file that will become
createmembership.aspx.vb when it is compiled
D. The createmembership.aspx.vb file is a code file, which contains code that
interacts with the user interface in the Web form
E. The createmembership.aspx file is a Web form, which displays a user
interface to the user
F. The createmembership.aspx.vb file is the compiled version of
createmembership.aspx
Ans: D, E
39. You are using Visual Studio .NET to develop a Web application. You are
beginning to debug your application, and you would like to store debug
messages in the Windows event log as you proceed with testing. Which of the
following will allow you to do so
A. TextWriterTraceListener
B. DefaultTraceListener
C. EventLogTraceListener
D. TraceSwitch
Ans: C
40. You are using Visual Studio .NET to develop a Web application for a large
video rental store. The titles, as well as other information about the store’s
videotapes, laser disks, DVDs, and audio books, are stored in a SQL Server
2000 database.
The store wants to allow visitors to its Web site to browse the list of titles
sorted in various ways, such as by medium (VHS, DVD, etc.., genre, director,
and so on. You have created a number of stored procedures to facilitate the
different ways of presenting the data.
Given an existing DataSet named dsVids and a Connection named conn, which
of the following code examples illustrates the correct way to call the stored
procedure named ListDVDTitles that returns the list of DVD titles
A. Dim daDVDList as New SqlDataAdapter(.
daDVDList.SelectCommand = New SqlCommand(.
daDVDList.SelectCommand.Connection = conn
daDVDList.SelectCommand.CommandText = “ListDVDTitles”
daDVDList.SelectCommand.CommandType = CommandType.StoredProcedure
daDVDList.Fill(dsVids, “Titles”.
43. The XSLT processor copies the elements of the stylesheet until it finds a
command in the format:
A. SELECT … FROM … WHERE.
B. {item, action}.
C. {for-each select}.
D. none.
Ans: B
45. Which of the following statements is not true about XML Schemas:
A. They are used to define the content and structure of data.
B. They define a set of symbols and the relationships of those symbols.
C. They are themselves XML documents.
D. They have their own syntax.
Ans: D
50. The expression FOR XML RAW tells SQL Server to:
A. place the values of the columns as attributes in the resulting XML document.
B. place the values of the columns into elements rather than attributes.
C. place some columns into elements and others into attributes.
D. None of the above is correct.
Ans: A
51. ADO.NET provides the ability to create and process in-memory databases
called:
A. views.
B. relations.
C. tables.
D. datasets.
Ans: D
54. XSLT processors evaluate each statement in the context of the match that
has been made. That is, XSLT processors are:
A. context oriented.
B. procedural oriented.
C. object oriented.
D. relational oriented.
Ans: A
58. If the XML data instance conforms to the DTD, the document is said to be:
A. type-invalid.
B. type-valid.
C. not-type-valid.
D. an HTML document.
Ans: B
59. The document that is used by XSLT to indicate how to transform the
elements of the XML document to another format is a(n.:
A. HTML page.
B. DOCTYPE procedure.
C. stylesheet.
D. stored procedure.
Ans: C
60. If an XML document does not have a DTD, then by definition it is:
A. not-type-valid.
B. type-valid.
C. an HTML document.
D. None of the above is correct.
Ans: A
63.Which is Incorrect ?
a. Session objecy is Private to user
b. Application Object is global
c. Caching can be global or Private
d. Application object vaues are accessed accross the application
Ans: C
65.Which is correct ?
a. DataTable is member of a DataSet
b. DataTable is member of a System.Data
c. DataTable is member of a System.Data.SqlClient
d. Dataadapter
Ans: B
4. What is the greatest advantage of using asp.net mvc over asp.net webforms?
It is difficult to unit test UI with webforms, where views in mvc can be very
easily unit tested.
12. Where are the routing rules defined in an asp.net MVC application?
In Application_Start event in Global.asax
18. What are the 3 segments of the default route, that is present in an ASP.NET
MVC application?
1st Segment – Controller Name
2nd Segment – Action Method Name
3rd Segment – Parameter that is passed to the action method
Example: http://google.com/search/label/MVC
Controller Name = search
Action Method Name = label
Parameter Id = MVC
19. ASP.NET MVC application, makes use of settings at 2 places for routing to
work correctly. What are these 2 places?
1. Web.Config File : ASP.NET routing has to be enabled here.
2. Global.asax File : The Route table is created in the application Start event
handler, of the Global.asax file.
21. What are the 3 things that are needed to specify a route?
1. URL Pattern – You can include placeholders in a URL pattern so that variable
data can be passed to the request handler without requiring a query string.
2. Handler – The handler can be a physical file such as an .aspx file or a
controller class.
3. Name for the Route – Name is optional.
29. If I have multiple filters implemented, what is the order in which these filters
get executed?
1. Authorization filters
2. Action filters
3. Response filters
4. Exception filters
30. What are the different types of filters, in an asp.net mvc application?
1. Authorization filters
2. Action filters
3. Result filters
4. Exception filters
33- What are the levels at which filters can be applied in an asp.net mvc
application?
1. Action Method
2. Controller
3. Application
40. What symbol would you use to denote, the start of a code block in razor
views?
@
41. What symbol would you use to denote, the start of a code block in aspx
views?
<%= %>
42. When using razor views, do you have to take any special steps to protect
your asp.net mvc application from cross site scripting (XSS) attacks?
No, by default content emitted using a @ block is automatically HTML encoded
to protect from cross site scripting (XSS) attacks.
43. When using aspx view engine, to have a consistent look and feel, across all
pages of the application, we can make use of asp.net master pages. What is
asp.net master pages equivalent, when using razor views?
To have a consistent look and feel when using razor views, we can make use of
layout pages. Layout pages, reside in the shared folder, and are named as
_Layout.cshtml
App initialization
Routing
Instantiate and execute controller
Locate and invoke controller action
Instantiate and render view.
69. Can you specify different types of filters in ASP.Net MVC application?
1) Authorization filters (IAuthorizationFilter)
2) Action filters (IActionFilter)
3) Result filters (IResultFilter)
4) Exception filters (IExceptionFilter)
70. If you have already implemented different filters then what will be order of
these filters?
1) Authorization filters
2) Action filters
3) Response filters
4) Exception filters
72. What is the difference between MVC (Model View Controller) and MVP
(Model View Presenter)?
MVC controller handles all the requests, MVP handles as the handler and also
handles the all requests as well.
73. Can we use third party View Engine using ASP.Net MVC Engine ?
Yes, below are the top five alternative ASP.Net MVC View Engines.
1. Spark (Castle MonoRail framework projects), Open Sourced, it is popular as
MVCContrib library.
2. NHaml works like inline page templating.
3. NDjango uses F# Language.
4. Hasic uses VB.Net, XML.
5. Bellevue for ASP.NEt view, It respects HTML class first.
74. What is scaffolding using ASP.Net MVC Engine?
Scaffolding helps us to write CRUD operations blend using Entity Framework, It
helps developer to write down simply even yet complex business logic.
77. Can be it possible to share single view across multiple controllers in MVC?
We can put the view under shared folder, it will automatically view the across
the multiple controllers.
78. Can you list the main types of result using ASP.Net MVC?
There are total 10 main types of result, ActionResult is main type and others
are sub types of results as listed below:
• System.Web.Mvc.ActionResult
• System.Web.Mvc.ContentResult
• System.Web.Mvc.EmptyResult
• System.Web.Mvc.FileResult
• System.Web.Mvc.HttpStatusCodeResult
• System.Web.Mvc.JavaScriptResult
• System.Web.Mvc.JsonResult
• System.Web.Mvc.RedirectResult
• System.Web.Mvc.RedirectToRouteResult
• System.Web.Mvc.ViewResultBase
80. How we can handle the exception at controller level in ASP.Net MVC?
Exception Handling is made simple in ASP.Net MVC and it can be done by just
overriding “OnException” and set the result property of the filtercontext object
(as shown below) to the view detail, which is to be returned in case of
exception.
@TempData[“TestData”];
TempData.Keep(“TestData”);
92. Explain the tools used for unit testing in ASP.Net MVC?
Below are the tools used for unit testing :
NUnit
xUnit.NET
Ninject 2
Moq
96. What are the differences between Partial View and Display Template and
Edit Templates in ASP.Net MVC?
Display Templates : These are model centric. Meaning it depends on the
properties of the view model used. It uses convention that will only display like
divs or labels.
Edit Templates : These are also model centric but will have editable controls
like Textboxes.
Partial View : These are view centric. These will differ from templates by the
way they render the properties (Id’s) Eg : CategoryViewModel has Product
class property then it will be rendered as Model.Product.ProductName but in
case of templates if we CategoryViewModel has List then @Html.DisplayFor(m
=> m.Products) works and it renders the template for each item of this list.
97. Can I set the unlimited length for “maxJsonLength” property in config?
No. We can’t set unlimited length for property maxJsonLength. Default value is
– 102400 and maximum value what we can set would be : 2147483644.
99. How can I return string result from Action in ASP.Net MVC?
Below is the code snippet to return string from action method :
public ActionResult TestAction() {
return Content(“Hello Test !!”);
}
100. How to return the JSON from action method in ASP.Net MVC?
Below is the code snippet to return string from action method :
public ActionResult TestAction() {
return JSON(new { prop1 = “Test1”, prop2 = “Test2” });
}
10. What is the default Form method (i.e. GET, POST) for an action method
GET. To change this you can add an action level attribute e.g [HttpPost]