You are on page 1of 34

1 1) Which of the following languages can be used to write server side scripting in ASP.NET?

A) C# B) C C) Visual Basic D)both a & c Ans both a & c

2) The Following are the minimum requirement to run Asp.net pages A) Java Virtual Machine B) Common Language Runtime C) Windows explorer ANS common language runtime

3) When a .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 Ans - html

4) What executable unit gets created when we build an ASP.Net application? A) . EXE B) . DLL C) . COM Ans- .DLL

5) The best way to delimit ASP.Net code from HTML code in your pages is using --------------- tags A) < Body > B) < Head > C) < Script >

2 Ans <script>

6) The code will be processed on web server when the runat attribute of the < Script > tag has the following value. A) Desktop B) Client C) Server Ans server

7) The Asp.net server control, which provides an alternative way of displaying text on web page, is A) < asp:label > B) < asp:listitem > C) < asp:button > Ans - <asp:label>

8) asp:dropdownlist> tag replaces which of the HTML tags A) < Option > B) < Select > C) < List > ans-<select>

9) The first event to be triggered in an aspx page is A) Page_Load() B) Page_Init() C) Page_click()

3 Ans Page_Init()

10) Postback occurs in which of the following forms A) Winforms B) HTMLForms C) Webforms ans webforms

11) 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- system.web.ui.page

12) How many configuration files can an ASP.NET projects have? A) One B) More Than One C) None Ans more than one

13) How do you register a user control? A) Add Tag prefix, Tag name B) Add Source, Tag prefix C) Add Src, Tagprefix, Tagname Ans- add src, tagprefix,tagname

14) How do you post the current page to a different aspx page ? A) FORM ACTION="actiopage.aspx" RUNAT="server" method="post" B) FORM ACTION="actiopage.aspx" method="post" C) FORM id="Form1" method="post" runat="server" Ans - FORM ACTION="actiopage.aspx" RUNAT="server" method="post"

15) Which of these namespaces used for FileAccess A) System.IO B) System.IO.IsolatedStorage C) System.DirectoryServices D) All of these Ans- system.io

16) Which of the following is true ? A) User controls are displayed correctly in the Visual Studio .NET Designer B) Custom controls are displayed correctly in VS.Net Designer C) User and Custom controls are displayed correctly in the Visual Studio .NET Designer. Ans - Custom controls are displayed correctly in VS.Net Designer

17) Can a dll run as stand alone application ?Skill/Topic: A) No B) Yes C) Sometimes we can make it by introducing some code Ans- No 18) To add a custom control to a Web form we have to register with A) TagPrefix

5 B) Name space of the dll that is referenced C) Assemblyname D) All of the above Ans- all of the above

19) Custom Controls are derived from which of the classes A) System.Web.UI.Webcontrol B) System.Web.UI.Customcontrol C) System.Web.UI.Customcontrols.Webcontrol Ans System.Web.UI.Webcontrol 20) A web application running on multiple servers is called as A) WebForm B) Webfarm C) Website Ans- webfarm 21) What is the transport protocol used to call a webservice A) HTTP B) SOAP C) TCP D) SMTP Ans soap

22) How ASP.Net Different from ASP A) Scripting is separated from the HTML, Code is interpreted seperately 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 Scripting is separated from the HTML, Code is compiled as a DLL, the DLLs can be

23) Whats the difference between Response.Write() andResponse.Output.Write()? A) Response.Output.Write() allows you to flush output B) Response.Output.Write() allows you to buffer output

6 C) Response.Output.Write() allows you to write formatted output D) Response.Output.Write() allows you to stream output Ans - Response.Output.Write() allows you to write formatted output

24) Why is Global.asax is used A) Implement application and session level events B) Declare Global variables C) No use Ans Implement application and session level events

25) There can be more than 1 machine.config file in a systemSkill/Topic: Beginner A) True B) False Ans true 26) What is the extension of a web user control file ? A) .Asmx B) . Ascx C) .Aspx Ans- .ascx

27) What is the default session out time A) 20 Sec B) 20 Min C) 1 hr Ans- 20 min

28) Which of the following is true ? A) IsPostBack is a method of System.UI.Web.Page class B) IsPostBack is a method of System.Web.UI.Page class

7 C) IsPostBack is a readonly property of System.Web.UI.Page class Ans- IsPostBack is a readonly property of System.Web.UI.Page class

29) It is possible to set Maximum length for a text box through code A) True B) False Ans true

30) The number of forms that can be added to a aspx page is A) 2 B) 3 C) 1 D) More than 3 Ans 1

31) How do you manage states in asp.net application A) Session Objects B) application Objects C) Viewstate D) Cookies E) All of the above Ans- all of the above

32) what is the difference between user control and custom control A) Both can use as drag and drop tool B) Both are same C) Both can use different application D) One Custom Control can be use in different project but not the same with User control ans- One Custom Control can be use in different project but not the same with User control

33) The interface used by ASP.Net to create Unique Ids? A) AppDomainsetup B) System.UI.Naming.Container C) IAsyncResult D) customFormatter Ans- System.UI.Naming.Container

34) Which property of the session object is used to set the local identifier ? A) SessionId B) LCID C) Item D) Key Ans- lcid

35) Select the caching type supported by ASP.Net A) Output Caching B) DataCaching C) Both a & b D) None of the above Ans both a & b

36) Where is the default Session data is stored in ASP.Net A) InProcess B) StateServer C) SQL Server D) All of the above Ans- inprocess

37) How do you disable client side validation ? A) Set the language property to C# B) Set the Runat property to server C) Set the ClientTarget property to Downlevel

9 D) Set the inherits property to codeb Ans Set the ClientTarget property to Downlevel

38) Select the validation control used for PatternMatching A) FieldValidator B) RegularExpressionValidator C) RangeValidator D) PatternValidator Ans- RegularExpressionValidator

39) How do you trace the application_End event on runtime? A) By Debugging B) By Tracing C) Can not be done Ans cannot be done

40) How do you turn off the Session state for a webform ? A) In Web.config file set the tag to True B) In Web.config file set the tag to false C) Set the Session state to false in webform properties window D) Set the EnableSession state to false in webform properties window Ans- d- Set the EnableSession state to false in webform properties window

41) Select the type Processing model that asp.net simulate A) Event-driven B) Static

10 C) Linear D) TopDown Ans- event-driven

42) Does the EnableViewState allows the page to save the users input on a form A) Yes B) No Ans yes

43) Web Controls Supports CSS A) True B) False Ans- true

44) Session Object classes are defined in which of the following namespace? A) System.Web.UI B) System.Web.SessionState C) System.Web Ans System.Web.SessionState

45) Which DLL translate XML to SQL in IIS A) SQLISAPI.dll B) SQLXML.dll C) LISXML.dll D) SQLIIS.dll Ans- SQLISAPI.dll

11

46) What is the default authentication mode for IIS A) Windows B) Anonymous C) Basic Authentication D) None Ans anonymous

47) Which of the following is not a valid state management tool? A) Application State B) Hidden Form Field C) Querystate D) Cookies Ans querystate

48) What is the maximum number of cookies that can be allowed to a web site A) 1 B) 10 C) 20 D) 30 E) More than 30 Ans 20

49) Select the control which does not have any visible or in-built interface A) Datalist B) DropdownList C) Repeater D) Datagrid Ans- repeater 50) How do you explicitly kill a users session ?

12 A) Session.Close ( ) B) Session.Discard ( ) C) Session.Abandon D) Session.End Ans session.abandon

51) Why do we use XMLSerializer class A) Remoting B) WebServices C) Xml documentary Files Ans- webservices

52) What does Response.End will do? A) It will stop the server process B) It will stop the client process C) None of the above Ans- It will stop the server process

53) Which control supports paging A) Repeater B) Datagrid C) Both D) None Ans- datagrid 54) Where do you store the information about the user locale A) System.user B) System.web C) System.Drawing D) System.Web.UI.Page.Culture Ans- System.Web.UI.Page.Culture

13

55) What is the purpose of code behind ? A) To separate different sections of a page in to different files B) To merge HTML layout and code in to One file C) To separate HTML Layout and code to different file D) To ignore HTML usage Ans c- To separate HTML Layout and code to different file

56) What is a satallite assembly ? A) Any DLL file used by an EXE file. B) An Assembly containing localized resources for another assembly C) None of the above Ans b - An Assembly containing localized resources for another assembly

57) Whch of the following is not a member of Response Object? A) Clear B) Write C) Execute D) Flush Ans execute

58) The object used by SQL connection to make Security Demands A) SQLLCientAttribute B) SQLPermission C) SQLPermissionClient D) SQLClientPermission Ans- sqlclientpermission

59) Which of the following is not a member of ADODBCommand object A) ExecuteReader B) ExecuteScalar C) ExecuteStream D) Open

14 E) CommandText Ans executestream

60) Which method do you invoke on the DataAdapter control to load your generated dataset with data? A) Load B) Fill C) GetAll D) None Ans fill

61) How to open more than one datareader at a time A) Use different datareader variable B) Use different datareader and connection variable C) Can not be done Ans b- Use different datareader and connection variable

62) What is the advantage of Disconnected mode of ADO.Net in ASP.Net A) Automatically dump data at client PC B) Not necessary to connect with server C) user data can update and retrieve in dataset and when connection connected, update values with server D) All of the above Ans c- user data can update and retrieve in dataset and when connection connected, update values with server

63) Which objects is used to create foreign key between tables? A) DataRelation B) DataRelationship C) DataConstraint D) Datakey

15 Ans datarelation 64) Which one of the following namespaces contains the definition for IdbConnection A) System.Data.Interfaces B) System.Data.Common C) System.Data D) System.Data.Connection Ans c system.data

65) Select the Interface which provides Fast, connected forward-only access to data A) IdataRecord B) Idatabase C) IdataReader D) Irecorder Ans idatareader

66) How do we Delete, Update, Select data in a Dataset A) Using SQLDataAdapter B) Using SQLDataReader C) Using SQLCommand D) None Ans a-using sqldataadapter

67) Which of the following is not a member of ConnectionObject A) BeginTransaction B) EndTransaction C) Execute D) Open Ans execute

68) Is it Possible to Serialize HashTable with XMLSerializer A) Yes

16 B) No Ans Yes

69) What is the Full Form of WSDL A) Web System Description Language B) Web Services Detail Language C) Web Service Description Language D) None Ans - WEB SERVICE DESCRIPTION LANGUAGE

70) What is the difference between Server.Transfer & Response.Redirect A) No Difference B) Server.Transfer needs a roundtrip, Response.Redirect does not C) Response.Redirect needs roundtrip, Server.Transfer does not D) Server.Transfer can transfer user between 2 applicaions Ans Response.Redirect needs roundtrip, Server.Transfer does not

71) Which Language can Support SOAP A) VB B) JAVA C) COBOL D) All of the above Ans- d- all of the above 72) What is the size of the session ID A) 32 bit long string B) 32 bit long double C) 32 bit long character D) 32 bit long integer Ans 32 bit long integer

73) Which of the following extension does a webservice file will have A) .Asmx B) .Aspx

17 C) .Ascx D) .Resx Ans .asmx

74) What is a strong name? A) Public Key B) Private Key C) Combination Of both Public,Private key and digital signature Ans c- Combination Of both Public,Private key and digital signature

75) What is the purpose of Reflection? A) For Reading metadata at runtime B) For knowing version of assembly C) For finding path of an assembly Ans- a- for reading metadata at runtim

76) Is it possible edit data in a repeater control A) No B) Yes Ans no

77) Why is Global.asax is used for ? A) To implement application & Session level events B) To store configuration information C) To store styling information D) None of the above Ans - To implement application & Session level events

78) What is a diffgram ? A) The one which renders the dataset object contents to XML

18 B) Finds the difference in two objects C) Finds the difference in two files D) None of the above Ans The one which renders the dataset object contents to XML

79) What is the lifespan for items stored in viewstate A) Exists for the Life of the current page B) 20 mins C) 2 mins D) 2 sec Ans - Exists for the Life of the current page

80) What data types do a Rangevalidator supports A) Integer B) String C) Date D) All of the above Ans all of the above

81) Select the output of the statement < form method=post action=test.aspx > A) Transfers all the form data to test.aspx with HTTP headers B) Transfers all the form data to test.aspx with out HTTP headers C) Calls post method on test.aspx D) None of the above Ans Transfers all the form data to test.aspx with HTTP headers

82) What is the out put of the following codebyte a=200;byte b=100;byte c=a+b;Response.Write ( C ); A) 300 B) Compile Time error C) Run time Error D) Just prints C

19 Ans Compile Time error

83) What is the out put of Following codeString a=Hello;String b=WorldString c= a+bResponse.Write ( C ); A) Hello world B) C C) A+b D) None of the above Ans - (B)-C

84) Whats the significance of Request.MapPath( ) A) Maps the specified virtual path to a physical path B) Maps the specified absolute path to virtual path C) None Ans - Maps the specified virtual path to a physical path

85) Which of the following are not a member of Server Object A) Execute B) Transfer C) Open D) HTMLDecode Ans open

86) **What is the significance of Server .MapPath A) Returns the physical file path that corresponds to virtual specified path B) Returns the Virtual Path of the web folder C) Maps the specified virtual path to Physical path D) None Ans a

20 87) What is the Server.MachineName does A) Gets the Servers Machine Name B) Gets the Referred Web site name on the server C) Gets the Client Machine Name D) None Ans Gets the Servers Machine Name

88) Whats is the significance of Response.ClearHeaders( ) A) Clears all Headers from the buffer stream B) Clears all the section value from rendered HTML File C) Clears the content of the Rendered page D) None of the above ans Clears all Headers from the buffer stream

89) What is the significance of Response.AddHeaders( ) A) Adds HTTP Headers to output stream B) Adds Tag to rendered Page C) Add Headers to the web site Ans Adds HTTP Headers to output stream

90) What is the difference between HTTP handlers & HTTP modules A) Httphandler is an class and Httpmodule is an assembly B) Httphandler is an event handler and httpmodule is module to do some task C) Both of the above D) None of the above Ans Httphandler is an class and Httpmodule is an assembly 91) Which namespace allows us to formauthentication ? A) System.Web.Ui.Forms.Security B) System.Web.Security C) System.Web.Configuration D) System.Web.Services

21 Ans System.Web.Security

92) When is the user controls code is executed A) After the webform loads B) After the page_init event of webform C) Before Page_init event of web form Ans After the webform loads

93) Client Sertificate is a collection of A) Server B) Response C) Collection D) Request Ans request 94) What section of the config.Web file is used for storing a list of authorized users? A) 1 B) 3 C) 4 D) None Ans 4

95) How do you add ASP.Net 3rd party component A) By add/Remove items in the project menu B) Add reference of dll file and place the code where ever required C) Cannot add 3rd party component to asp.net Ans Add reference of dll file and place the code where ever required

96) Web service directories allows us to locate ________ of web service

22 a) Consumers b) Providers c) Users d) None of these ANS Consumers.

97) Which namespace allow a consumer to discover web services installed on a given machine a) System.web.services.protocols b) System.web.services.description c) System.web.services d) System.web.services.discovery Ans d- System.web.services.discovery.

98) Deploying a web service is copying the web service entry point file(ASMX file) , the web service assembly and related assemblies and other support files like web.config etc to the target web server a) False b) True c) Not always true d) None of these Ans- true.

99) Which namespace consists a minimal and complete set of types needed to build a web service a) System.web.services.description b) System.web.services c) System.web.services.discovery

23 d) System.web.services.protocols Ans system.web.services.

100) If a user has cookies enabled, a session variable is available to all pages in one application a) True b) False Ans true.

101)

ASP server scripts are surrounded by delimiters,which?

a) <script>..</script> b) <&> ..</&> c) <%></%> d) <%..........%> Ans - <%........%>.

102)

Which one of these events is a standard global asa event

a) Application_on start b) Session_start c) Session_id d) Global asa doesnt have any standard events Ans application_on start.

103) Which namespace allows us to interact with WSDL programmatically a) System.web.services.description

24 b) System.web.services c) System.web.services.discovery d) System.web.services.protocols Ans system.web.services.description.

104) Which of these is not a member of the system.web.services namespace a) Webmethod attribute b) Webattribute c) Webservice d) Webservice binding attribute Ans webattribute.

105) What method of the xml DOM model will you use to delete a node from an xml document a) Remove parent b) Remove sibling c) Remove child d) Remove node Ans remove child.

106) The DISCO files are stored in the virtual directory of IIS along with the a) Asm file b) Asmx file c) Asmx directory d) With all the other related files and in some location where the user wants

25 ANS Asmx file.

107)

UDDI is:

a) Universal data, discovery and integration b) Universal description, data and integration c) Universal description, discovery and integration d) Universal description, discovery and integration Ans c - Universal description, discovery and integration.

108)

COM is

a) Computer object model b) Common object model c) Com object model d) Component object model Ans d component object model.

109) Which method do you invoke on the Data Adapter control to load your generated dataset A) Fill ( ) B) ExecuteQuery ( ) C) Read ( ) Ans- fill http://www.dotnetspider.com/questions/ViewQuestion.aspx? QuestionId=7089& http://www.geekinterview.com/question_details/19389 110) What version of the javascript should be used for client side script

26 A) 1.0 B) 1.1 C) 2.0 D) 3 Ans http://www.geekinterview.com/question_details/19475

111) Which of the following represents the best use of the Table, TableRow, and Table-Cell controls? Select Answer: 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 (Your selection was wrong) To display a tabular result set

112) Who can access Session state variables A) All Users of an application B) A Single user C) All users within a single tunnel Ans- a single session http://www.dotnetspider.com/questions/ViewQuestion.aspx? QuestionId=7129& http://www.geekinterview.com/question_details/19419 113) You have an xml file, and the corresponding xsd. Which class should you use to validate the xml against the corresponding schema file? a) Xml validating reader b) Xml dictionary reader c) Xml reader

27 d) Xml schema reader.

114) Which method displays the custom control A) The Prerender B) Render C) Page_Load D) Display Ans b http://www.globalshiksha.com/Which-method-displays-the-customcontrol/forum/146750 http://www.geekinterview.com/question_details/19471

115) Which namespace defines a number of types that represents invocation protocols(HTTP-GET, HTTP-POST and SOAP) a) System.web.services.description b) System.web.services.discovery c) System.web.services.protocols d) System.web.services Ans system.web.services.protocols.

116) What is the IIS server running,handling ASP.NET requests among other things Select Answer: aspnet_isapi.dll aspnet_wp.exe inetinfo.exe

28

117) What dataabase is return in IsPostback property Select Answer: bit boolean int object string 118) Universal description, discovery and integration is a

a) Software services b) Web services c) Network services d) Hardware services Ans b webservices.

119) What are managed providers in .NET

Select Answer: Datalist OleDb,ODBC SQL,CLient,OraClient Data set,Data Adapter Ans sql,client,oraclient

29 http://www.dotnetspider.com/questions/Question7040.aspx

120) Which of these is not an infrastructure that is needed to support web services a) Web service directories b) Web service discovery c) Web service data report d) Web service description Ans c- web service data report.

121) Web Service You create an ASP.NET application for a hotel. The application contains a page that displays current weather conditions for the city in which the hotel is located. The application calls an XML Web service every 10 minutes to update the current weather conditions. A new page is then displayed for subsequent requests. You want the same page to be cached and retrieved from the cache during the time between calls to the XML Web service. You decide to use a Page directive to accomplish this goal. Which Page directive should you use? Select Answer: <%@ Cache Seconds="600 '' VaryByParam="Page" %> <%@ OutputCache Time="600" %> <%@ OutputCache Duration="600" VaryByParam="None" %> <%@ OutputCache Duration="600" %>

30 122) Name a property common in every validation control Select Answer: ValueToCompare ControlToValidate InitialValue ValidationExpression ControlToCompare 123) What base class do all web forms inherit from Select Answer: window class web class form class page class document class

124) What data types do the Range Validator control support Select Answer: Integer,String and date Integer,String and float Integer,ushort and date decimal,String and date Integer,String and bool

125) When you have a complex control,like data grid,writing an event processing outine for each object like cell,button,row then it is quite tedious.The controls can .............................. their event handlers, allowing main Datagrid event handler to take care of its constituents

31

Select Answer: invoked event raised event (Your selection was wrong) bubbled event instantiated

126) Do you need IIS to execute a Web application in ASP.NET 2.0 Select Answer: Yes (Your selection was wrong) Sometimes No

127) You need to display a large amount of data on a web form.Performabe is very important.What would be best method to use in retrieving data? Select Answer: Use a datareader object to retieve data for DataGrid Use a DataSet object to retrieve data for DataGrid (Your selection was wrong) Use a simple select statement as the data sources for the Datagrid Use a cached XML file as data source and retrieve data with a data set

32 128) You need to obtain performance information about your web application You should use following? Select Answer: Performance counters Data readers web performance counters (Your selection was wrong) Data performance counters 129) Security is very important on any website.By default .net website is configured with which of following authentication format? Select Answer: IIS Anonymous Windows Forms Windows 2000 Windows Basic 130) What is the name given to the type of assembly that contains localized resources Select Answer: Spoke Hub (Your selection was wrong) Sputnik Satellite

131) How does ASP.NET store session ids by default Select Answer: in cache

33

in cookies in url strings or in database In global variable

132) A project on which you are working calls for you to store small amount of frequently changing information about a page on the client. For this project, security is not a worry. Which is the best method to use Select Answer: A cookie A query string A url A javascript function A hidden form field (Your selection was wrong) 133) While testing your ASP.NET web application you noticed that while clicking on CheckBox of one of the web page it does not cause a PostBack; you required that the CheckBox should make PostBack so Web page can be update on the server-side code. How can you make the CheckBox to cause a PostBack? Select Answer: Set the AutoPostBack property to true. Add JavaScript code to call the ForcePostBack method. Set the PostBackAll property of the Web page to true. (Your selection was wrong) Add server-side code to listen for the click event from the client. 134) If you want to make a configuration setting change that will affect only the current Web application. Which file will you change? Select Answer: If you want to make a configuration setting change that will affect only the current Web application. Which file will you change?

34

Web.config in the root of the Web application Machine.config (Your selection was wrong) Global.asax 135) While creating your ASP.NET web based application you want to create multiple RadioButton server controls which should be mutually exclusive, what property of RadioButton server controls you must set? Select Answer: Exclusive MutuallyExclusive Grouped GroupName