Saturday, May 4, 2019

ASP.NET Upwork Test Question & Answer



1. Which DLL translate XML to SQL in IIS?
Answers:
•SQLIIS.dll
•LISXML.dll
•SQLXML.dll
• SQLISAPI.dll
2. User configurable arbritrary list filtering in C#?
Answers:
• We are storing C# code in the database, and compiling it into a lambda function on demand, then caching the resulting object (we’re using AppFabric Server).
• This function is then used to filter the list of objects.
• We provide an administration interface for people to create and edit their own filters. The administration interface confirms that code can be compiled before it is stored in the database.
• All of the above
3. ___ is a property of the session object that is used to set the local identifier?
Answers:
•LCID
•SessionId
•Key
• Item
4. Which of the following session-state modes is not a valid option for the Web Farm deployment to work?
Answers:
•StateServer
•InProc
•SQLServer
• Off
5. How can I tell the website administration tool which provider to use following code?
Answers:
•<memberships>
<providers>
<add connectionStringName=»DefaultConnection» enablePasswordRetrieval=»false»
enablePasswordReset=»true» requiresQuestionAndAnswer=»false»
requiresUniqueEmail=»true»
maxInvalidPasswordAttempts=»5″
minRequiredPasswordLength=»6″
minRequiredNonalphanumericCharacters=»0″
passwordAttemptWindow=»10″
applicationName=»/» name=»DefaultMembershipProvider» type=»System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />
</providers>
</memberships>
• <membership>
<providers>
<add connectionStringName=»DefaultConnection» enablePasswordRetrieval=»false»
enablePasswordReset=»true» requiresQuestionAndAnswer=»false»
requiresUniqueEmail=»true»
maxInvalidPasswordAttempts=»5″
minRequiredPasswordLength=»6″
minRequiredNonalphanumericCharacters=»0″
passwordAttemptWindow=»10″
applicationName=»/» name=»DefaultMembershipProvider» type=»System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />
</providers>
</membership>
• <membership defaultProvider=»DefaultMembershipProvider»>
<providers>
<add connectionStringName=»DefaultConnection» enablePasswordRetrieval=»false»
enablePasswordReset=»true» requiresQuestionAndAnswer=»false»
requiresUniqueEmail=»true»
maxInvalidPasswordAttempts=»5″
minRequiredPasswordLength=»6″
minRequiredNonalphanumericCharacters=»0″
passwordAttemptWindow=»10″
applicationName=»/» name=»DefaultMembershipProvider» type=»System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />
</providers>
</membership>
• All of the above

6. Which process runs the ASP.NET application on a web server?

Answers:

•svchost.exe
•w3wp.exe
•iis.exe
• inetmgr.exe

7. For an ASP.NET deployment, .NET framework is configured at which level?

Answers:

•Inweb.config of the application itself
•At Application Pool Level
•At website level
• Individually decided for each virtual directory or application

8. For an ASP.NET deployment on IIS, the maximum number of worker processes are defined at which level?

Answers:

• At Application Pool level
• At Website Level
At Virtual Directory Level
• IIS Admin has no control over this. IIS uses its internal algorithm to determine the number of worker processes

9. Custom Controls are derived from which of the classes?

Answers:

• System.Web.UI.Webcontrol
• System.Web.UI.Customcontrol
• System.Web.UI.Customcontrols.Webcontrol
• All of the above

10. Which of the following is the way to monitor the web application?

Answers:

• MMC Event viewers
• Performance logs
• Alerts Snap-ins
• ALL

11. The goal is to enable single-sign-on across multiple ASP.NET applications. Which of the following statements will be true?

Answers:

• ASP.NET does not support single-sign-on across multiple applications
• Single-sign on is be-default enabled across the ASP.NET applications deployed on the same web server
• The machine key of all such applications should be the same
The machine key, forms-authentication name and path should be the same across all the applications

12. We should install an SSL certificate on an IIS website so that?

Answers:

• All the content from IIS is cashed on client browser
• All the traffic to and from IIS is encrypted
• We can enable forms authentication, which cannot be enabled otherwise
• SQL connection between IIS and SQL Server is secured

13. How is ASP.Net different from classic ASP?

Answers:

• Scripting is separated from the HTML, Code is interpreted separately.
• Code is separated from the HTML and interpreted Code is interpreted separately
• Scripting is separated from the HTML, Code is compiled as a DLL, the DLLs can be executed on server
• All of the above

14. The default session timeout value for an ASP.NET application or website is?

Answers:

• 10 minutes
• 20 minutes
• 30 minutes
• 60 minutes

15. How to use real-time configurations in an ASP.NET application without restarting it?

Answers:

• ExeConfigurationFileMapexConfigFile = new ExeConfigurationFileMap();
exConfigFile.ExeConfigFilename = Server.MapPath(«app.config»);
Configuration config = ConfigurationManager.OpenMappedExeConfiguration(exConfigFile, ConfigurationUserLevel.None);
string testConfig = config.AppSettings.Settings[«Test»].Value;
• ExeConfigurationFileMapexConfigFile = new ExeConfigurationFileMap();
exConfigFile.ExeConfigFilename = Server.MapPath(«app.config»);
Configuration configfile = ConfigurationManager.OpenMappedExeConfiguration(exConfigFile, ConfigurationUserLevel.None);
string testConfig = config.AppSettings.Settings[«Test»].Value;
• Both of the above
• None of the above

16. The difference between ListView and GridView is?

Answers:

• ListView does not allow sorting, but GridView does
• ListView does not allow inline editing, but GridView does
• ListView does not generate Html table by default, but GridView does
• ASP.NET 4 does not have a ListView control

17. You are the lead developer on a team that has been working on a large website for months, and several controllers are getting unwieldy. You do not have that problem with views and models because most of your communications are through AJAX to display snippets of information on the UI. What changes can best help you solve your problem?

Answers:

• A. Create partial classes for the controllers that have AJAX functionality to create a set of Controller.Ajax.cs files. Put the AJAX-specific functionality in those files.
• B. Create an area called AJAX. Move all controllers, models, and views into the area.
• C. Create an area called AJAX. Move the specific AJAX functionality into the Controllers directory and leave the Views and Models directories empty.
• D. Create a new ASP.NET MVC 4 application project. Move the AJAX functionality into that so that it will be more responsive.
• E. 1 and 3 both
• F. All of the above

18. How do you get the text inside the new HTMLEditor in ASP.Net Ajax Control Toolkit?

Answers:

• controlName.Content
• controlContent.Name
• controlID.Content
• controlContent.ID

19. In your ASP.NET 2.0 web application you want to display an image that is selected from a collection of images. What approach will you use to implement this?

Answers:

• Use the ImageMap control and randomly select a HotSpot to show or hide.
• Use the Image control to hold the image and a Calendar control to randomly select a date for each image to be displayed.
Use the AdServer control and create an XML file with configuration of the control.
• Use an ImageButton control to predict randomness of the image to be loaded based on the clicks of the control.

20. What technologies are being used in AJAX?

Answers:

• JavaScript
• XMLHttpRequest
• Document Object Model (DOM)
• Extensible HTML (XHTML) and Cascading Style Sheets (CSS)
• All of the above

21. What is the lifespan for items stored in viewstate?

Answers:

• Exists for the life of the current page
• 20 mins
• 2 mins
• 2 sec

22. Let’s suppose, on an .ASPX page, we have two separate data entry forms with submit buttons. How can we ensure that submitting the first form does not validate any controls in the second form, and vice versa?

Answers:

Disable client-side validation and validate controls only on the server side
• Make sure that both forms are in separate content placeholders
• Write custom JavaScript code to validate the fields
• Assign two different validation groups to both forms and their controls

23. What are the different controls of ASP.NET AJAX?

Answers:

• ScriptManager, ScriptManagerProxy
• UpdatePanel, UpdateProgress
• Timer
• All of the above

24. How do you ensure that a TextBox input is a valid Date value?

Answers:

• Add a CompareValidator with Operator=»DataTypeCheck»
Use a CustomValidator with server-side or client-side code to validate date
• Use a RegularExpressionValidator with regular expression to validate date
• All of the above

25. What data types do a Rangevalidator support?

Answers:

• Integer
• String
• Date
• All of the above

26. What are the components of the ASP.NET AJAX architecture?

Answers:

• You can divide the ASP.NET AJAX architecture into two components — JAVA client architecture and JAVA server architecture.
• You can divide the ASP.NET AJAX architecture into two components — AJAX client architecture and AJAX server architecture.
• You can divide the ASP.NET AJAX architecture into two components — PHP client architecture and PHP server architecture.
• All of the above

27. Declaring more than one form tags with runat=»server» on an ASPX page will result in?

Answers:

• A compile-time error
• A run-time error
• No error at all
• No error but a warning message in browser console

28. If a server control is declared inside an UpdatePanelUpdateMode=»Conditional», which of the following statements is true?

Answers:

• UpdatePanel does not have any UpdateMode property
• UpdatePanel.Update() method must be called to show any changes in the server control
• A page can have only one UpdatePanel with UpdateMode=»Conditional»
• All of the above

29. If I’m developing an application that must accommodate multiple security levels though secure login and my ASP.NET web application is spanned across three web servers (using round-robin load balancing), what would be the best approach to maintain login-in state for the users?

Answers:

Maintain the login state security through a database.
• Maintain the login state security through a Session.
• Maintain the login state security through a View State.
• All of the above

30. Which of the following does not have any visible interface?

Answers:

• Datagrid
• Repeater
• DropdownList
• Datalist

31. An ASP.NET page uses a Datagrid displaying employee information.The Web application supports a large number of concurrent users who will be saving data from the grid back to the database. It is important that the Web application doesn’t overwhelm the Web Server.

Answers:

• Disable View State and don’t use session state
• Use View State
• Use URL munging
• Disable ViewState and use Session State

32. How can you determine what version(s) of ASP.NET are running on a system?

Answers:

Response.Write(System.Environment.Version.ToString() );
• Response.Write(Version.ToString() );
• Response.Write(System.Version.ToString() );
• not possible

33. What is the best way to intercept every request for an image on your site and ensure that a watermark is added to the image?

Answers:

• A. An HTTP module handling the AuthorizeRequest event
• B. A custom HTTP handler set to handle .htm and .html pages
• C. A custom HTTP handler configured to serve .png and .jpg files
• D. An HTTP module handling the PostRequestHandlerExecute event
• E. C and D both
• F. All of the above

34. Which of the following is not a valid option in OutputCache directive?

Answers:

• VaryByUserAgent
• VaryByCustom
• VaryByControl
• VaryByHeader
• VaryByContentEncoding

35. ASP.NET/URL Rewriting in a development environment?

Answers:

• One URL rewrite of many HTTP module for ASP.NET — this works very well if you only want rewriting on your ASP.NET pages. You can also infact map other filetypes since the IIS 7 changes.
• An URL rewriter ISAPI extension for IIS — faster than using the ASP.NET and more familiar to you if you’re use to mod_rewrite.
• Play about with ASP.NET MVC to get some instant results.
• All of the above

36. For your ASP.NET web application your graphics designer created elaborate images that show the product lines of your company. Some graphics of the product line are rectangular, circular, and others are having complex shapes. You need to use these images as a menu on your Website. What is the best way of incorporating these images into your Website?

Answers:

• Use ImageButton and use the x- and y-coordinates that are returned when the user clicks to figure out what product line the user clicked.
• Use the Table, TableRow, and TableCell controls, break the image into pieces that are displayed in the cells, and use the TableCell control’s Click event to identify the product line that was clicked.
• Use the MultiView control and break up the image into pieces that can be displayed in each View control for each product line. Use the Click event of the View to identify the product line that was clicked.
• Use an ImageMap control and define hot spot areas for each of the product lines. Use the PostBackValue to identify the product line that was clicked.

37. The .NET Framework provides a runtime environment called?

Answers:

• CLR
• RMT
• RCT
• RC

38. What is the sequence in which Page_Load events are executed?

Answers:

• Master Page, Page, User Control
Page, Master Page, User Control
• User Control, Page, Master Page
• Master Page, User Control, Page

39. Which one of these file extensions will not be served over HTTP and any direct URL request for it is automatically rejected?

Answers:

• .aspx
• .asax
• .ashx
• .json

40. How do you ensure that a validator control displays error message only when the associated control is invalid?

Answers:

• Set validator’s DisplayMode=»Dynamic»
• Set validator’s Visible=»True» as soon as the value in associated control change
• Set validator’s ValidateRequestMode=»Enabled»
• None of the above

41. Which property below affects how the .NET Framework handles formatting issues, sorting issues, currencies and handling dates?

Answers:

• CurrentCulture
• ShowCulture
• GetCulture
• AllCulture

42. An extension with both client-side as well as server-side components for writing ASP.NET pages that incorporate AJAX functionality.
Which of the following option is described by the above statement?

Answers:

• ASP.NET Razor
• ASP.NET Dynamic Data
• ASP.NET AJAX
• ASP.NET Handler

43. Which of the following represents the best use of the Table, TableRow, and Table-Cell controls?

Answers:

• To create and populate a Table in Design view
To create a customized control that needs to display data in a tabular fashion
• To create and populate a Table with images
• To display a tabular result set

44. ASP.NET Page Unload event is raised when?

Answers:

• The user closes the browser
• The page and its controls have been rendered
• The user loads a new page in the same browser window
• The user signs-out of the application

45. Where can we assign value to Static read only member variable of a static class?

Answers:

• Default constructor
• Parameterized constructor
• Global.asax
• inside the class method

46. Which option defines the collection trigger objects with each corresponding to an event the causes the panel to refresh automatically?

Answers:

• Triggers
• RenderMode
• IsInPartialRendering
• Eachevent

47. Which of the following is not a valid type of parameter for anSqlDataSource?

Answers:

• CookieParameter
• LocalStorageParameter
• ProfileParameter
• QueryStringParameter

48. Which option below uses multi-language abilities and allows Web pages to be coded in VB.NET, C#, J# and Delphi.NET?

Answers:

• Language Runtime
• Library
Framework
• None of the above

49. Which option retrieves the dynamically created template container object and is used for adding child controls programmatically?

Answers:

• ContentTemplate
• ChildrenAsTriggers
ContentTemplateContainer
• All of the above

50. Let’s suppose a SqlDataSource and a GridView are configured with SELECT and UPDATE queries; and GridView has AutoGenerateEditButton=True, how can we ensure data concurrency in an efficient way?

Answers:

Use SQL transaction so that only one user can view and edit data at a time
• It is impossible to ensure data concurrency while using SqlDataSource
• Add a ConflictDetection attribute to SqlDataSource
• Store the original data in the ViewState and before saving the changes, compare the original data with the database record

51. What is/are the predefined TraceListener(s) in ASP.Net?

Answers:

• TextWriterTraceListener
• EventLogTraceListener
• DefaultTraceListener
• All of the above

52. If there are threads in a .NET Framework, which option will tell you the priority level for the threads?

Answers:

• Normal
• AboveNormal
• Highest
• All of the above

53. Which of the following is true about AutoPostBack property of a server control?

Answers:

• It causes the control to fire postback event.
• By default, this property is set to False.
Both are true.
• None of the above are true.

54. Which of the following is not a column type for a GridView?

Answers:

• DynamicField
• ImageField
• CommandField
• CustomField

55. Which page event is the most suitable to programmatically change the master page?

Answers:

• PreInit
• Init
• Load
• Render
• PreRender

56. Which of the following statements explains the limitations of AJAX?

Answers:

• It is difficult to bookmark a particular state of the application.
• Function provided in the code-behind file do not work because the dynamic pages cannot register themselves on browsers history engine automatically.
• If JavaScript is disabled, then AJAX is not able to perform any work.
• Response time may be slow because different controls of a page are loaded at different time.
• All of the above

57. Which statement is True?

Answers:

• User controls are displayed correctly in the Visual Studio .NET Designer.
Custom controls are displayed correctly in VS.Net Designer.
• User and Custom controls are displayed correctly in the Visual Studio .NET Designer.
• All of the above

58. Where are routes registered in ASP.NET MVC Application?

Answers:

• Controller
• Web.config
Global.ascx
• All of the above

59. Which of the following is true?

Answers:

• User controls are displayed correctly in the Visual Studio .NET Designer.
Custom controls are displayed correctly in VS.Net Designer.
• User and Custom controls are displayed correctly in the Visual Studio .NET Designer.
• None of the above

60. Declaring more than one page directives on an ASP.NET page will result in?

Answers:

A compile-time error
• A run-time error
• No error
• None of the above

61. ____ is not a member of ADODBCommand object.

Answers:

• ExecuteReader
• ExecuteStream
• ExecuteScalar
• CommandText
• Open

62. Accessing Asp.net controls using jQuery is demonstrated by

Answers:

• $(‘#<%= myTextBox.ClientID %>’)
• $(‘[id$=myTextBox]’)
$(‘[id*=myTextBox]’)
• <asp:TextBoxrunat=»server» ID=»myTextBox» CssClass=»myclass» />
• <asp:TextBoxrunat=»server» ID=»myTextBox» ClientIDMode=»Static» />
$(‘#myTextBox’)
• All of the above

63. How could you traditionally consume an ASMX web service from your application?

Answers:

• Generate a proxy by selecting Add Reference in Visual Studio.
• Create an HttpService and connect using Get (URL).
• Generate a proxy by selecting Add a Service Reference in Visual Studio.
• Create a WCF proxy class.
2 and 3 both.
• All of the above

64. __ element in the web.config file is used to run code using the permissions of a specific user.

Answers:

• credential element
• authentication element
• authorization element
identity element

65. To enable client-side callbacks in an ASP.NET page that do not trigger a postback, you must need to?

Answers:

Implement ICallbackEventHandler interface on that page
• Use IsCallback property of page class, without writing any code to enable client-side callbacks
• Use UpdatePanel for partial page loading
• Both 1 or 2 will work

66. _____ is a data source control which will not implement Caching.

Answers:

• LinqDataSource
• ObjectDataSource
• SqlDataSource
• XmlDataSource

67. The purpose of Page.EnableEventValidation=»true» is that?

Answers:

• It enables all the validator controls on the page, which are disabled by default
It validates that a control event originated from the user interface that was rendered by that control
• It enables validation on event handlers code
• Enabling it stores the state of the validators in ViewState so that it is available after a post back

68. You are modifying an existing ASP.NET MVC web application to incorporate mobile access. What should you do to ensure that mobile devices view mobile-only pages? (Choose all that apply.)

Answers:

• Run the Install-Package jQuery.Mobile.MVC command using the Package Manager console.
• Create a _Layout.Mobile.cshtml master layout page.
• Create additional views with .Mobile, such as Index.Mobile.cshtml.
• Create additional views with .Mobile, such as Index.Mobile.cshtml as well as a _Layout.Mobile.cshtml master layout page.
• 1 and 4 both
• All of the above

69. Which option will allow you to get the text inside the new HTMLEditor in ASP.Net Ajax Control Toolkit?

Answers:

controlName.Content
• controlContent.Name
• controlID.Content
• controlContent.ID

70. The maximum number of content placeholders in a master page is?

Answers:

• Only one
• 10
• Decided on runtime
Unlimited

71. You are developing an ASP.NET MVC 2 application. A view contains a form that allows users to submit their first name. You need to display the value that is submitted, and you must ensure that your code avoids crosssite scripting. Which code segment should you use?

Answers:

• <% Response.Write(HttpUtility.HtmlDecode(Model.FirstName)) %>
• <%: Model.FirstName %>
• <%= Model.FirstName %>
• Both 2 &; 3 will work
• 1 and 4 both
• All of the above

72. Which kind of data can be stored in ViewState?

Answers:

•Viewstate can store only serializable object
•Viewstate can store anything
•Viewstate can store onlys string
None of the above

73. As you design a session-less state management system, what do you need to ensure that your application manages?

Answers:

• Access to the state management system, whether it is a database, a web service, or other type of system
•HTTP headers
•The session setting within the Web.config file
•An identifier used by the server to identify the request
•1 and 4 both
• All of the above



No comments:

Post a Comment