Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

BSc (Hons.

) Software Engineering

BSCc (Hons.) Computer Science with


Network Security
Cohort BCNS/18A/FT

Examinations for 2019 / Semester 1

Resit Examinations for BCNS/16B/FT,


BSE/13B/FT, BSE/16B/FT & BSE/17A/FT

MODULE: INTERNET PROGRAMMING II


MODULE CODE: WAT2117C

Duration: 2 Hours 15 Minutes

Instructions to Candidates:

1. Answer ALL questions


2. Questions may be answered in any order but you must indicate
clearly the question number.
3. Start your answer to each question on a fresh page.
4. All questions carry equal marks [25].
5. Total Marks = 100.

This question paper contains 4 questions and 6 pages.

Page 1 of 6
INTERNET PROGRAMMING II (WAT2117C) SITE/June 2019 Sem 1
ANSWER ALL QUESTIONS

QUESTION 1: (25 MARKS)

a) List and briefly describe the two stages of code execution process for any .NET
application. You may use appropriate diagram to support your answer.
(5 marks)

b) Describe the Web related term “Namespaces” as used in .NET framework.


Provide at least one example.
(2 Marks)

c) Explain the differences between ViewState and Session state.


(4 Marks)

d) List and explain any three session storage mechanisms.


(6 marks)

e) Differentiate between a HyperLink control and a LinkButton control.


(2 Marks)

f) ASP.NET supports several ways to navigate between pages in your


application. List and briefly discuss any three of those navigation technique.
(6 marks)

Page 2 of 6
INTERNET PROGRAMMING II (WAT2117C) SITE/June 2019 Sem 1
QUESTION 2: (25 MARKS)

a) Query string is one of the simplest way to pass some information from one
page to another. Consider the below web form

Using the provided information.


Destination page: “ProductInfo.aspx”
Textbox Id: “txtProductName”
Search Button Id: “btnSearch”

I. Write the appropriate code such that once the Search button is clicked,
the destination page should open. Note, you should pass the value of
the textbox as part of your query string.
(5 Marks)
II. Provide any two disadvantages and one advantage of using query
string.
(3 Marks)
b) Concurrency control include steps to prevent data corruption. What are the
different approaches to manage concurrency? Briefly explain each of them.
(6 Marks)
c) What does the orientation property do in a menu control?
(1 Marks)
d) A user control is basically a grouping of other existing control, intended as a
reusable component. What are the three important attributes we have to specify
in order to register the user control in a webform?
(3 Marks)
e) Explain the differences between a session cookie and a persistent Cookie.
Write code to support your answer.
(4 Marks)
f) What is theme in ASP.NET? Differentiate between a page theme and a global
theme? (3 Marks)

Page 3 of 6
INTERNET PROGRAMMING II (WAT2117C) SITE/June 2019 Sem 1
QUESTION 3: (25 MARKS)

a) Differentiate between client-side and server-side validations in web pages.


. (2 Marks)
b) “CauseValidation” and “VallidationGroup” properties are usually used while
validating a form. Explain why they are used and provide suitable example to
support your answer.
(5 marks)
c) Using the appropriate ASP.NET validation control, write extract code to validate
the following fields.
Field Name Control ID
Age txtAge
Email Address txtEmail
Password txtPassword
Confirm Password txtConfirmPassword

I. Email Address is a Mandatory field. (2 Marks)


II. Age, which is a numeric field that must be between 18 and 60. (3 Marks)
III. Confirm Password should match with the Password Field. (2 Marks)
IV. The Password field should have Minimum length 7 and Maximum length
10. Characters allowed (a - z A - Z 0-9) (3 Marks)

d) Explain the purpose of AdRotator Control? List any four properties associated
with the AdRotator Control.
(5 marks)
e) Outline three types of templates supported by the Repeater control.
(3 Marks)

Page 4 of 6
INTERNET PROGRAMMING II (WAT2117C) SITE/June 2019 Sem 1
QUESTION 4: (25 MARKS)

(a) State any three advantages using a DataReader.


(3 marks)

(b) Briefly describe the difference between the “ExecuteNonQuery”,


ExecuteReader” and “ExecuteScalar” methods in ADO.NET.
(3 marks)

(c) What is a ConnectionString? Explain the various part of the ConnectionString.


(4 marks)

(d) Provide two reasons, why ConnectionString is usually stored in the web.config
file.
(2 Marks)

(e) What is SQL Injection attack? Explain how we can prevent this kind of attack.
(3 Marks)

(f) In an Ecommerce website, a page is required, such that any user will be able to
reset his/her password. Which basically means that we will have to update a
particular user’s password.
For example, below is a screenshot of an existing user John (Currently logged
in), who want to change his password. Once he click on the “Save new
password” button, the application should update his new password in the
database.

Note, in the above webform, the user_id for john is already set in a variable
called “UserId”. The below code were used:
Int UserId = Convert.ToInt32(session(“user_id”))

Page 5 of 6
INTERNET PROGRAMMING II (WAT2117C) SITE/June 2019 Sem 1
By using the below information
ConnectionString (already present in web.config): ConnStr
Password textbox: txtPassword
User_id is stored in the UserId variable
Table_name: userTbl

Write an asp.net program that allows the user to change his/her password specified
in the “txtPassword” by using the “UserId” variable (stores the user_id whose
password need to be changed).
(10 Marks)

Below are some records example that are currently present in the database
(tableName: “usertbl”):
User_id fName UserName Password
1 John john123 Wint3r@
2 Smith Smith124 Summ3r$

***END OF QUESTION PAPER***

Page 6 of 6
INTERNET PROGRAMMING II (WAT2117C) SITE/June 2019 Sem 1

You might also like