Hands – On with ASP.NET MVC – eBook Contest

Hi Friends,

Here, i have mentioned a set of 10 questions. All the best. Winners and Answers will be declared after the contest over. Then, winners will be contacted separately via mail.










Thanks,
Rahul
Happy Coding

1,565 total views, 1 views today

ASP.Net State Management Trivia Answers

Hi Friends,

Please refer the below answers for the Trivia questions

1. Correct Answer: B
A. Incorrect: Client-side state management requires the client to transmit the user name and
password with each request. It also requires the client to store the information locally,
where it might be compromised. This is not a secure solution.
B. Correct: Server-side state management provides better security for confidential information
by reducing the number of times the information is transmitted across the network.

2. Correct Answer: A
A. Correct: Client-side state management is an excellent choice for storing nonconfidential
information. It is much easier to implement than server-side state management when
multiple web servers are involved, and it minimizes load on the servers.
B. Incorrect: You could use server-side state management; however, it would require a
server-side database to synchronize information among multiple web servers. This
would increase the load on your servers.

3. Correct Answer: A
A. Correct: View state is the simplest way to store this information. Because it is enabled by
default, you might not need to write any code to support state management for your form.
B. Incorrect: You can use control state; however, it requires extra coding and is only necessary
if you are creating a control that might be used in a webpage that has view state disabled.
C. Incorrect: You can store the information in hidden fields; however, that requires writing
extra code. View state supports your requirements with little or no additional code.
D. Incorrect: Cookies require extra coding and are only required if you need to share
information between multiple web forms.
E. Incorrect: You can use query strings to store user preferences. However, you need to
update every link on the page that the user might click. This is very time consuming
to implement.

4. Correct Answer: D
A. Incorrect: View state can only store information for a single web form.
B. Incorrect: Control state can only store information for a single control.
C. Incorrect: Hidden fields can only store information for a single web form.
D. Correct: Unless you specifically narrow the scope, the user’s browser submits information
stored in a cookie to every page on your site. Therefore, each page processes the user
preference information. If you configure the cookie expiration to make it persistent, the
browser submits the cookie the next time the user visits your site.
E. Incorrect: You can use query strings to store user preferences. However, you need to
update every link on the page that the user might click. This is very time consuming
to implement.

5. Correct Answer: E
A. Incorrect: View state information is not stored in the URL, and therefore is lost if the URL
is bookmarked.
B. Incorrect: Control state information is not stored in the URL, and therefore is lost if
the URL is bookmarked.
C. Incorrect: Hidden fields are not stored in the URL, and therefore are lost if the URL is
bookmarked.
D. Incorrect: Cookies are not stored in the URL, and therefore are lost if the URL is bookmarked.
E. Correct: Query strings are stored in the URL. Although they are not the easiest type of
client-side state management to implement, they are the only technique that allows state
management data to be easily bookmarked and sent via email.

Thanks,
Rahul
Happy Coding

1,187 total views, 1 views today

ASP.Net State Management Trivia

Hi Friends,

Quiz time. Let’s get started with some basic questions from state management. Answer these with explanation. Correct answers will be posted in the next series of the same with some other questions.

1. You need to store a person’s user name and password as user navigates to different
pages on your site, so that you can pass these credentials to the server. Which type of
state management should you use?

A. Client-side state management

B. Server-side state management
2. You need to track general user preferences when a user visits your site, to
minimize additional load on your servers. You distribute requests among multiple web
servers, each running a copy of your application. Which type of state management
should you use?

A. Client-side state management
B. Server-side state management

3. You are creating an ASP.NET webpage that allows a user to browse information in a
database. Every time user accesses the page, you need to track the search and sorting values. What you don’t need to store the information between visits to the webpage. Which type of client-side state management would meet your requirements and be the simplest
to implement?

A. View state
B. Control state
C. Hidden fields
D. Cookies
E. Query strings

4. You are creating an ASP.NET website with dozens of pages. You want to allow the
user to set user preferences and have each page process the preference information.
You want the preferences to be remembered between visits, even if the user closes
the browser. Which type of client-side state management meets your requirements
and is the simplest to implement?

A. View state
B. Control state
C. Hidden fields
D. Cookies
E. Query strings

5. You are creating an ASP.NET web form that searches product inventory and displays items
that match the user’s criteria. You want users to be able to bookmark or send search
results in email. Which type of client-side state management meets your requirements
and is the simplest to implement?

A. View state
B. Control state
C. Hidden fields
D. Cookies
E. Query strings

Till then, stay tuned and happy coding.

Thanks,
Rahul
Happy Coding

1,143 total views, 1 views today