19 Dec: Must Read Codes [1-5]

codereads
codereads

19 Dec: Must Read Codes [1-5]

We are sharing few must read codes/concepts which are required now and then. Each of these codereads doesn’t require a full length descriptive article so combining them into groups of five.

CodeReads #1,

Usage of ‘this’ keyword in C#.

  • To qualify members hidden by similar name.
  • To have an object pass itself as a parameter to other methods.
  • To have an object return itself from a method.
  • To declare indexers.
  • To declare extension methods.
  • To pass parameters between constructors.
  • To internally reassign value type (struct) value.

fbsource: https://www.facebook.com/codespread/posts/544740368882522

CodeReads #2,

ISNULL and COALESCE though equivalent, can behave differently. An expression involving ISNULL with non-null parameters is considered to be NOT NULL, while expressions involving COALESCE with non-null parameters is considered to be NULL.

fbsource: https://www.facebook.com/codespread/posts/545045568852002

CodeReads #3,

Regular Cast:

string str= (string) strToCast;

Method Call:

string str= strToCast.ToString();

Safe Cast:

string str= strToCast as string;

fbsource: https://www.facebook.com/codespread/posts/545045568852002

CodeReads #4,

Control State maintains the behavior of the controls whereas View State maintains the content of the controls. Also, Control State is available even though View State for the control is disabled.

fbsource: https://www.facebook.com/codespread/posts/547846855238540

CodeReads #5,

In javascript, Body.Onload() event occurs only after the DOM has been loaded, plus all associated resources like images, flash etc are also completely loaded.
$(document).ready() occurs when the DOM has been loaded but associated resources like images, flash etc may be pending.
There can be multiple document.ready() in a page but Body.Onload() event will be only one.

fbsource: https://www.facebook.com/codespread/posts/548277158528843

Author: hershey

A passion for knowledge drives me to do programming, A passion for programming drives me to create something different, A passion for creation drives me to spread the knowledge.

Share This Post On

0 Comments

  1. nice superb explaination

    Post a Reply
  2. thanks for the tutorial
    I am having a problem.
    The feature “Create SQL server database” isn’t available , I can’t select it.
    Can you help, please ?

    Post a Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

More from CodeSpread:

  • 20 Dec: Must Read Codes [6-10]20 Dec: Must Read Codes [6-10]We are sharing few must read codes/concepts which are required now and then. Each of these codereads doesn’t require a full length descriptive article so combining them into groups of five. CodeRe...
  • C#: Anonymous Type is not anonymous!C#: Anonymous Type is not anonymous!Why Anonymous Type? Anonymous types provide you the ease of having set of properties (Read only) into a single object without knowing the type. It’s the job of compiler to generate the type inform...
  • 23 Dec: Must Read Codes [11-15]23 Dec: Must Read Codes [11-15]We are sharing few must read codes/concepts which are required now and then. Each of these codereads doesn’t require a full length descriptive article so combining them into groups of five. CodeRe...
  • Styles of Source Code Comments in C#, SQL, XML, HTML, CSS, JavaScriptStyles of Source Code Comments in C#, SQL, XML, HTML, CSS, JavaScriptDevelopers take months to write beautiful pieces of code and reviewer gets only few hours or I say, minutes to provide suggestions and improvisations. Then it becomes a hard deal for a developer to...
  • Useful ‘ref’ and ‘out’ parametersUseful ‘ref’ and ‘out’ parameters It took me some time to realize the real potential of ref and out keywords, till the time I experience a condition which could only be simplified by implementing ref and out keyword. Lets st...
  • Note: GZipStreamNote: GZipStreamA short note from my experience: From the name itself you can at least make a guess about the functionality of the GZipStream class(present under: System.IO.Compression). Yes..your guess is abso...
  • Asp.Net: Hidden Truth of CookiesAsp.Net: Hidden Truth of CookiesI know there are several articles on cookies as what are they? and how can they be created? but i always wanted to know more about them. My questions were where they are stored? how to track their ...
  • Caching is an evilCaching is an evilI know 'Caching' was created to ease out the network resources but i have seen the situations where it emerged as the biggest evil. I can remember many situations when the website is updated but...