Wednesday, August 27, 2014

Response.Cookies VS Request.Cookies

Response.Cookies is write only while Request.Cookies is read only.

Response.Cookies is used to setting cookies.

Here Response means the result the server send data to client, Request means the client send data to server to get response.

Tricky part for Big Size image

Always include width and height to accelerate the page processing which contains big size image.

If you don't include width/height, the client's browser will wait to transform the image so that the page's layout can be computed based on the width/height of the image.

If you include width/height, the layout can be computed more quickly.

HTML DIV VS SPAN

<div> tags are block elements, which means there is a line break added automatically. Thus <div> tag can act as separator between areas of the document. <p> tags are also block elements, thus a line break added always.

<span> tag is similar to <div>, but there is no line break added.

Most mordern HTML editors, such as FrontPage, Dream Weaver use <div> and <span> extensively to isolate document elements in block tags over which you have z-axis control.

Placing images on a page

Html image has attribute align, which can be set as "left" "right"
<img src="image/picture.gif">This is my picture.
Above code will display image at first, then at the bottom of the image, the text will be displayed.

<img src="image/picture.gif" align ="left">This is my picture.
Above code will display image at first, then the text will be displayed next to the image.

<img src="image/picture.gif" align ="right">This is my picture.
The text will be displayed at first, then the image will be displayed.


Session VS Cookies


Same: 
  1. To store state between pages
  2. All are name value pairs

Difference:

  1. Session are happened at Server Side, usually accessed through Server.Session
  2. Cookies are client side, usually accessed through Response.Cookies
  3. Cookies has size limitation of 4K Bytes
  4. Cookies has time limitation