Do you know that? When it comes to absorbing and retaining new inforamtion, any form of distraction (including music) is detrimental next

Contact Email: teammmrem@yahoo.com

<< All Upwork (oDesk) and Elance Tests << Elance test answers << IT & Programming category

Test answers for ASP.NET 2016

(147, CL) Last updated: May 26
Elance • IT & Programming
Questions and answers are regularly updated. Answered and not answered tests questions.

This helps getting job: Hundreds of (cover letter examples , interview questions , profile samples ) • Earn on Upwork (oDesk)
Job assistance: jobs popularityfreelance rates

Popular test answers: HTML, .Net, CSS, English, SEO, Photoshop, iOS, Java, Android, Ruby, Python, JavaScript

See all 6 tests answers updated

Find Upwork (oDesk) and Elance test answers on this website:



Collapse | Expand

147 Answered Test Questions:

1. Which file is used to configure an asp.net website?

Answers:

• asp.settings

• index.html

• web.config

• power.cs

• settings.ini

2. Contents of assembly file can be investigated using

Answers:

• ILDASM.exe

• ILDASM.aspx

• ILDASM.dll

• ILDASM.inc

3. In ASP.Net, session is maintained using the methods:

Answers:

• Only SQL Server

• Only Session State Service

• Only In-Process storage

• (all of these)

4. What is/are the methods to author pages in ASP.NET?

Answers:

• In-Line Code

• By-Directional Code

• Code Behind

• Both In-Line Code and Code Behind

• Outline Code

5. What’s the difference between Response.Write() andResponse.Output.Write()?

Answers:

• Response.Output.Write() allows you to stream output

• Response.Output.Write() allows you to flush output

• Response.Output.Write() allows you to write formatted output

• Response.Output.Write() allows you to buffer output

6. What class does the ASP.NET web form class inherit from by default?

Answers:

• System. Web. GUI.Page

• System.Web. UI.Page

• System.Web.Form

• System.Web. UI.Form

7. What is the different between int.Parse() and Convert.ToInt32()

Answers:

• int.Parse() take only string() but Convert.ToInt32() take any object

• int.Parse() take any object but Convert.ToInt32() take only string()

• No different between its

8. Which formats can Web API work with?

Answers:

• XML

• All of these

• xVx

• ATOM Pub

9. In which event are the controls fully loaded?

Answers:

• Page.PreInit()

• Page.OnLoad()

• Page.Init()

• Page.Load()

10. Which method of the ServiceController class will allow you to send a command to the service?

Answers:

• Start()

• ExecuteCommand()

• Stop()

• Pause()

11. Which of the following file types is associted with ASP.NET User controls?

Answers:

• .aspx

• .asax

• .ascx

• .asmx

12. The logical and physical boundary created around every .NET application is known as:

Answers:

• Process Domain

• Process Space

• Application Domain

• Thread Space

13. When an .aspx page is requested from the web server, the out put will be rendered to browser in following format.

Answers:

• WML

• XML

• JSP

• HTML

14. How to identify a postback

Answers:

• use Session

• ViewState

• MachineState

• Postback

• use IsPostback

15. The Asp.net server control, which provides an alternative way of displaying text on web page, is

Answers:

• < asp:listitem >

• < asp:button >

• < asp:label >

16. Can you write serverside code inside aspx page

Answers:

• Yes use the <% %>

• No cant it should inside .cs file

17. What is used to validate complex string patterns? i.e email

Answers:

• Extended Expressions

• Basic Expressions

• Regular Expressions

• Irregular expressions

18. The property of the Page class used to determine if the page has posted back is:

Answers:

• IsPostBack

• HasPostedBack

• PostBack

19. Can you set which type of comparison you want to perform by the CompareValidator control?

Answers:

• Yes

• No

20. Which of the following is a property all the ASP.NET controls have?

Answers:

• runat

• bgcolor

• name

• text

21. Give One word: Common type system is built into which of the following

Answers:

• RCT

• CLR

22. What is ASP.Net

Answers:

• Programming Language

• Server Side Technology

23. Which is the parent class of Web server control?

Answers:

• System.Web.Type

• System.Web.Ul.BaseControl

• System.Web.Ul.Type

• System.Web.Ul.Control

24. How can I show the entire validation error message in a message box on the client side?

Answers:

• In the ValidationSummary control set property called “ShowMessageBox” to true.

• Write custom java script code and set ScriptEnabled to "true"

• Not supported

25. Which of the following denote the web control associated with Table control function of ASP.NET?

Answers:

• TableRow

• ListBox

26. What is the syntax to inherit from a class in C#?

Answers:

• Place a colon and then the name of the base class.

• The signature of the virtual method must remain the same

• A class that cannot be instantiated

27. ASP.NET separates the HTML output from program logic using a feature named as

Answers:

• None of the above

• Code-front

• Code-behind

• Exception

28. The number of forms that can be added to a aspx page is.

Answers:

• 3

• 7

• 2

• 4

• 1

29. What must be done before you can consume a web service?

Answers:

• Build a proxy library by using the TblImp.exe utility.

• Build a proxy library by using the csc.exe utility.

• Build a proxy library by using the wsdl.exe utility

• Build a proxy library by using the Disc.exe utility.

30. Which attribute must be set on the validator control for the validator to work?

Answers:

• validatecontrol

• ControlToValidate

• controltobind

• validate

31. In Asp.Net Server.MapPath(".") points to which location

Answers:

• there is no such function in asp.net

• it will not point to any location

• points to C:\\My Documents\Microsoft Visual Studio folder

• points to the location where your project stored

32. What is the difference in Application State and View State?

Answers:

• Application State is stored on the client machine while ViewState is stored on the server.

• None of the above.

• Application State is stored on the server while ViewState is stored on the client machine.

33. We can manage states in asp.net application using

Answers:

• Viewstate

• Session Objects

• Application Objects

• (all of these)

34. Which of the following controls is used to validate that two fields are equal?

Answers:

• CompareValidator

• Equals() method

• Required Field Validator

• RegularExpressionValidator

35. Where are private assemblies stored in ASP.NET?

Answers:

• windows directory

• root directory of bootable drive

• application root directory

• application / bin directory

36. Which HTML control property should be set to access control from code behind?

Answers:

• ID = "TextBox2"

• ClientID = "TextBox1"

• RunatServer = "True"

• Runat = "Server"

37. What is the extension of a web user control file?

Answers:

• .Aspx

• .Asmx

• .Ascx

38. What’s the difference between localization and globalization?

Answers:

• Different namespaces

• Localization is local issues while globalization is global issues

• Localization is from the client perspective while globalization is from the server perspective

• They’re both the same

39. Which version of ASP .NET MVC has built-in support for mobile targeting?

Answers:

• MVC 2

• MVC 3

• MVC 4

• MVC 1

40. What is the name of the property to get client side id for a control at run time?

Answers:

• Name

• ID

• ClientID

• ClientSideID

41. Which of the following ASP.NET directories stores class files (.cs) by default?

Answers:

• App_Data

• App_Code

• Bin

• App_GlobalResources

42. What is the different between int.Parse() and Convert.ToInt32()

Answers:

• int.Parse take only string() but Convert.ToInt32() take [object]

• int.Parse take [object] but Convert.ToInt32() take only string()

43. Which of the following is not a .NET compatible language?

Answers:

• VB.NET

• C#, J#

• COBOL.NET, Perl.NET

• Java

• Managed C++

44. Which of the following is a navigation control:

Answers:

• None of these

• Menu

• Pager

• Repeater

45. Page 1 has this link: <a href="page2.asp?color=green">Go</a> How can page2.asp get the "color" parameter?

Answers:

• Response.Parameter("color")

• Get("color")

• Request.QueryString("color")

• Response.QueryString("color")

46. What is default timeout of session in asp.net?

Answers:

• 10ns

• 10min

• 20 min

• 20 ns

• 1 hr

47. The feature in ASP.NET 2.0 that is used to fire a normal postback to a different page in the application is called

Answers:

• Theme

• Code-front

• None of the above

• Cross Page Posting

48. Which of the following is/are applicable while using Server Socket Level communications?

Answers:

• The certificate must match the web address to prevent a browser warning or error.

• All of these choices

• The certificate must be issued by an authority recognized by the client computer to prevent a browser warning or error.

• A certificate must be installed on the server.

49. ASP server scripts are surrounded by delimiters, which?

Answers:

• <%>...</%>

• <%...%>

• <script>...</script>

• <&>...</&>

50. .NET remote server object must implement?

Answers:

• IUnknown

• IMarshalByRef

• ISerializable

• ISingleCall

• IMarshalByValue

51. ASP.NET stores membership, role management, and profile information in which database?

Answers:

• netdb

• aspdotnetdatabaase

• aspnetdb

• aspdotnetdb

52. Which method do you use to kill explicitly a users session?

Answers:

• Session.Kill(true) method

• Session.Kill() method

• Session.Flush() method

• Session.Abandon() method

53. How do you enable impersonation in the web.config file?

Answers:

• <impersonate = "true" />

• <setImpersonate = "true" />

• <identity setImpersonate = "true" />

• <identity impersonate = "true" />

54. Why should you close all database objects and set them to NULL before leaving the method where the objects were created?

Answers:

• To ensure that the object’s destructors are called.

• To ensure that the objects can be reused.

• To ensure that the connection to the database is closed as soon as possible

55. How ASP.Net Different from classic ASP?

Answers:

• Scripting is separated from the HTML, Code is interpreted seperately

• 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

56. To load an assembly dynamically, the method used is:

Answers:

• Assembly.LoadDynamic()

• Assembly.Memory.Load()

• Assembly.Load()

• Assembly.Dynamic.Load()

57. What is the default scripting language in ASP?

Answers:

• Javscript

• VBScript

• PERL

58. How do you disable client side script in validators?

Answers:

• Set EnableScript property to false

• Delete the EnableClientScript property in the markup code

• Set DisableClientScript property to true.

• Set EnableClientScript property to false.

59. How do you get info from a form that is submitted using the post method?

Answers:

• Request.Form

• Response.WriteLine

• Request.QueryString

• Response.Write

60. The first method that is executed in the Page life cycle in ASP.NET is:

Answers:

• Init

• PreInit

• Page.Load

• PreLoad

61. Can ASP.NET run on a linux server?

Answers:

• No

• Microsoft is planning to change ASP.NET to run on linux in the future

• Linux doesn’t have server variants

• Yes, via the Mono project

62. The property used to support Cross Page Scripting in ASP.NET is:

Answers:

• AutoPostBackUrl

• PostBackUrl

• AutoPostBack

63. _______ is a special subfolder within the windows folder that stores the shared .NET component?

Answers:

• GAC

• Root

• /bin

64. Which of the following statements best describes setting up an async page in .NET 4.5?

Answers:

• async=true on page directive, RegisterAsyncTask in page load and async method

• async method

• TaskFactory.StartNew(method1)

• async=true on page directive

65. Can Web API be hosted in its own process without IIS?

Answers:

• Yes

• No

66. By default, ASP.NET store SessionIDs in

Answers:

• Database

• Cookies

• Cache

• Global variable

67. You are developing ASP.NET templated server control. You need to ensure that a new ID namespace is created within the page control hierarchy when the control is added to the page. Which interface should you implement on the control?

Answers:

• IDataKeysControl

• IDataItemContainer

• INamingContainer

• IExtenderCtonrol

68. Which of the following contains one or more variables that are accessed through sequential indices?

Answers:

• Indexers

• Arrays

• Delegates

• Nullable Types

69. What method(s) must be used with the Application object to ensure that only one process accesses a variable at a time?

Answers:

• ThreadLock

• Synchronize()

• Lock() and UnLock()

70. Can MVC, Web Forms and Web API be mixed in the same project?

Answers:

• Only MVC and Web Forms, not Web API

• Only in .NET 4.5

• No

• Yes

71. Which two new properties are added in ASP.NET 4.0 Page class?

Answers:

• Culture and Description

• MetaKeyword and MetaDescription

• Culture and Locale

• Keyword and Description

72. How can an MVC View be protected from CSRF?

Answers:

• @Html.AntiForgeryToken() in View and ValidateAntiForgeryToken attribute on controller action

• @Html.AntiForgeryToken() in View

• Web.Config app setting AntiForgeryToken true

• not possible

73. "<%=" is the same as:

Answers:

• <&

• <%

• Document.Write

• Response.Write

74. which of the following is not ASP.NET directives?

Answers:

• page

• import

• web

• register

75. In the following example, is viewstate being set?  (Test.aspx - viewstate enabled)  <asp:Label id=”LabelTest” runat=”server” />  (Test.aspx.cs)  protected override void OnLoad(EventArgs args) {         this.LabelTest.Text = “changed”;         base.OnLoad(e); }

Answers:

• Only if LabelTest.Text is changed in following events before PreRender

• No

• Yes

• Only in .NET 4+

76. Which of the following denotes the web control associated with Table control function of ASP.NET?

Answers:

• ListBox

• TableRow (ANS)

• DataList

77. True or False: Without Web.config file application will not compile or Run.

Answers:

• True

• False

78. In LINQ what is the difference in .Ancestor and .Parent?

Answers:

• Parent is the immediate node a level above, Ancestors is all nodes all levels above.

• None of the above

• Parent is the immediate node a level above, Ancestors is all nodes above and below.

• Parent is the immediate node below, Ancestors is all nodes above and below.

79. Can you run a web application without the web.config file?

Answers:

• It will not compile if there is no web.config file

• Runtime error

• Yes

• No

80. How do you make a controller action async?

Answers:

• return an async Task from controller action while awaiting within the method

• Register async controller action in Global.asax

• return an async Task<ActionResult> from controller action while awaiting within the method

• return an async Task from controller action

81. How can you disable client-side validation in ASP.NET?

Answers:

• By setting EnableScripting to false

• By setting the EnableClientScript property to false

• By setting ValidateScripting to false

• by setting CauseValidation to false

• By setting ValidateClientScript to false

82. In which of the following SessionState Modes the Session_End event fires?

Answers:

• None

• SQL Server

• Inproc

• StateServer

83. When would WCF be a better solution than Web API?

Answers:

• Need for REST

• Need for XML

• Need for SOAP

• Need for metadata

84. Where is the default Session data stored in ASP.Net?

Answers:

• StateServer

• InProcess

• Session Object

85. The property used to access user's locale information is:

Answers:

• System.Web.UI.Page.Locale

• System.Web.Locale

• System.Web.UI.Page.User

• System.Web.UI.Page.Culture

86. What is the maximum number of cookies that can be allowed to a web site?

Answers:

• 20

• 10

• 1

• more than 30

87. The low level Request and Response API to service incoming Http requests in ASP.NET is called:

Answers:

• HttpAPI

• HttpHandler

• HttpRequest

• HttpResponse

88. The threading model used in ASP.NET is:

Answers:

• Single Threaded

• STA

• MTA

• Not supported

89. What is the role of the Web API Media Type Formatter?

Answers:

• Reads the message body and serializes the response

• Reads the message body only

• A custom parameter binding that can read any part of the HTTP request

• Reads from the URI path and querystring

90. The application event that is fired at the beginning of each request to the server is called:

Answers:

• Application_OnStart

• Application_BeginRequest

• Application_Init

• Application_Start

91. The property used to ensure that the encoded and encrypted viewstate is not tampered is:

Answers:

• ViewStateSafe

• ViewStateSecure

• EnableViewState

• EnableViewStateMac

92. In ASP.NET if you want to allows page developers a way to specify static connections in a content page then the class used is

Answers:

• ProxyWebPartManager

• System.Activator

• None of the Above

• WebPartManager

93. The infrastructure that supports these dynamic operations at run time is called the__________.

Answers:

• DLR

• CLR

• CTS

• CLS

94. Which of the following is not a Web Form Event in ASP.NET: Page_Dispose Page_Error Page_AbortTransaction Page_CommitTransaction

Answers:

• All of these

• Page_Dispose

• None of these

• Page_Error

95. What can we specify in the web.config to apply Themes to an ASP.NET application?

Answers:

• <pages themesEnabled="true" />

• <pages theme="Windows7" />

• <pages applyTheme="Windows7" />

• <pages theme="true" />

96. Which of the following events are correctly ordered according to the Application lifecycle?

Answers:

• BeginRequest, AuthenticateRequest, AuthorizeRequest, AcquireRequestState, ResolveRequestCache, ProcessRequest, UpdateRequestCache, ReleaseRequestState, EndRequest.

• BeginRequest, ResolveRequestCache, AuthenticateRequest, AuthorizeRequest, AcquireRequestState, ProcessRequest, ReleaseRequestState, UpdateRequestCache, EndRequest.

• BeginRequest, AuthenticateRequest, AuthorizeRequest, ResolveRequestCache, AcquireRequestState, ProcessRequest, ReleaseRequestState, UpdateRequestCache, EndRequest.

• BeginRequest, AuthorizeRequest, AuthenticateRequest, ResolveRequestCache, AcquireRequestState, ProcessRequest, ReleaseRequestState, UpdateRequestCache, EndRequest.

97. What is the use of "_" in asp.net?

Answers:

• line break

• separate

• link

• concatenate

• space

98. What are the primary request headers involved in Web API content negotiation?

Answers:

• Accept, Accept-Charset, Accept-Encoding, Accept-Language

• Accept-Charset, Accept-Encoding

• X-Requested-With, Accept, Accept-Charset, Accept-Encoding, Accept-Language

• Accept-Charset, Accept-Encoding, Accept-Language

99. Which method has been introduced in ASP.NET 4.0 to redirect a page permanently?

Answers:

• Redirect(true) method

• PermanentRedirect() method

• Page.Redirect(true) method

• RedirectPermanent() method

100. Which property is used to retrieve a username in Windows Authentication?

Answers:

• System.Environment.GetUserName

• System.UserName

• System.Environment.UserName

• System.Environment.User

101. What is wrong with this code?  string email = emailTextbox; string SQL = "select * from users where username = '"+email+"' "; SqlCommand myCommand = new SQLCommand(SQL, myConnection) try  {     myConnection.Open();     SqlDataReader myReader=myCommand.ExecuteReader();     if (myReader.Read())     { ...

Answers:

• the string email will not have the right value.

• the SQL is subject to injection attacks.

• the string email will not have the right value and the SQL is subject to injection attacks.

• a SqlDataReader can't be instantiated from a SqlCommand object.

• There is nothing wrong in this code.

102. How can Web API OData support be implemented?

Answers:

• Controller extends EntitySetController<T>

• Return IQueryable or IEnumerable

• All of these

• Controller extends ODataController

103. How can you protect the asp:login object from SQL Injection attacks?

Answers:

• It is protected by default.

• Make sure the connection string used only has read access to the database.

• Set the SqlFilter property to true.

• Create a SqlFilter object and pass the inputs through it.

• Use a regular expression to filter the inputs before login.

104. To prevent a browser from caching an .aspx page the statement used is:

Answers:

• Response.Cache.SetNoStore ();

• Response.NoCache = "true";

• Response.Cache = "Yes"

• Response.Cache = "false";

105. What are the three IIS isolation levels?

Answers:

• Pooled, Non pooled, Not set

• Base, Custom and Enhanced

• Base, Custom and High

• Low, Medium and High

106. How do you sign out from forms authentication?

Answers:

• Using FormsAuthentication.Logout() method

• Using FormsAuthentication.Signout() method

• Using FormsAuthentication.Logoff() method

107. How can the button click work in the following code:  <asp:ScriptManager EnablePartialRendering="true" ID="ScriptManager1" runat="server"></asp:ScriptManager>  <asp:UpdatePanel ID="UpdatePanel1" runat="server"          UpdateMode="Conditional">  <ContentTemplate>  <asp:Label ID="Label1" runat="server" /><br /> </ContentTemplate>  </asp:UpdatePanel> <asp:Button ID="Button1" runat="server"  Text="Update Panel" OnClick="Button1_Click" />

Answers:

• Trigger attribute on Button control

• Triggers tag with AsyncPostBackTrigger

• TriggerControl attribute on UpdatePanel

• Trigger element in UpdatePanel

108. I have a property in my code-behind  get { return (Custom)Session["Custom"]; } set { Session["Custom"] = value; }  and I receive a serialization error  What are the possible solutions?

Answers:

• All of these will work

• Change the property type to HashSet<Custom> instead of Custom

• Change sessionstate mode to InProc

• Add the Serializable attribute to Custom class

109. What is the role of the Web API Media Type Formatter?

Answers:

• A custom parameter binding that can read any part of the HTTP request

• Reads the message body and serializes the response

• Reads from the URI path and querystring

• Reads the message body only

110. Asynchronous behavior is related to

Answers:

• None of these

• Multi-core Processors

• Parallel Programming

• Threading

111. Which of the following statements is true about the GridView in .NET 4.5?

Answers:

• Strongly typed object binding

• Uses AJAX functionality by default

• Can only be bound to a data sources or objects that are data bound in code behind

• Uses CSS div’s instead of html table based layout

112. What is the default timeout for a Cookie?

Answers:

• 20 minutes

• 30 minutes

• 60 minutes

• 40 minutes

113. How do you make a controller action async?

Answers:

• return an async Task from controller action

• return an async Task<ActionResult> from controller action while awaiting within the method

• return an async Task from controller action while awaiting within the method

• Register async controller action in Global.asax

114. What is correct Syntax for applying FAViCON ICON to your web page.

Answers:

• <link rel="icon" href="/favicon.ico" type="image/x-icon"/>

• <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>

• <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/> <link rel="icon" href="/favicon.ico" type="image/x-icon"/>

115. Which of the following is not a WCF service behaviour?

Answers:

• Recording information about messages, such as tracking, tracing, or logging

• Adding security features to a service, such as impersonation, authorization, or managing tokens

• Endpoint addresses

• Message and validation

116. "<%=" is the same as:

Answers:

• <%

• Response.Write

• <&

• Document.Write

117. Under what condition(s) should a controller action be made async?

Answers:

• All controller actions should be made async

• CPU & IO intensive

• CPU intensive

• IO intensive

118. How do you turn off cookies for a page?

Answers:

• Set Cookie.Discard property to true

• Set CookieEnabled = false in all pages

• Set IsCookieEnabled to false in all pages

• Set Cookie to false in all pages

119. To enforce compatibility between ASP.NET and old COM components that does not support MTA model the attribute used in the @Page directive is:

Answers:

• aspcompatibility

• aspcompat

• aspnetcompat

• backwardcompatibility

120. To check for integrity of data in a Request object, the method used is:

Answers:

• HttpRequest.ValidateUserInput()

• HttpRequest.Validate()

• HttpRequest.ValidateInput()

• HttpRequest.Current.Validate()

121. How does Web API OData support partial updates?

Answers:

• Patch<T> parameter in controller action

• PartialUpdatesEnabled in global.asax.cs

• Delta<T> parameter in controller action

• PartialUpdatesEnabled setting in web.config

122. Which of the following locking techniques is considered speculative?

Answers:

• SpinWait

• MemoryBarrier

• lock

• SpinLock

123. What are the strategies for partitioning threads in a PLINQ query?

Answers:

• Auto or manual

• AsParallel().WithDegreeOfParallelism()

• Chunked, ranged or hashed

• IEnumerable or IQueryable

124. What can we specify in the web.config to apply Themes to an ASP.NET application?

Answers:

• <pages applyTheme="Windows7" />

• <pages theme="Windows7" />

• <pages themesEnabled="true" />

• <pages theme="true" />

125. The XML format that you can use to render DataSet object contents to XML is called:

Answers:

• RenderXML

• DiffGram

• RenderDataSet

• XMLRender

126. Which of the following statements is true?

Answers:

• IEnumerable is a pull based sequence

• IEnumerable is both push and pull based

• IEnumerable is thread safe by default because each iterator gets an IEnumerator

• IEnumerable is a push based sequence

127. What are the built-in WCF message encoder implementations?

Answers:

• StringMessageEncoder, BinaryMessageEncoder & MtomMessageEncoder

• TextMessageEncoder, BinaryMessageEncoder & MtomMessageEncoder

• All of these

• TextMessageEncoder, BinaryMessageEncoder & AtomMessageEncoder

128. Caching in ASP.NET is used to:

Answers:

• Reduce redundant object creation

• Reduce server round trips

• Load pages from memory

• Reduce database hits

129. The property used to set absolute cache expiration in ASP.NET is:

Answers:

• Cache.NoExpiration

• Cache.NoSlidingExpiration

• Cache.SetAbsoluteExpiration

• Cache.AbsoluteExpiration

130. Postback occurs in which of the following forms.

Answers:

• HTMLForms

• Winforms

• Webforms

131. What class does the ASP.NET web form class inherit from by default?

Answers:

• System.Web. UI.Page

• System.Web.Form

• System.Web. UI.Form

• System. Web. GUI.Page

132. What is the different between int.Parse() and Convert.ToInt32()

Answers:

• int.Parse() take any object but Convert.ToInt32() take only string()

• int.Parse() take only string() but Convert.ToInt32() take any object

• No different between its

133. How ASP.Net Different from classic ASP?

Answers:

• Scripting is separated from the HTML, Code is interpreted seperately

• 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

134. How can I show the entire validation error message in a message box on the client side?

Answers:

• Write custom java script code and set ScriptEnabled to "true"

• In the ValidationSummary control set property called “ShowMessageBox” to true.

• Not supported

135. What is the different between int.Parse() and Convert.ToInt32()

Answers:

• int.Parse take only string() but Convert.ToInt32() take [object]

• int.Parse take [object] but Convert.ToInt32() take only string()

136. Which HTML control property should be set to access control from code behind?

Answers:

• Runat = "Server"

• RunatServer = "True"

• ID = "TextBox2"

• ClientID = "TextBox1"

137. In Asp.Net Server.MapPath(".") points to which location

Answers:

• points to the location where your project stored

• there is no such function in asp.net

• it will not point to any location

• points to C:\\My Documents\Microsoft Visual Studio folder

138. Page 1 has this link: <a href="page2.asp?color=green">Go</a> How can page2.asp get the "color" parameter?

Answers:

• Response.QueryString("color")

• Get("color")

• Request.QueryString("color")

• Response.Parameter("color")

139. How do you enable impersonation in the web.config file?

Answers:

• <identity setImpersonate = "true" />

• <identity impersonate = "true" />

• <setImpersonate = "true" />

• <impersonate = "true" />

140. Where is the ViewState information stored?

Answers:

• in cookies

• in the HTML hidden fields.

• in database

• in session variables

• query string

141. What is the method name to make upper case to string value?

Answers:

• ToUpper()

• toUpperCase()

• ToUpperCase()

• Toupper()

• ToUpperString()

142. What is the different between int.Parse() and Convert.ToInt32()

Answers:

• int.Parse() take any object but Convert.ToInt32() take only string()

• No different between its

• int.Parse() take only string() but Convert.ToInt32() take any object

143. What is wrong with this code?  string email = emailTextbox; string SQL = "select * from users where username = '"+email+"' "; SqlCommand myCommand = new SQLCommand(SQL, myConnection) try  {     myConnection.Open();     SqlDataReader myReader=myCommand.ExecuteReader();     if (myReader.Read())     { ...

Answers:

• a SqlDataReader can't be instantiated from a SqlCommand object.

• There is nothing wrong in this code.

• the string email will not have the right value.

• the SQL is subject to injection attacks.

• the string email will not have the right value and the SQL is subject to injection attacks.

144. To prevent a browser from caching an .aspx page the statement used is:

Answers:

• Response.NoCache = "true";

• Response.Cache = "Yes"

• Response.Cache = "false";

• Response.Cache.SetNoStore ();

145. What is correct Syntax for applying FAViCON ICON to your web page.

Answers:

• <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/> <link rel="icon" href="/favicon.ico" type="image/x-icon"/>

• <link rel="icon" href="/favicon.ico" type="image/x-icon"/>

• <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>

146. What can we specify in the web.config to apply Themes to an ASP.NET application?

Answers:

• <pages applyTheme="Windows7" />

• <pages theme="true" />

• <pages themesEnabled="true" />

• <pages theme="Windows7" />

147. When decorating a function with async, what is the appropriate return type?

Answers:

• Task<>

• List<Object>

• async

• Task<object>