Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

ASP.NET Fundamentals, Lab Reports of C Sharp Programming

A wide range of topics related to asp.net, a popular web application framework developed by microsoft. It includes questions and answers on various aspects of asp.net, such as caching, session management, validation controls, ajax, and event handling. A comprehensive overview of the key concepts and features of asp.net, making it a valuable resource for students and developers who are looking to deepen their understanding of this technology. The questions cover a range of difficulty levels, from basic to more advanced, and the answers provide detailed explanations to help readers gain a thorough grasp of the subject matter.

Typology: Lab Reports

2022/2023

Uploaded on 01/03/2024

dev-joshi-2
dev-joshi-2 🇮🇳

1 document

1 / 31

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
BCA Sem-VI
BCA - 602 Advance .NET Frame Work Using C#
JULY: 2020
QUESTION BANK
1. Web.config file is used…?
A. Configures the time that the server-side codebehind module is called
B. To store the global information and variable definitions for the application
C. To configure the web server
D. To configure the web browser
ANS : B
2. Which of the following object is not an ASP component?
A. LinkCounter
B. Counter
C. AdRotator
D. File Access
ANS: A
3. Difference between Response.Write() and Response.Output.Write().
A. Response.Output.Write() allows you to buffer output
B. Response.Output.Write() allows you to write formatted output
C. Response.Output.Write() allows you to flush output
D. Response.Output.Write() allows you to stream output
ANS : B
4. Which of the following method must be overridden in a custom control?
A. The Paint() method
B. The Control_Build() method
C. The default constructor
D. The Render() method
ANS: D
5. How do we create a FileSystemObject?
A. Server.CreateObject(“Scripting.FileSystemObject”)
B. Create(“FileSystemObject”)
C. Create Object:”Scripting.FileSystemObject”
D. Server.CreateObject(“FileSystemObject”)
ANS: A
6. 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: B
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f

Partial preview of the text

Download ASP.NET Fundamentals and more Lab Reports C Sharp Programming in PDF only on Docsity!

BCA Sem-VI

BCA - 602 Advance .NET Frame Work Using C#

JULY: 2020

QUESTION BANK

  1. Web.config file is used…? A. Configures the time that the server-side codebehind module is called B. To store the global information and variable definitions for the application C. To configure the web server D. To configure the web browser ANS : B
  2. Which of the following object is not an ASP component? A. LinkCounter B. Counter C. AdRotator D. File Access ANS: A
  3. Difference between Response.Write() and Response.Output.Write(). A. Response.Output.Write() allows you to buffer output B. Response.Output.Write() allows you to write formatted output C. Response.Output.Write() allows you to flush output D. Response.Output.Write() allows you to stream output ANS : B
  4. Which of the following method must be overridden in a custom control? A. The Paint() method B. The Control_Build() method C. The default constructor D. The Render() method ANS: D
  5. How do we create a FileSystemObject? A. Server.CreateObject(“Scripting.FileSystemObject”) B. Create(“FileSystemObject”) C. Create Object:”Scripting.FileSystemObject” D. Server.CreateObject(“FileSystemObject”) ANS: A
  6. 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: B
  1. Attribute must be set on a validator control for the validation to work. A. ControlToValidate B. ControlToBind C. ValidateControl D. Validate ANS: A
  2. Caching type supported by ASP.Net A. Output Caching B. DataCaching C. a and b D. none of the above ANS:C
  3. 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 ANS:C
  4. File extension used for ASP.NET files. A. .Web B. .ASP C. .ASPX D. None of the above ANS : B
  5. Why is Global.asax is used? A. Declare Global variables B. Implement application and session level events C. No use D. none of the above ANS : B
  6. Default Session data is stored in ASP.Net. A. StateServer B. Session Object C. InProcess D. all of the above ANS:C
  7. Default scripting language in ASP. A. EcmaScript B. VBScript C. PERL D. JavaScript ANS : B

D. All of the above ANS: D

  1. What is/are the advantages of master page? A. It helps to display common content in multiple pages. B. They allow you to centralize the common functionality of your pages so that you can make updates in just one place. C. It helps to create a common page layout. D. All of the above. ANS: D
  2. Which is the mandatory property for all validation controls? A. ControlToValidate B. Message C. EnableClientScript D. EnableServerScript ANS: A
  3. Which object works on client side in state management system? A. ViewState B. cookies C. Query strings D. All of the above ANS: D
  4. How many types of caching ASP.NET supports? A. Page Output Caching B. Partial Page Caching C. Data Caching D. All of the above ANS: D
  5. How many 'ScriptManager' control can be added on a ASP.NET web page? A. Only One B. More than One C. Only Two D. None of the above ANS: A
  6. What are the client-side state management options that ASP.NET supports? A. Application B. Session C. Querystring D. Option a and b are correct ANS:C
  1. By default, when you use Page Output Caching, at what location page is cached? A. Only on web server B. Only on Client C. Web server, any proxy servers, and browser D. All of the above. ANS:C
  2. What are the Command Object Methods? A. ExecuteNonQuery B. ExecuteReader C. ExecuteScalar D. All of the above ANS: D
  3. Which object data is included in bookmarks and e-mailed URLs? A. ViewState B. cookies C. Query strings D. All of the above ANS:C
  4. Application_Start event is available in ________. A. Web.config B. Local.asax C. Global.asax D. None of These ANS:C
  5. __________ is not an ASP component. A. Counter B. AdRotator C. File Access D. LinkCounter ANS: D
  6. WSDL stands for ___________? A. Web Server Description Language B. Web Server Descriptor Language C. Web Services Description Language D. Web Services Descriptor Language ANS:C
  7. Which of the following validation control is used to ensure that an user does not skip a form entity field?
  1. Where do we include the user lists for windows authentication? A. < Credential> B. < authorization> C. < identity> D. < authentiation> ANS : B
  2. Which of the following is not a member of ADODBCommand object? A. ExecuteScalar B. ExecuteStream C. Open D. ExecuteReader ANS:C
  3. Which DLL translates XML to SQL in IIS? A. SQLISAPI.dll B. SQLXML.dll C. LISXML.dll D. SQLIIS.dll ANS: A
  4. ______________ element in the web.config file is used to run code using the permissions of a specific user A. < credential> element B. < authentication> element C. < authorization> element D. < identity> element ANS: D
  5. 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 : B
  6. The RangeValidator control supports the following data types A. Integer only B. Date, Integer and String C. Only String D. Date and Integer ANS : B
  7. Two methods with the same name but with different parameters. A. Overloading B. Loading

C. Multiplexing D. Duplexing ANS: A

  1. An Event has ________ as default return type A. No return type for events B. Double C. Integer D. String ANS: A
  2. How many web.config files that can be there an ASP.NET application? A. only one B. only two C. upto 10 D. one or more ANS: D
  3. _____________ allow to encapsulate discrete units of functionality and provide a graphical representation of that functionality to the user A. controls B. object C. class D. graphics ANS: A
  4. Difference between Convert.ToString() and ToString() A. Convert.ToString() handles null values but ToString() doesn't B. ToString() output as per format supplied C. Convert.ToString() only handles null values D. ToString() handles null values but Convert.ToString() doesn't ANS: A
  5. A variable which is declared inside a method is called a ________ variable A. Serial B. Local C. Private D. Static ANS : B
  6. If you want to add an array in ArrayList then which method of ArrayList will be used? A. AddRange B. Add C. AddArray D. None of the above ANS: A

B. To compare the value entered into a form field against a fixed value. C. To compare the value of one form field against another. D. All of the above. ANS: D

  1. Which validation control in ASP.NET can be used to determine if the data is entered into a TextBox control is of type Currency? A. ValidationSummary B. CompareValidator C. RequiredFieldValidator D. None of the above. ANS : B
  2. There is a button on page name cancel and it should bypass validation when cancel button is clicked. What will you do? A. set CausesValidation = false B. set RemoveValidation=true C. set cancel=true D. None of the above ANS: A
  3. Client-side validation is turned on by default. If you want that particular validation control should not validate at client side, what will you do? A. Set the EnableClientScript property to false B. Set the validate property to false C. Set the EnableClientScript property to true D. Set the Page.Isvalid property to false ANS: A
  4. _____________ is a property common in every validation control. A. ValidationExpression B. InitialValue C. ControlToCompare D. ControlToValidate ANS: D
  5. Which interface you will use wrap an AJAX client control into a custom server control? A. IScriptManager B. IScriptControl C. IScriptAJAX D. None of the above

ANS: A

  1. Which method is used to dynamically register client script from code? A. Page.ClientScript.RegisterClientScriptBlock B. RegisterScript C. Page.ClientScript D. None of the above ANS: A
  2. Which control is required for every page that have AJAX Extensions for ASP.NET? A. UpdatePanel B. ScriptManager C. ContentPanel D. None of the above ANS : B
  3. A Master Page contains a ScriptManager control and a user wants the AJAX functionality on content page then which control is necessary on content page? A. AsyncPostBackTrigger B. ScriptManager C. ScriptManagerProxy D. None of the above ANS:C
  4. Which control can be used to update only the portion of the page? A. UpdatePanel B. ScriptManager C. AsyncPostBackTrigger D. None of the above ANS: A
  5. What property and method of the Page object do you use to register client script dynamically from code? A. ScriptManager control is used to dynamically register client script from code. B. The Page.ClientScript.RegisterClientScriptBlock is used to dynamically register client script from code. C. ScriptManagerProxy control is used to dynamically register client script from code. D. None of the above ANS:C

76 If any user has disabled cookies in their browsers, what can you do to enable them to use forms authentication? A. Set BoweserCookieEnabled=true; B.Set cookieless=true; C.Use the AutoDetect setting of the cookieless attribute. D.None of the above. Answer:C 77 What property and method of the Page object do you use to register client script dynamically from code? A. ScriptManager control is used to dynamically register client script from code. B.The Page.ClientScript.RegisterClientScriptBlock is used to dynamically register client script from code. C.ScriptManagerProxy control is used to dynamically register client script from code. D.None of the above. Answer:C 78 How to implement authentication via web.config? A. Include the authentication element. B. Include the authorization element. C. Include the identity element. D. Include the deny element. Answer: B 79 What ASP.NET object encapsulates the state of the client and the browser? A. Application Object B. Session Object B.Response Object D.Request Object Answer: B 80 What data type is returned when calling the ExecuteScalar method of a command object? A. System.Int B Object C No of effected records. D. None of the above. Answer: B 81 There is a button on page name cancel and it should bypass validation when cancel button is clicked. What will you do? A. set CausesValidation = false. B. set RemoveValidation=true C. set cancel=true D. None of the above.

Answer: A 82 HTTP messages are typically sent between the Web server and Web browser using which Port number? A. 70 B. C. D. Answer:B 83 CompareValidator control can be used for performing which task? A. To perform a data type check. B. To compare the value entered into a form field against a fixed value. C. To compare the value of one form field against another. D. All of the above. Answer :D 84 You want to make a configuration setting change that will affect only the current Web application. Which file will you change? A. Global.asax B. Web.config in the root of the Web application C.Machine.config D.All of the above Answer:B 85 Which programming model should you implement if you want to separate your server-side code from your client-side layout code in a Web page? A. Single-file model B. Code-behind model C. Inline model D. Client-server model Answer:B 86 Which protocol is used for requesting a web page in ASP.NET from the Web Server? A.HTTP B.TCP C.SMTP D.None of the above. Answer: A 87 ______________is the first method that is fired during the page load. A. PreRender() B. Load() C. Unload() D. Init() Answer : D

94 How will you add a TextBox control at runtime on the form? Choose the correct one. A. TextBox obj = new TextBox(); obj.ID = ""txtUserName""; form1.Controls.Add(obj); B. form1.Controls.Add(TextBox); C. this.FindControl.add(TextBox); D. None of the above. Answer: A 95 What are the Command Object Methods? A. ExecuteNonQuery B. ExecuteReader C. ExecuteScalar D. All of the above Answer D: 96 What are the minimum attribute is required to create a connection string using SqlConnection object? A. - Data Source

  • Initial Catalog
  • Integrated security=true B. - Server
  • Database
  • Integrated security=true C. Option A and B both are correct D. None of the above Answer:C 97 Client-side validation is turned on by default. If you want that particular validation control should not validate at client side, what will you do? A. Set the EnableClientScript property to false B. Set the validate property to false C. Set the EnableClientScript property to true D. Set the Page.Isvalid property to false Answer:A 98 Choose the correct option about the Integrated Security property of connection object. A. If Integrated Security=false then User ID, and Password must be specified in the connection string. B. If Integrated Security=true then current Windows account credentials are used for authentication. C. Both A and B option are correct. D. None of the above. Answer:C 99 Which is the mandatory property for all validation controls? A. ControlToValidate B. Message C. EnableClientScript D. EnableServerScript Answer:A

100 To kill a users session explicitly which of the following will you use? A. Session.Close() B. Session.End() C. Session.Abondon() D. Session.Discard() Answer:C 101 ASP.NET Validation Control works at ________. A. Client side only. B. Server side only. C. Both Client Side and Server Side D. None of the above. Answer: C 102 If you want to validate the email addresses, Social Security numbers, phone numbers, and dates types of data, which validation control will be used? A. RegularExpressionValidator B. CompareValidator C. RequiredFieldValidator D. None of the above Answer: A 103 The TreeView control can be specified directly in the control or bound to _____. A. .gif file B. .doc file C. WeB.sitemap file D. .prg file Answer: C 104 In ASP.NET application DLL files are stored in which folder? A. App_Code B. App_Data C. Bin D. App_LocalResources Answer: C 105 What type of data can Cookies store? A. String B. DateTime C. System.Int D. None of the above. Answer: A 106 What are the client-side state management options that ASP.NET supports? A. Application B. Session C. Querystring D. Option a and b are correct Answer: C

114 Which of the keywords are used for the block to be examined for exceptions? A. try B. catch C. throw D. check Answer: A 115 You use the ASP.NET Web Site Administration Tool to configure ASP.NET membership with forms authentication. What should you name your login form so that you do not have to modify the WeB.config file? A. Login.aspx B. LoginPage.aspx C. Default.aspx D. Auth.aspx Answer: A 116 Which following control is used to display a single record from a data source in a table in ASP.NET A. GridView B. Datalist C. DetailsView D. DataRelation Answer: C 117 What are the Command Object Methods? A. ExecuteNonQuery B. ExecuteReader C. ExecuteScalar D. All of the above. Answer: D 118 Which of these keywords are used for the block to handle the exceptions generated by try block? A.try B. catch C. throw D. check Answer:B 119 What is the use of try & catch? A. It is used to manually handle the exception B. It helps to fix the errors C. It prevents automatic terminating of the program in cases when an exception occurs D. All of the mentioned Answer: D (^120) CompareValidator control can be used for performing which task? A. To perform a data type check. B. To compare the value entered into a form field against a fixed value. C. To compare the value of one form field against another. D. All of the above.

Answer: D 121 Which is the mandatory property for all validation controls? A. ControlToValidate B. Message C. EnableClientScript D. EnableServerScript Answer: A 122 Range Validator control in ASP.NET supports which type? A. Integer B. String C. Currency D. All of the above Answer: D 123 Which object works on client side in state management system? A. ViewState B. cookies C. Query strings D. All of the above Answer: D 124 Which of the following keyword can be used to rethrow an exception in C#: A. return B. throw C. re-throw D. create Answer:B 125 To add a custom control to a Web form we have to register with. A. TagPrefix B. Name space of the dll that is referenced C. Assemblyname D. All of the above Answer:B 126 Caching type supported by ASP.Net A. Output Caching B. DataCaching C. a and b D. none of the above Answer: C