Академический Документы
Профессиональный Документы
Культура Документы
PREETI BHATT 1
Babu Madhav Institute of Information Technology, UTU 2016
b) Page_Load
c) Control events
d) Page_Unload events
9. What is the best way to store the connection strings?
a) Config files
b) Database text file
c) Session
10. What is the default value for the Method attribute in a ASP.NET server-side Form control
a) GET
b) POST
c) SOAP
d) SMTP
11. In a ASP.NET page, which is the best way to find if the contents of a TextBox has changed after the form
containing the TextBox has been posted back to the server
a) By comparing the old value with the new value
b) By checking the NewValue property of the TextBox control
c) By handling the TextBox control's TextChanged event
d) By checking the HasChanged property of the TextBox
12. Which statement among the one is correct?
a) The Params and Forms collection of the HTTPRequest class are exactly same and theForms
collection has been provided only for backward compatibility
b) The HTTPRequest class does include the Params collection
c) The HTTPRequest class does include the Forms collection
d) The difference between the Params and Forms collection of the HTTPRequest class is that the
Params collection also represents QueryStrings, ServerVariables, andCookies
13. You are writing ASP.NET 2.0 Web site that collects lots of data from users, and the data collection
forms spreads over multiple ASP.NET Web pages. When the user reaches the last page, you need to
gather all of data, validate the data, and save the data to the SQL Server database. You have noticed that
it can be rather difficult to gather the data that is spread over multiple pages and you want to simplify
this application. What is the easiest control to implement that can be used to collect the data on a
single Web page?
a) The View control
b) The TextBox control
c) The Wizard control
d) The DataCollection control
14. An Application variable is created:
a.) when the application is first placed on a web server.
b.) when the web server is first started.
c.) when the first client requests a URL resource.
d.) every time a client requests a URL resource.
e.) every time a new client interacts with the web application.
15. Which data type does range validation control support?
a) Integer string date
b) Integer and string
c) Only string
d) Only integer
16. You have designed a logon form with two TextBox controls named txtUserName and txtpassword. You
want to ensure that the user can enter only lowercase characters in the controls. Which of the
following solutions will fulfill this requirement using the simplest method?
a) Program the KeyPress event of the TextBox controls to convert uppercase letters to lowercase
letters.
b) Create a single event handler that is attached to the KeyPress event of the form. Program this
event handler to convert the uppercase letters to lowercase ones.
c) Set the CharacterCasing property of the Textbox controls to Lower.
PREETI BHATT 2
Babu Madhav Institute of Information Technology, UTU 2016
d) Use the CharacterCasing method of the controls to convert the letters to lowercase letters.
17. The CLR provides ____________ that defines the data type that are used by all .NET languages
a) MSIL
b) CTS
c) BCL
d) Dl
18. The _______________ manages the execution of .Net programs by providing essential functions such as
memory management, code execution, security and other services.
a) CTS
b) CLR
c) BCL
d) IL
19. You are developing an ASP.NET Web application. You create a master page. The master page requires a
region where you can add page-specific content by using the ASP.NET page designer. You need to add a
control to the master page to define the region. Which control should you add?
a) Content
b) ContentPlaceHolder
c) PlaceHolder
d) Substitution
20. You create an ASP.NET page named TestPage.aspx that contains validation controls. You need to verify
that all input values submitted by the user have been validated by testing the Page.IsValid property.
Which page event should you add an event handler to?
a) Init
b) Load
c) PreInit
d) PreLoad
21. After capturing the SelectedIndexChanged event for a ListBox control, you find that the event handler
doesn’t execute. What could the problem be?
a) The AutoEventWireup attribute is set to False
b) The AutoPostBack attribute is set to False
c) The codebehind module is not properly compiled
d) The ListBox must be defined WithEvents
PREETI BHATT 3
Babu Madhav Institute of Information Technology, UTU 2016
PREETI BHATT 4
Babu Madhav Institute of Information Technology, UTU 2016
15. Write a code to design a Registration page of Google.[Refer Google page for the same]
5 True or False
1. In asp.net the second level compilation happen just before the page executed.
2. ASP.NET validation control execute on client side and server side.
3. You cannot validate HTMLInputText control using validation controls.
4. C# is not "Strongly Typed" language.
5. ASP is a script-based programming language.
6. ASP.NET page are compiled not interpreted.
7. server.Transfer() method is slower than Response.Redirect() method.
8. For loop run faster in C# as compare to VB.NET.
9. All the .NET languages are compiled into another lower-level language before the code is executed.
10. ASP.NET can currently run only on Windows Platform.
11. Events in Web forms are processed before the “Page Load” event.
12. DateTime variable can be null.
PREETI BHATT 5
Babu Madhav Institute of Information Technology, UTU 2016
PREETI BHATT 6
Babu Madhav Institute of Information Technology, UTU 2016
PREETI BHATT 7
Babu Madhav Institute of Information Technology, UTU 2016
PREETI BHATT 8
Babu Madhav Institute of Information Technology, UTU 2016
d) Javascript
12. How does asp.net store sessionid by default?
a) cookie
b) cache
c) global variable
d) url strings or in db
2 Fill in the Blanks
1. _______ is used to store the page value.
2. ______ is loss the information when the page is refreshed.
3. ________ Page less state management.
4. ______ will send the data one page to another page using the URL.
5. _______ will store the data as browser history or user computer.
6. ________ State management control only used string data type.
7. _______ will store the information in hidden field. Department of Computer Science and Technology,
8. _______ will store the data as browser’s URL string.
9. Using ________ and ________ state management control user can easily modify the
10. In __________ state management control scope is limited for the current page.
11. In __________ state management control scope is limited for the target page.
12. In __________ state management control scope is for whole ASP.NET application.
13. _______ will store the data in server memory.
14. In custom cookies performance implications will________.
15. In _________ state management control store information lifetime.
16. The use of session.clear() is_______.
17. For expire session ________ method is use.
18. ________method is use for know the number of items in the current session collection.
19. _________ will provide unique session identification.
3 Short Question
1. Define Session.
2. What is the default session timeout period?
3. Where do you generally specify the Session Timeout?
4. Where do you generally specify the Session Timeout?
5. How do you end a user session?
6. What type of data can you store in Application State and Session State variables?
7. Is Application State or Session State variables type safe?
8. Can you turn of Session state?
9. What are Cookies in ASP.NET?
10. What are different types of Cookies?
11. What are Session Cookies?
12. What is the difference between Session Cookies and Persistent Cookies?
13. What are Persistent Cookies used for?
14. How do you create a Persistent Cookie?
15. How do you create a Cookie that never expires?
16. What is View State?
17. How do you enable or disable a View State for a control on the page?
18. How do you enable or disable a View State at the page level?
19. What is the name of the hidden form field in which View State of the page is saved?
20. When View State restoration does happen?
21. Can the HTML controls retain State across post backs?
22. Can someone view the Page HTML source and read View State?
4 Long Question
1. What is state management? List its advantages. Explain client and server side state management
technique.
PREETI BHATT 9
Babu Madhav Institute of Information Technology, UTU 2016
2. What is the Best approach that has to be used, if you need continuous connection to the Database?
E. ADO.NET
F. ADO
G. BOTH
H. None of the above
PREETI BHATT 10
Babu Madhav Institute of Information Technology, UTU 2016
PREETI BHATT 11
Babu Madhav Institute of Information Technology, UTU 2016
C. Display()
D. Equals()
15. The Databases that make up the data in a dataset
A. Should be from Single database source
B. Can be from multiple databases bases which are homogeneous
C. Can include many heterogeneous databases sources
D. None of the above
16. Which of the following is the method provided by the DataSet object to generate XML?
A. ReadXML
B. WriteXML
C. GetXML
D. All of above
17. Which of the following template is available in listview but not ingridview?
A. InsertItemTemplate
B. AlternatingTemplate
C. GroupTemplate
D. ItemTemplate
18. Which of the following column provides selection or editing buttons in gridview?
A. BoundField
B. ButtonField
C. CommandField
D. TemplateField
19. Which of the following format string is used in gridview to show numeric value
in percentage (45%)?
A. {0:C}
B. {0:PR}
C. {0:E}
D. {0:P}
20. Which of the following date format string is used to show date as 10/30/2008?
A. {0:f}
B. {0:D}
C. {0:F}
D. {0:d}
PREETI BHATT 12
Babu Madhav Institute of Information Technology, UTU 2016
4 Long Question
1. Short note on ADO.net architecture.
2. What are differences between ADO and ADO.net?
3. Explain Data Provider in detail.
4. Short note on database providers.
5. Explain command class properties and methods.
6. Diff. Data set and data reader. Explain with example.
7. Explain Data set object in detail.
8. Explain methods of data adapter.
9. Short note on DatView class.
10. Write C# code to use transaction in ADO.NET.
11. Explain datagrid control column types in ASP.NET.
12. What is numeric, date, time format strings?
13. Explain gridview styles in brief.
14. Short note on paging in gridview.
15. Discuss any 5 event of gridview.
16. Explain Listview templates.
17. Explain GridView and ListView controls.
18. Explain various objects in DataSet.
19. How to access connectionString from web.config? Discuss advantages of this approach.
20. How to set column as primary key in DataTable?
21. With code snippet explain how to add primary key constraint in DataTable.
PREETI BHATT 13
Babu Madhav Institute of Information Technology, UTU 2016
Unit 5 Security
1 MCQ Based Question
1. Which of the following is the default authentication mode for IIS?
A. Anonymous
B. Windows
C. Basic Authentication
D. None
2. 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.
3. Which of the following control provides a link for unauthenticated users to log on?
A. Login
B. LoginView
C. LoginStatus
D. LoginName
4. You are creating an ASP.NET application for CareerRide. The company uses Microsoft Windows
authentication. All users are in the CareerRide domain.
You want to configure the application to use the following authorization rules:
PREETI BHATT 14
Babu Madhav Institute of Information Technology, UTU 2016
A. <authorization>
<deny users=” CareerRide \Raj, CareerRide \Shiva”>
<allow users=”*”>
<deny users=”?”>
</authorization>
B. <authorization>
<allow users=”*”>
<deny users=” CareerRide \Raj, CareerRide \Shiva”>
<deny users=”?”>
</authorization>
C. <authorization>
<deny users=” CareerRide \Raj, CareerRide \Shiva”>
<deny users=”?”>
<allow users=”*”>
</authorization>
D. <authorization>
<allow users=” CareerRide \Raj, CareerRide \Shiva”>
<allow users=”*”>
</authorization>
6. How many types of authentication ASP.NET supports?
A. Windows Authentication.
B. .NET Passport Authentication.
C. Forms Authentication.
D. All of the above.
7. You are creating an ASP.NET application for company CareerRide. You use form based authentication
to validate users. You need to prevent unauthenticated users from accessing the application. What
should you do?
A. In the authorization section of the Web.config file, set the users attribute of the deny element
to “?”
B. Set In the authorization section of the Web.config file, set the users attribute of the deny
element to “*”
C. In the authorization section of the Machine.config file, set the users attribute to the allow
element to “?”.
D. None of the above.
8. Where do we include the user lists for Form authentication?
A. < credential>
B. < authorization>
C. < Identity>
D. < authentication>
9. 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
2 Short Question
1. How do you sign out from forms authentication?
2. What is the difference between authentication and authorization?
3. What setting must be added in the configuration file to deny a particular user from accessing the
secured resources?
4. Define Authentication.
5. Define Authorization.
PREETI BHATT 15
Babu Madhav Institute of Information Technology, UTU 2016
PREETI BHATT 16
Babu Madhav Institute of Information Technology, UTU 2016
PREETI BHATT 17
Babu Madhav Institute of Information Technology, UTU 2016
PREETI BHATT 18