Header Ads Widget

Assignment-2 ASP.NET

 

_ASP.NET

3351603
 Assignment-2


1: What is use of Web.config file in ASP.NET?

Answer:-

-Web.config is a file which allows you to define the configuration settings at the time of developing the application or at the time of deployment or even after deployment.

Brief Points about Web.config is given below: 

-Web.config files are stored in XML format which makes us easier to work with.

-You can have any number of Web.config file an application. Each Web.config applies settings to its own directory, and all the child directories below it.

All the Web.config files inherits the root Web.config file available at the following location:

Systemroot/Microsoft.Net/Framework/VersionNumber/CONFIG/Web.config .

The changes in Web.config don't require the reboot of the web server.

It is a XML based configuration file used to manage various settings that concerned with configuration of website.

If Web.config is placed in the root directory it will affect your entire site.


2: Write Code for online and visitor count of a website using Global.asax.


Answer:-

Global.asax.vb



Home.asax.vb



3: Explain difference between Cookies and Session with code.

Answer:-

Cookies:-

Cookies is a small file created in user's browser, while Session is a state management technique which stores the value on the server.

The basic and main difference between cookies and session is that cookies are stored in user's browser but session can't. 

A cookies can keep all the information in the client's browser until deleted.

if a user has a login and password, it can be set as cookie in their browsers so next time they do not have to re-login. you can store anything in a browser cookie.

Example code for Cookie.



Sessions are not reliant on the User allowing a cookie. They work like a token in the browser which allowing access and passing information  while the user has opened his browser.

Problem with session is that when you close the browser the session will end automatically.

Example Code for Session.



 

4: Explain Hiddenfield and viewstate with code in brief.

Answer:-

-Hiddenfield is a control provided by ASP.net which is used to store small amount of data on the client.

it is not rendered to the client and it is invisible on the browser.

it is a Client-side State Management Technique.

Code:-


Viewstate:-

Sometimes the user need to store data temporarily after a post back the viewstate  is preferred.

It stores data in generated HTML using Hiddenfield not on the server.

IT provides page level state management.

Example:-






5: Explain how Google uses QueryString in his search in short. 

Answer:-

-The format of QueryString is name=value.

The most Common Google Search URL string looks like:-

http://www.google.com/search?q="%s" , where "%s" is served as a placeholder for query yo come.

Most searched Parameters can be affixed to this string simply by adding '&' after the basic string, followed by desired parameter. 




 

Post a Comment

0 Comments