customise search

<!-- Google Custom Search Element -->
<div id="cse" style="width:100%;">Loading</div><script src="http://www.google.com/jsapi" type="text/javascript"></script><script type="text/javascript">google.load('search', '1', {style: google.loader.themes.MINIMALIST});google.setOnLoadCallback(function(){var cse = new google.search.CustomSearchControl();cse.draw('cse');}, true);</script>
<!-- Google Custom Search Element -->
<div id="cse" style="width:100%;">Loading</div><script src="http://www.google.com/jsapi" type="text/javascript"></script><script type="text/javascript">google.load('search', '1', {style: google.loader.themes.MINIMALIST});google.setOnLoadCallback(function(){var cse = new google.search.CustomSearchControl();cse.draw('cse');}, true);</script>

customise search

<!-- Google Custom Search Element -->
<div id="cse" style="width:100%;">Loading</div><script src="http://www.google.com/jsapi" type="text/javascript"></script><script type="text/javascript">google.load('search', '1', {style: google.loader.themes.MINIMALIST});google.setOnLoadCallback(function(){var cse = new google.search.CustomSearchControl();cse.draw('cse');}, true);</script>
<!-- Google Custom Search Element -->
<div id="cse" style="width:100%;">Loading</div><script src="http://www.google.com/jsapi" type="text/javascript"></script><script type="text/javascript">google.load('search', '1', {style: google.loader.themes.MINIMALIST});google.setOnLoadCallback(function(){var cse = new google.search.CustomSearchControl();cse.draw('cse');}, true);</script>

Is "Javascript" a case sensitive language ?

Is "Javascript" a case sensitive language ?

Select from following answers:
  1. No
  2. Yes
  3. Maybe

Yes, "Javascript" is a case sensitive language.
For example,

var myname = "sekhar";

var Myname = "sekhar";

The above variables are treated as differently ! 
Is "Javascript" a case sensitive language ?

Select from following answers:
  1. No
  2. Yes
  3. Maybe

Yes, "Javascript" is a case sensitive language.
For example,

var myname = "sekhar";

var Myname = "sekhar";

The above variables are treated as differently ! 

Is "Javascript" a case sensitive language ?

Is "Javascript" a case sensitive language ?

Select from following answers:
  1. No
  2. Yes
  3. Maybe

Yes, "Javascript" is a case sensitive language.
For example,

var myname = "sekhar";

var Myname = "sekhar";

The above variables are treated as differently ! 
Is "Javascript" a case sensitive language ?

Select from following answers:
  1. No
  2. Yes
  3. Maybe

Yes, "Javascript" is a case sensitive language.
For example,

var myname = "sekhar";

var Myname = "sekhar";

The above variables are treated as differently ! 

What is the difference between the below two statements:- (1) var myname = "Akiii"; (2) myname = "Akiii";


What is the difference between the below two statements:-
(1) var myname = "Akiii";
(2) myname = "Akiii";


Answer:

Both the above two statements are same. In javascript, even if you don't declare a "var" keyword, it is automatically added.

Note:-
It is always good to use "var" to declare any variable in javascript. It makes the code cleaner and readable. 

What is the difference between the below two statements:-
(1) var myname = "Akiii";
(2) myname = "Akiii";


Answer:

Both the above two statements are same. In javascript, even if you don't declare a "var" keyword, it is automatically added.

Note:-
It is always good to use "var" to declare any variable in javascript. It makes the code cleaner and readable. 

What is the difference between the below two statements:- (1) var myname = "Akiii"; (2) myname = "Akiii";


What is the difference between the below two statements:-
(1) var myname = "Akiii";
(2) myname = "Akiii";


Answer:

Both the above two statements are same. In javascript, even if you don't declare a "var" keyword, it is automatically added.

Note:-
It is always good to use "var" to declare any variable in javascript. It makes the code cleaner and readable. 

What is the difference between the below two statements:-
(1) var myname = "Akiii";
(2) myname = "Akiii";


Answer:

Both the above two statements are same. In javascript, even if you don't declare a "var" keyword, it is automatically added.

Note:-
It is always good to use "var" to declare any variable in javascript. It makes the code cleaner and readable. 

Overloading is Static Polymorphism and Overriding is Dynamic Polymorphism ? True or False ?


Overloading is Static Polymorphism and Overriding is Dynamic Polymorphism ?
True or False ?


Select from following answers:
  1. True
  2. False
  3. Maybe
Ans: True

Overloading is Static Polymorphism and Overriding is Dynamic Polymorphism ?
True or False ?


Select from following answers:
  1. True
  2. False
  3. Maybe
Ans: True

Overloading is Static Polymorphism and Overriding is Dynamic Polymorphism ? True or False ?


Overloading is Static Polymorphism and Overriding is Dynamic Polymorphism ?
True or False ?


Select from following answers:
  1. True
  2. False
  3. Maybe
Ans: True

Overloading is Static Polymorphism and Overriding is Dynamic Polymorphism ?
True or False ?


Select from following answers:
  1. True
  2. False
  3. Maybe
Ans: True

Telugu sons free download


All Latest Telugu movies songs

http://hyderabadallinone.blogspot.com/

All Latest Telugu movies songs

http://hyderabadallinone.blogspot.com/

Telugu sons free download


All Latest Telugu movies songs

http://hyderabadallinone.blogspot.com/

All Latest Telugu movies songs

http://hyderabadallinone.blogspot.com/

what is the diff b/w auto post back and post back ?


Q) what is the diff b/w auto post back and post back ?
A)
  • Autopostback - page is posted back to the server automactically based on some events in the control.
  • a postback is performed automatically, for example when the selected value of a dropdown changes
  • Controls that support AutoPostback includes:

    List item
    ListControl
    BulletedList
    CheckBoxList
    DropDownList
    ListBox
    RadioButtonList
    CheckBox
    TextBox
  • •postback:
    the page performs a POST request to itself

Q) what is the diff b/w auto post back and post back ?
A)
  • Autopostback - page is posted back to the server automactically based on some events in the control.
  • a postback is performed automatically, for example when the selected value of a dropdown changes
  • Controls that support AutoPostback includes:

    List item
    ListControl
    BulletedList
    CheckBoxList
    DropDownList
    ListBox
    RadioButtonList
    CheckBox
    TextBox
  • •postback:
    the page performs a POST request to itself

what is the diff b/w auto post back and post back ?


Q) what is the diff b/w auto post back and post back ?
A)
  • Autopostback - page is posted back to the server automactically based on some events in the control.
  • a postback is performed automatically, for example when the selected value of a dropdown changes
  • Controls that support AutoPostback includes:

    List item
    ListControl
    BulletedList
    CheckBoxList
    DropDownList
    ListBox
    RadioButtonList
    CheckBox
    TextBox
  • •postback:
    the page performs a POST request to itself

Q) what is the diff b/w auto post back and post back ?
A)
  • Autopostback - page is posted back to the server automactically based on some events in the control.
  • a postback is performed automatically, for example when the selected value of a dropdown changes
  • Controls that support AutoPostback includes:

    List item
    ListControl
    BulletedList
    CheckBoxList
    DropDownList
    ListBox
    RadioButtonList
    CheckBox
    TextBox
  • •postback:
    the page performs a POST request to itself

shadowing, overloading, and overriding

shadowing, overloading, and overriding

Shadowing, similar to Overloads, allows you to define a method that has the same name as another method in a base class, but without having to ensure a different signature.

You can also shadow a method that is defined in the same class using the Shadows keyword and a different signature, however this has the similar effect of overloading a method and can be used when your intent is to overload and protect your methods at the same time. And since the Shadows keyword is the default, declaring multiple methods with the same name and different signatures without using either keyword is enough to ensure they are both overloaded and shadowed (I never said this was simple!).
shadowing, overloading, and overriding

Shadowing, similar to Overloads, allows you to define a method that has the same name as another method in a base class, but without having to ensure a different signature.

You can also shadow a method that is defined in the same class using the Shadows keyword and a different signature, however this has the similar effect of overloading a method and can be used when your intent is to overload and protect your methods at the same time. And since the Shadows keyword is the default, declaring multiple methods with the same name and different signatures without using either keyword is enough to ensure they are both overloaded and shadowed (I never said this was simple!).

shadowing, overloading, and overriding

shadowing, overloading, and overriding

Shadowing, similar to Overloads, allows you to define a method that has the same name as another method in a base class, but without having to ensure a different signature.

You can also shadow a method that is defined in the same class using the Shadows keyword and a different signature, however this has the similar effect of overloading a method and can be used when your intent is to overload and protect your methods at the same time. And since the Shadows keyword is the default, declaring multiple methods with the same name and different signatures without using either keyword is enough to ensure they are both overloaded and shadowed (I never said this was simple!).
shadowing, overloading, and overriding

Shadowing, similar to Overloads, allows you to define a method that has the same name as another method in a base class, but without having to ensure a different signature.

You can also shadow a method that is defined in the same class using the Shadows keyword and a different signature, however this has the similar effect of overloading a method and can be used when your intent is to overload and protect your methods at the same time. And since the Shadows keyword is the default, declaring multiple methods with the same name and different signatures without using either keyword is enough to ensure they are both overloaded and shadowed (I never said this was simple!).

Primary Key Vs Unique Key


Primary Key :
1) Clustered index
2) It doesn't allow duplicates & NULL values.

Unique Key:
1) Non-clustered Index
2) It doesn't allow duplicates but it allows only one NULL value.


Clustered Index :
1) It store the directly value in a B-Tree Format.
2) A table contain only one Clusted Index

Non-Clustered Index:
1) It store the Address of the value in a B-Tree Format.
2) A table contain more than one Non-clustered Index

Primary Key :
1) Clustered index
2) It doesn't allow duplicates & NULL values.

Unique Key:
1) Non-clustered Index
2) It doesn't allow duplicates but it allows only one NULL value.


Clustered Index :
1) It store the directly value in a B-Tree Format.
2) A table contain only one Clusted Index

Non-Clustered Index:
1) It store the Address of the value in a B-Tree Format.
2) A table contain more than one Non-clustered Index

Primary Key Vs Unique Key


Primary Key :
1) Clustered index
2) It doesn't allow duplicates & NULL values.

Unique Key:
1) Non-clustered Index
2) It doesn't allow duplicates but it allows only one NULL value.


Clustered Index :
1) It store the directly value in a B-Tree Format.
2) A table contain only one Clusted Index

Non-Clustered Index:
1) It store the Address of the value in a B-Tree Format.
2) A table contain more than one Non-clustered Index

Primary Key :
1) Clustered index
2) It doesn't allow duplicates & NULL values.

Unique Key:
1) Non-clustered Index
2) It doesn't allow duplicates but it allows only one NULL value.


Clustered Index :
1) It store the directly value in a B-Tree Format.
2) A table contain only one Clusted Index

Non-Clustered Index:
1) It store the Address of the value in a B-Tree Format.
2) A table contain more than one Non-clustered Index

OOPS Concepts

Operator overloading :

C# operator definitions are class members that define or redefine the behavior of basic C# operators (called implicitly or explicitly) on instances of the class:



public class Complex

{

private double re, im;



public double Real

{

get { return re; }

set { re = value; }

}



public double Imaginary

{

get { return im; }

set { im = value; }

}



// binary operator overloading

public static Complex operator +(Complex c1, Complex c2)

{

return new Complex() { Real = c1.Real + c2.Real, Imaginary = c1.Imaginary + c2.Imaginary };

}



// unary operator overloading

public static Complex operator -(Complex c)

{

return new Complex() { Real = -c.Real, Imaginary = -c.Imaginary };

}



// cast operator overloading (both implicit and explicit)

public static implicit operator double(Complex c)

{

// return the modulus - sqrt(x^2 + y^2)

return Math.Sqrt(Math.Pow(c.Real, 2) + Math.Pow(c.Imaginary, 2));

}



public static explicit operator string(Complex c)

{

// we should be overloading the ToString() method, but this is just a demonstration

return c.Real.ToString() + " + " + c.Imaginary.ToString() + "i";

}

}



public class StaticDemo

{

public static void Main()

{

Complex number1 = new Complex() { Real = 1, Imaginary = 2 };

Complex number2 = new Complex() { Real = 4, Imaginary = 10 };

Complex number3 = number1 + number2; // number3 now has Real = 5, Imaginary = 12



number3 = -number3; // number3 now has Real = -5, Imaginary = -12

double testNumber = number3; // testNumber will be set to the absolute value of number3

Console.WriteLine((string)number3); // This will print "-5 + -12i".

// The cast to string was needed because that was an explicit cast operator.

}

}

Operator overloading :

C# operator definitions are class members that define or redefine the behavior of basic C# operators (called implicitly or explicitly) on instances of the class:



public class Complex

{

private double re, im;



public double Real

{

get { return re; }

set { re = value; }

}



public double Imaginary

{

get { return im; }

set { im = value; }

}



// binary operator overloading

public static Complex operator +(Complex c1, Complex c2)

{

return new Complex() { Real = c1.Real + c2.Real, Imaginary = c1.Imaginary + c2.Imaginary };

}



// unary operator overloading

public static Complex operator -(Complex c)

{

return new Complex() { Real = -c.Real, Imaginary = -c.Imaginary };

}



// cast operator overloading (both implicit and explicit)

public static implicit operator double(Complex c)

{

// return the modulus - sqrt(x^2 + y^2)

return Math.Sqrt(Math.Pow(c.Real, 2) + Math.Pow(c.Imaginary, 2));

}



public static explicit operator string(Complex c)

{

// we should be overloading the ToString() method, but this is just a demonstration

return c.Real.ToString() + " + " + c.Imaginary.ToString() + "i";

}

}



public class StaticDemo

{

public static void Main()

{

Complex number1 = new Complex() { Real = 1, Imaginary = 2 };

Complex number2 = new Complex() { Real = 4, Imaginary = 10 };

Complex number3 = number1 + number2; // number3 now has Real = 5, Imaginary = 12



number3 = -number3; // number3 now has Real = -5, Imaginary = -12

double testNumber = number3; // testNumber will be set to the absolute value of number3

Console.WriteLine((string)number3); // This will print "-5 + -12i".

// The cast to string was needed because that was an explicit cast operator.

}

}

OOPS Concepts

Operator overloading :

C# operator definitions are class members that define or redefine the behavior of basic C# operators (called implicitly or explicitly) on instances of the class:



public class Complex

{

private double re, im;



public double Real

{

get { return re; }

set { re = value; }

}



public double Imaginary

{

get { return im; }

set { im = value; }

}



// binary operator overloading

public static Complex operator +(Complex c1, Complex c2)

{

return new Complex() { Real = c1.Real + c2.Real, Imaginary = c1.Imaginary + c2.Imaginary };

}



// unary operator overloading

public static Complex operator -(Complex c)

{

return new Complex() { Real = -c.Real, Imaginary = -c.Imaginary };

}



// cast operator overloading (both implicit and explicit)

public static implicit operator double(Complex c)

{

// return the modulus - sqrt(x^2 + y^2)

return Math.Sqrt(Math.Pow(c.Real, 2) + Math.Pow(c.Imaginary, 2));

}



public static explicit operator string(Complex c)

{

// we should be overloading the ToString() method, but this is just a demonstration

return c.Real.ToString() + " + " + c.Imaginary.ToString() + "i";

}

}



public class StaticDemo

{

public static void Main()

{

Complex number1 = new Complex() { Real = 1, Imaginary = 2 };

Complex number2 = new Complex() { Real = 4, Imaginary = 10 };

Complex number3 = number1 + number2; // number3 now has Real = 5, Imaginary = 12



number3 = -number3; // number3 now has Real = -5, Imaginary = -12

double testNumber = number3; // testNumber will be set to the absolute value of number3

Console.WriteLine((string)number3); // This will print "-5 + -12i".

// The cast to string was needed because that was an explicit cast operator.

}

}

Operator overloading :

C# operator definitions are class members that define or redefine the behavior of basic C# operators (called implicitly or explicitly) on instances of the class:



public class Complex

{

private double re, im;



public double Real

{

get { return re; }

set { re = value; }

}



public double Imaginary

{

get { return im; }

set { im = value; }

}



// binary operator overloading

public static Complex operator +(Complex c1, Complex c2)

{

return new Complex() { Real = c1.Real + c2.Real, Imaginary = c1.Imaginary + c2.Imaginary };

}



// unary operator overloading

public static Complex operator -(Complex c)

{

return new Complex() { Real = -c.Real, Imaginary = -c.Imaginary };

}



// cast operator overloading (both implicit and explicit)

public static implicit operator double(Complex c)

{

// return the modulus - sqrt(x^2 + y^2)

return Math.Sqrt(Math.Pow(c.Real, 2) + Math.Pow(c.Imaginary, 2));

}



public static explicit operator string(Complex c)

{

// we should be overloading the ToString() method, but this is just a demonstration

return c.Real.ToString() + " + " + c.Imaginary.ToString() + "i";

}

}



public class StaticDemo

{

public static void Main()

{

Complex number1 = new Complex() { Real = 1, Imaginary = 2 };

Complex number2 = new Complex() { Real = 4, Imaginary = 10 };

Complex number3 = number1 + number2; // number3 now has Real = 5, Imaginary = 12



number3 = -number3; // number3 now has Real = -5, Imaginary = -12

double testNumber = number3; // testNumber will be set to the absolute value of number3

Console.WriteLine((string)number3); // This will print "-5 + -12i".

// The cast to string was needed because that was an explicit cast operator.

}

}

Interview Question part 3

Q 1)Can I deploy the application without deploying the source code on the server?


Ans)yes, After Project Completion we will Publish the Code after published we will give the code deploy the application on the server.
*************************************************************************
Q 2)Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.



Ans) inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.

*************************************************************************

Q 3) Can we declare event and delegates in an interface?



Ans)No,we cannot declare delegates in interface however we can declare events in interface.

So interface can only contains the signature of the following members

Methods

Properties

Indexers

Events
Q 1)Can I deploy the application without deploying the source code on the server?


Ans)yes, After Project Completion we will Publish the Code after published we will give the code deploy the application on the server.
*************************************************************************
Q 2)Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.



Ans) inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.

*************************************************************************

Q 3) Can we declare event and delegates in an interface?



Ans)No,we cannot declare delegates in interface however we can declare events in interface.

So interface can only contains the signature of the following members

Methods

Properties

Indexers

Events

ASP.NET Interview Questions for 3+ years Experience

ASP.NET Interview questions for 3+ years Experience

  • From constructor to destructor (taking into consideration Dispose() and the concept of non-deterministic finalization), what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important? What interesting things can you do at each?
  • What are ASHX files? What are HttpHandlers? Where can they be configured?
  • What is needed to configure a new extension for use in ASP.NET? For example, what if I wanted my system to serve ASPX files with a *.jsp extension?
  • What events fire when binding data to a data grid? What are they good for?
  • Explain how PostBacks work, on both the client-side and server-side. How do I chain my own JavaScript into the client side without losing PostBack functionality?
  • How does ViewState work and why is it either useful or evil?
  • What is the OO relationship between an ASPX page and its CS/VB code behind file in ASP.NET 1.1? in 2.0?
  • What happens from the point an HTTP request is received on a TCP/IP port up until the Page fires the On_Load event?
  • How does IIS communicate at runtime with ASP.NET? Where is ASP.NET at runtime in IIS5? IIS6?
  • What is an assembly binding redirect? Where are the places an administrator or developer can affect how assembly binding policy is applied?
  • Compare and contrast LoadLibrary(), CoCreateInstance(), CreateObject() and Assembly.Load().
ASP.NET Interview questions for 3+ years Experience

  • From constructor to destructor (taking into consideration Dispose() and the concept of non-deterministic finalization), what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important? What interesting things can you do at each?
  • What are ASHX files? What are HttpHandlers? Where can they be configured?
  • What is needed to configure a new extension for use in ASP.NET? For example, what if I wanted my system to serve ASPX files with a *.jsp extension?
  • What events fire when binding data to a data grid? What are they good for?
  • Explain how PostBacks work, on both the client-side and server-side. How do I chain my own JavaScript into the client side without losing PostBack functionality?
  • How does ViewState work and why is it either useful or evil?
  • What is the OO relationship between an ASPX page and its CS/VB code behind file in ASP.NET 1.1? in 2.0?
  • What happens from the point an HTTP request is received on a TCP/IP port up until the Page fires the On_Load event?
  • How does IIS communicate at runtime with ASP.NET? Where is ASP.NET at runtime in IIS5? IIS6?
  • What is an assembly binding redirect? Where are the places an administrator or developer can affect how assembly binding policy is applied?
  • Compare and contrast LoadLibrary(), CoCreateInstance(), CreateObject() and Assembly.Load().

ASP.NET Interview Questions for 3+ years Experience

ASP.NET Interview questions for 3+ years Experience

  • From constructor to destructor (taking into consideration Dispose() and the concept of non-deterministic finalization), what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important? What interesting things can you do at each?
  • What are ASHX files? What are HttpHandlers? Where can they be configured?
  • What is needed to configure a new extension for use in ASP.NET? For example, what if I wanted my system to serve ASPX files with a *.jsp extension?
  • What events fire when binding data to a data grid? What are they good for?
  • Explain how PostBacks work, on both the client-side and server-side. How do I chain my own JavaScript into the client side without losing PostBack functionality?
  • How does ViewState work and why is it either useful or evil?
  • What is the OO relationship between an ASPX page and its CS/VB code behind file in ASP.NET 1.1? in 2.0?
  • What happens from the point an HTTP request is received on a TCP/IP port up until the Page fires the On_Load event?
  • How does IIS communicate at runtime with ASP.NET? Where is ASP.NET at runtime in IIS5? IIS6?
  • What is an assembly binding redirect? Where are the places an administrator or developer can affect how assembly binding policy is applied?
  • Compare and contrast LoadLibrary(), CoCreateInstance(), CreateObject() and Assembly.Load().
ASP.NET Interview questions for 3+ years Experience

  • From constructor to destructor (taking into consideration Dispose() and the concept of non-deterministic finalization), what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important? What interesting things can you do at each?
  • What are ASHX files? What are HttpHandlers? Where can they be configured?
  • What is needed to configure a new extension for use in ASP.NET? For example, what if I wanted my system to serve ASPX files with a *.jsp extension?
  • What events fire when binding data to a data grid? What are they good for?
  • Explain how PostBacks work, on both the client-side and server-side. How do I chain my own JavaScript into the client side without losing PostBack functionality?
  • How does ViewState work and why is it either useful or evil?
  • What is the OO relationship between an ASPX page and its CS/VB code behind file in ASP.NET 1.1? in 2.0?
  • What happens from the point an HTTP request is received on a TCP/IP port up until the Page fires the On_Load event?
  • How does IIS communicate at runtime with ASP.NET? Where is ASP.NET at runtime in IIS5? IIS6?
  • What is an assembly binding redirect? Where are the places an administrator or developer can affect how assembly binding policy is applied?
  • Compare and contrast LoadLibrary(), CoCreateInstance(), CreateObject() and Assembly.Load().

Interview Questions Part 2

Q 1)From constructor to destructor (taking into consideration Dispose() and the concept of non-deterministic finalization), what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important? What interesting things can you do at each?

Ans)
From constructor to destructor :

The .NET Framework's garbage collector manages the allocation and release of memory for our application. Each time we use the new operator to create an object(calls the "constructor"), the runtime allocates memory for the object from the managed heap. As long as address space is available in the managed heap, the runtime continues to allocate space for new objects. However, memory is not infinite. Eventually the garbage collector must perform a collection in order to free some memory(calls finalizer/destructor). The garbage collector's optimizing engine determines the best time to perform a collection, based upon the allocations being made. When the garbage collector performs a collection, it checks for objects in the managed heap that are no longer being used by the application and performs the necessary operations to reclaim their memory.

what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important?

  • PreInit Event
    • Called at the very beginning of page initialization, this event has several practical uses in your code behind pages. A few of these uses are: Checking the IsPostBack property, dynamically setting a master page or theme property, dynamically creating controls, and reading or setting property values. If you were so inclined, you could set a master page dynamically in the PreInit event as such:
  • Init Event
    • Called after the PreInit event and after all controls have been initialized and any skin settings have been applied, this event is very useful for initializing control properties before the page loads.
  • InitComplete Event
    • Like the name implies, this event is called after the Init event is completed. I’m at a bit of a loss for thinking up useful and/or interesting things to do with this event, but if there were any tasks that needed to be completed once the controls were initialized, this would be the place to do it.
  • PreLoad Event
    • This event is called immediately before the Page.Load event and after all postback data has been processed.
  • Load Event
    • Probably the most familiar since it comes for free whenever you switch to the code-behind (or hit F7) on an aspx page in Visual Studio. This event is useful for setting control properties and establishing database connections (both of which could be used to populate a drop-down from the database, for example).
  • LoadComplete Event
    • What else could possibly follow up the Load event? This event is useful for doing any processing that requires that all controls on the page first be loaded.
  • PreRender Event
    • This event is useful for making any final changes to the page or the controls before the output is rendered to the browser.
  • PreRenderComplete Event
    • Called after PreRender is completed. This is the last event to be called before the viewstate is saved.
  • SaveStateComplete Event
    • Called once the viewstate has been saved. Use this for any processing that requires the viewstate to be saved but that doesn’t affect the rendering of the controls.
  • Render
    • While not technically an event, this method gets called for every control on the page. When creating a custom control (that requires custom markup), you could override this method to provide your own markup.
  • Unload Event
    • Use this event to do any final cleanup work on the page. Any controls on the page will also have an unload event that can be used to do cleanup on the controls themselves.
  • Disposed Event
    • This is the last event called for a control when it is released from memory on the server. The is the last stage of the ASP.NET lifecycle when a page is requested.
**************************************************************************

Q 2)Does machine.config overrides the configurations mentioned in web.config?

Ans) NO, because machine.config is use for Server configuration, where as web.config is used to setup the Website configuration.

**************************************************************************

Q 3) Does web.config overrides the configurations mentioned in machine.config?

Ans) Yes, we can override the machine.config with web.config.
In some cases we have to override the machine.config with the web.config according to the Application(website) requirement's.
**************************************************************************
Q 4) How can you compress a viewstate?

Ans).NET also provides the GZipStream or DeflateStream to compress viewstate.
**************************************************************************
Q 1)From constructor to destructor (taking into consideration Dispose() and the concept of non-deterministic finalization), what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important? What interesting things can you do at each?

Ans)
From constructor to destructor :

The .NET Framework's garbage collector manages the allocation and release of memory for our application. Each time we use the new operator to create an object(calls the "constructor"), the runtime allocates memory for the object from the managed heap. As long as address space is available in the managed heap, the runtime continues to allocate space for new objects. However, memory is not infinite. Eventually the garbage collector must perform a collection in order to free some memory(calls finalizer/destructor). The garbage collector's optimizing engine determines the best time to perform a collection, based upon the allocations being made. When the garbage collector performs a collection, it checks for objects in the managed heap that are no longer being used by the application and performs the necessary operations to reclaim their memory.

what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important?

  • PreInit Event
    • Called at the very beginning of page initialization, this event has several practical uses in your code behind pages. A few of these uses are: Checking the IsPostBack property, dynamically setting a master page or theme property, dynamically creating controls, and reading or setting property values. If you were so inclined, you could set a master page dynamically in the PreInit event as such:
  • Init Event
    • Called after the PreInit event and after all controls have been initialized and any skin settings have been applied, this event is very useful for initializing control properties before the page loads.
  • InitComplete Event
    • Like the name implies, this event is called after the Init event is completed. I’m at a bit of a loss for thinking up useful and/or interesting things to do with this event, but if there were any tasks that needed to be completed once the controls were initialized, this would be the place to do it.
  • PreLoad Event
    • This event is called immediately before the Page.Load event and after all postback data has been processed.
  • Load Event
    • Probably the most familiar since it comes for free whenever you switch to the code-behind (or hit F7) on an aspx page in Visual Studio. This event is useful for setting control properties and establishing database connections (both of which could be used to populate a drop-down from the database, for example).
  • LoadComplete Event
    • What else could possibly follow up the Load event? This event is useful for doing any processing that requires that all controls on the page first be loaded.
  • PreRender Event
    • This event is useful for making any final changes to the page or the controls before the output is rendered to the browser.
  • PreRenderComplete Event
    • Called after PreRender is completed. This is the last event to be called before the viewstate is saved.
  • SaveStateComplete Event
    • Called once the viewstate has been saved. Use this for any processing that requires the viewstate to be saved but that doesn’t affect the rendering of the controls.
  • Render
    • While not technically an event, this method gets called for every control on the page. When creating a custom control (that requires custom markup), you could override this method to provide your own markup.
  • Unload Event
    • Use this event to do any final cleanup work on the page. Any controls on the page will also have an unload event that can be used to do cleanup on the controls themselves.
  • Disposed Event
    • This is the last event called for a control when it is released from memory on the server. The is the last stage of the ASP.NET lifecycle when a page is requested.
**************************************************************************

Q 2)Does machine.config overrides the configurations mentioned in web.config?

Ans) NO, because machine.config is use for Server configuration, where as web.config is used to setup the Website configuration.

**************************************************************************

Q 3) Does web.config overrides the configurations mentioned in machine.config?

Ans) Yes, we can override the machine.config with web.config.
In some cases we have to override the machine.config with the web.config according to the Application(website) requirement's.
**************************************************************************
Q 4) How can you compress a viewstate?

Ans).NET also provides the GZipStream or DeflateStream to compress viewstate.
**************************************************************************

Interview Questions Part 2

Q 1)From constructor to destructor (taking into consideration Dispose() and the concept of non-deterministic finalization), what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important? What interesting things can you do at each?

Ans)
From constructor to destructor :

The .NET Framework's garbage collector manages the allocation and release of memory for our application. Each time we use the new operator to create an object(calls the "constructor"), the runtime allocates memory for the object from the managed heap. As long as address space is available in the managed heap, the runtime continues to allocate space for new objects. However, memory is not infinite. Eventually the garbage collector must perform a collection in order to free some memory(calls finalizer/destructor). The garbage collector's optimizing engine determines the best time to perform a collection, based upon the allocations being made. When the garbage collector performs a collection, it checks for objects in the managed heap that are no longer being used by the application and performs the necessary operations to reclaim their memory.

what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important?

  • PreInit Event
    • Called at the very beginning of page initialization, this event has several practical uses in your code behind pages. A few of these uses are: Checking the IsPostBack property, dynamically setting a master page or theme property, dynamically creating controls, and reading or setting property values. If you were so inclined, you could set a master page dynamically in the PreInit event as such:
  • Init Event
    • Called after the PreInit event and after all controls have been initialized and any skin settings have been applied, this event is very useful for initializing control properties before the page loads.
  • InitComplete Event
    • Like the name implies, this event is called after the Init event is completed. I’m at a bit of a loss for thinking up useful and/or interesting things to do with this event, but if there were any tasks that needed to be completed once the controls were initialized, this would be the place to do it.
  • PreLoad Event
    • This event is called immediately before the Page.Load event and after all postback data has been processed.
  • Load Event
    • Probably the most familiar since it comes for free whenever you switch to the code-behind (or hit F7) on an aspx page in Visual Studio. This event is useful for setting control properties and establishing database connections (both of which could be used to populate a drop-down from the database, for example).
  • LoadComplete Event
    • What else could possibly follow up the Load event? This event is useful for doing any processing that requires that all controls on the page first be loaded.
  • PreRender Event
    • This event is useful for making any final changes to the page or the controls before the output is rendered to the browser.
  • PreRenderComplete Event
    • Called after PreRender is completed. This is the last event to be called before the viewstate is saved.
  • SaveStateComplete Event
    • Called once the viewstate has been saved. Use this for any processing that requires the viewstate to be saved but that doesn’t affect the rendering of the controls.
  • Render
    • While not technically an event, this method gets called for every control on the page. When creating a custom control (that requires custom markup), you could override this method to provide your own markup.
  • Unload Event
    • Use this event to do any final cleanup work on the page. Any controls on the page will also have an unload event that can be used to do cleanup on the controls themselves.
  • Disposed Event
    • This is the last event called for a control when it is released from memory on the server. The is the last stage of the ASP.NET lifecycle when a page is requested.
**************************************************************************

Q 2)Does machine.config overrides the configurations mentioned in web.config?

Ans) NO, because machine.config is use for Server configuration, where as web.config is used to setup the Website configuration.

**************************************************************************

Q 3) Does web.config overrides the configurations mentioned in machine.config?

Ans) Yes, we can override the machine.config with web.config.
In some cases we have to override the machine.config with the web.config according to the Application(website) requirement's.
**************************************************************************
Q 4) How can you compress a viewstate?

Ans).NET also provides the GZipStream or DeflateStream to compress viewstate.
**************************************************************************
Q 1)From constructor to destructor (taking into consideration Dispose() and the concept of non-deterministic finalization), what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important? What interesting things can you do at each?

Ans)
From constructor to destructor :

The .NET Framework's garbage collector manages the allocation and release of memory for our application. Each time we use the new operator to create an object(calls the "constructor"), the runtime allocates memory for the object from the managed heap. As long as address space is available in the managed heap, the runtime continues to allocate space for new objects. However, memory is not infinite. Eventually the garbage collector must perform a collection in order to free some memory(calls finalizer/destructor). The garbage collector's optimizing engine determines the best time to perform a collection, based upon the allocations being made. When the garbage collector performs a collection, it checks for objects in the managed heap that are no longer being used by the application and performs the necessary operations to reclaim their memory.

what the are events fired as part of the ASP.NET System.Web.UI.Page lifecycle. Why are they important?

  • PreInit Event
    • Called at the very beginning of page initialization, this event has several practical uses in your code behind pages. A few of these uses are: Checking the IsPostBack property, dynamically setting a master page or theme property, dynamically creating controls, and reading or setting property values. If you were so inclined, you could set a master page dynamically in the PreInit event as such:
  • Init Event
    • Called after the PreInit event and after all controls have been initialized and any skin settings have been applied, this event is very useful for initializing control properties before the page loads.
  • InitComplete Event
    • Like the name implies, this event is called after the Init event is completed. I’m at a bit of a loss for thinking up useful and/or interesting things to do with this event, but if there were any tasks that needed to be completed once the controls were initialized, this would be the place to do it.
  • PreLoad Event
    • This event is called immediately before the Page.Load event and after all postback data has been processed.
  • Load Event
    • Probably the most familiar since it comes for free whenever you switch to the code-behind (or hit F7) on an aspx page in Visual Studio. This event is useful for setting control properties and establishing database connections (both of which could be used to populate a drop-down from the database, for example).
  • LoadComplete Event
    • What else could possibly follow up the Load event? This event is useful for doing any processing that requires that all controls on the page first be loaded.
  • PreRender Event
    • This event is useful for making any final changes to the page or the controls before the output is rendered to the browser.
  • PreRenderComplete Event
    • Called after PreRender is completed. This is the last event to be called before the viewstate is saved.
  • SaveStateComplete Event
    • Called once the viewstate has been saved. Use this for any processing that requires the viewstate to be saved but that doesn’t affect the rendering of the controls.
  • Render
    • While not technically an event, this method gets called for every control on the page. When creating a custom control (that requires custom markup), you could override this method to provide your own markup.
  • Unload Event
    • Use this event to do any final cleanup work on the page. Any controls on the page will also have an unload event that can be used to do cleanup on the controls themselves.
  • Disposed Event
    • This is the last event called for a control when it is released from memory on the server. The is the last stage of the ASP.NET lifecycle when a page is requested.
**************************************************************************

Q 2)Does machine.config overrides the configurations mentioned in web.config?

Ans) NO, because machine.config is use for Server configuration, where as web.config is used to setup the Website configuration.

**************************************************************************

Q 3) Does web.config overrides the configurations mentioned in machine.config?

Ans) Yes, we can override the machine.config with web.config.
In some cases we have to override the machine.config with the web.config according to the Application(website) requirement's.
**************************************************************************
Q 4) How can you compress a viewstate?

Ans).NET also provides the GZipStream or DeflateStream to compress viewstate.
**************************************************************************

Nested Selects in LINQ to SQL


Consider the following diagram to track the votes in a contest. Each voter can register only one vote (a score from 1 to 4) for each contest entry.




For any given voter, you'll want to present a screen showing every entry in the competition, along with the score assigned to the entry by the voter (if a score exists). To fetch the data with SQL, I'd write something like:



SELECT E.EntryID, E.EntryName, E.EntryDescription, @VoterID AS VoterID,
(SELECT V.Score
FROM Votes AS V
WHERE (V.VoterID = @VoterID) AND (V.EntryID = E.EntryID)) AS Score
FROM Entries AS E

The query should yield a resultset like the following:
...
EntryID EntryName VoterID Score

13 EntryA 1 4
14 EntryB 1 2
15 EntryC 1 NULL
...

I thought the query would be difficult to express in LINQ, but I stumbled into a solution just by keeping a "SQL" mindset:


var q = from e in Entries
select new
{
EntryID = e.EntryID,
EntryName = e.EntryName,
EntryDescription = e.EntryDescription,
VoterID = voterID,
Score = (int?)(from v in e.Votes
where v.VoterID == voterID
select v.Score).FirstOrDefault()
};

The LINQ generated SQL looks amazingly similar to the hand generated SQL, which is a comforting sight!

Consider the following diagram to track the votes in a contest. Each voter can register only one vote (a score from 1 to 4) for each contest entry.




For any given voter, you'll want to present a screen showing every entry in the competition, along with the score assigned to the entry by the voter (if a score exists). To fetch the data with SQL, I'd write something like:



SELECT E.EntryID, E.EntryName, E.EntryDescription, @VoterID AS VoterID,
(SELECT V.Score
FROM Votes AS V
WHERE (V.VoterID = @VoterID) AND (V.EntryID = E.EntryID)) AS Score
FROM Entries AS E

The query should yield a resultset like the following:
...
EntryID EntryName VoterID Score

13 EntryA 1 4
14 EntryB 1 2
15 EntryC 1 NULL
...

I thought the query would be difficult to express in LINQ, but I stumbled into a solution just by keeping a "SQL" mindset:


var q = from e in Entries
select new
{
EntryID = e.EntryID,
EntryName = e.EntryName,
EntryDescription = e.EntryDescription,
VoterID = voterID,
Score = (int?)(from v in e.Votes
where v.VoterID == voterID
select v.Score).FirstOrDefault()
};

The LINQ generated SQL looks amazingly similar to the hand generated SQL, which is a comforting sight!

Nested Selects in LINQ to SQL


Consider the following diagram to track the votes in a contest. Each voter can register only one vote (a score from 1 to 4) for each contest entry.




For any given voter, you'll want to present a screen showing every entry in the competition, along with the score assigned to the entry by the voter (if a score exists). To fetch the data with SQL, I'd write something like:



SELECT E.EntryID, E.EntryName, E.EntryDescription, @VoterID AS VoterID,
(SELECT V.Score
FROM Votes AS V
WHERE (V.VoterID = @VoterID) AND (V.EntryID = E.EntryID)) AS Score
FROM Entries AS E

The query should yield a resultset like the following:
...
EntryID EntryName VoterID Score

13 EntryA 1 4
14 EntryB 1 2
15 EntryC 1 NULL
...

I thought the query would be difficult to express in LINQ, but I stumbled into a solution just by keeping a "SQL" mindset:


var q = from e in Entries
select new
{
EntryID = e.EntryID,
EntryName = e.EntryName,
EntryDescription = e.EntryDescription,
VoterID = voterID,
Score = (int?)(from v in e.Votes
where v.VoterID == voterID
select v.Score).FirstOrDefault()
};

The LINQ generated SQL looks amazingly similar to the hand generated SQL, which is a comforting sight!

Consider the following diagram to track the votes in a contest. Each voter can register only one vote (a score from 1 to 4) for each contest entry.




For any given voter, you'll want to present a screen showing every entry in the competition, along with the score assigned to the entry by the voter (if a score exists). To fetch the data with SQL, I'd write something like:



SELECT E.EntryID, E.EntryName, E.EntryDescription, @VoterID AS VoterID,
(SELECT V.Score
FROM Votes AS V
WHERE (V.VoterID = @VoterID) AND (V.EntryID = E.EntryID)) AS Score
FROM Entries AS E

The query should yield a resultset like the following:
...
EntryID EntryName VoterID Score

13 EntryA 1 4
14 EntryB 1 2
15 EntryC 1 NULL
...

I thought the query would be difficult to express in LINQ, but I stumbled into a solution just by keeping a "SQL" mindset:


var q = from e in Entries
select new
{
EntryID = e.EntryID,
EntryName = e.EntryName,
EntryDescription = e.EntryDescription,
VoterID = voterID,
Score = (int?)(from v in e.Votes
where v.VoterID == voterID
select v.Score).FirstOrDefault()
};

The LINQ generated SQL looks amazingly similar to the hand generated SQL, which is a comforting sight!

Introduction for WPF






Windows Presentation Foundation :


As the name says all, WPF is actually a new framework introduced with .NET framework 3.0 which actually puts forward a new set of classes and assemblies which allow us to write programs more efficiently and flexibly. It uses Direct3D rendering which employs graphics cards to render the output on the screen. Thus the drawing in the form will be smooth and also there is a chance to utilize the hardware capabilities installed in your machine. In case of traditional GDI forms application, it is not possible to use advanced graphics capabilities and hence Windows Forms application will always be inefficient in comparison to WPF. Another important thing that I must address in this regard, GDI Windows forms application uses Operating system controls to build its application. Thus it is basically very hard to customize them in your own application. WPF controls are actually drawn over the screen, and hence you can customize controls totally and modify their behavior when required.


Difference b/w Windows Forms and WPF Application :


Features of WPF :



WPF comes with lots of advantages. Let me introduce a few of its features:



  • Device Independent Pixel (DPI)

    WPF introduces Device Independent DPI Settings for the applications built with it. For a window, it is very
    important to calculate how many Dots Per inch(DPI) the screen could draw. This is generally dependent on the
    hardware device and operating system in which the application runs and also how the DPI settings is applied on
    the Device. Any user can easily customize these settings and hence make the application look horrible. Windows
    forms application uses pixel based approach so with changing DPI settings, each control will change its size and
    look.

    WPF addresses this issue and makes it independent of DPI settings of the computer. Let's look at
    how it is possible:


    Let's say you have drawn a box, just like the one in the figure, which is 1 inch long in 96 dpi
    screen. Now if you see the same application in 120 dpi settings, the box will appear smaller. This is because
    the things that we see on the screen are totally dependent on dpi settings.

    In case of WPF, this is
    modified to density based approach. That means when the density of pixel is modified, the elements will adjust
    them accordingly and hence the pixel of WPF application is Device Independent Pixel. As you can see in the
    figure, the size of the control remains the same in case of WPF application and it takes more pixels in
    case of 120 DPI application to adjust the size properly.


  • Redefine Styles and Control Templates

    In addition to graphics and animation
    capabilities, WPF also comes with a huge flexibility to define the styles and ControlTemplates.
    Style based technique as you might come across with CSS is a set of definitions which defines how the controls
    will look like when it is rendered on the screen. In case of traditional windows applications, styles are tightly
    coupled with each control, so that you need to define color, style, etc. for each individual control to make it
    look different. In case of WPF, Styles are completely separated from the UIElement. Once you define
    a style, you can change the look and feel of any control by just putting the style on the element.

    Most of
    the UIElements that we generally deal with are actually made using more than one individual elements.
    WPF introduces a new concept of Templates, which you might use to redefine the whole control itself.
    Say for instance, you have a CheckBox, which has a Rectangle in it and a
    ContentPresenter (one where the caption of the TextBox appears). Thus you can redefine
    your checkbox and put a ToggleButton inside it, so that the check will appear on the
    ToggleButton rather than on the Rectangle. This is very interesting. We will look into
    more detail on Styles and ControlTemplates in later section of the article.



  • What is XAML?


    According to the definition, XAML is an XML based declarative markup language for specifying and setting the
    characteristics of classes. In other words, XAML is a language used by WPF, Silverlight or any other application
    which can declare classes by itself. So, you can declare a variable, define the properties of any class and
    directly use it in your application. The XAML parser will automatically parse and create the actual object
    while it renders the application.

    XAML is generally used to define layout of UI, its elements and
    objects for static and visual aspect. We cannot define flow of a program using XAML. So even though there are
    large capabilities of XAML, it is actually not a programming language, rather it is used to design UI of the
    application. Thus XAML employs other programming languages like C#, VB.NET, etc. to define the logic in code
    behind.

    ExpressionBuilder is the best tool to generate XAML.


    WPF Architecture







    For every new technology, it is very essential to have a clear idea about its architecture. So before beginning
    your application, you must grab a few concepts. If you would not like to know WPF in detail, please skip this
    section. As mentioned earlier, WPF is actually a set of assemblies that build up the entire framework. These
    assemblies can be categorized as:

    • Managed Layer
    • UnManaged Layer

    • Core API

    Managed Layer: Managed layer of WPF is built using a number of
    assemblies. These assemblies build up the WPF framework, communicate with lower level unmanaged API to render its
    content. The few assemblies that comprise the WPF framework are:

    1. PresentationFramework.
      dll
      : Creates the top level elements like layout panels, controls, windows, styles, etc.

    2. PresentationCore.dll: It holds base types such as UIElement,
      Visual from which all shapes and controls are Derived in PresentationFramework.dll.

    3. WindowsBase.dll: They hold even more basic elements which are capable of being used
      outside the WPF environment like Dispatcher object, Dependency Objects. I will discuss
      each of them later.

    Unmanaged Layer (milcore.dll): The unmanaged layer
    of WPF is called milcore or Media Integration Library Core. It basically translates the WPF higher level objects
    like layout panels, buttons, animation, etc. into textures that Direct3D expects. It is the main
    rendering engine of WPF.

    WindowsCodecs.dll: This is another low level API which
    is used for imaging support in WPF applications. WindowsCodecs.dll comprises a number of codecs which
    encode / decode images into vector graphics that would be rendered into WPF screen.

    Direct3D: It is the low level API in which the graphics of WPF is rendered.

    User32: It is the primary core API which every program uses. It actually manages memory and process separation.

    GDI & Device Drivers: GDI and Device Drivers are specific to the operating system which is also used from the application to access low level APIs.


    Building Your First WPF Application :


    Now the time has come to build your first WPF Application.
    To do this, let's open Visual Studio 2008 / 2010. For this example, I used Visual Studio 2008. Create a new
    Project. You will see a new window. The XAML will look like:

    *******************************************************

    <
    Window x:Class
    ="FirstWindowsApplication.Window1"
     xmlns
    ="
    http://schemas.microsoft.com/winfx/2006/xaml/presentation"

       xmlns:x
    ="http://schemas.microsoft.com/winfx/2006/xaml"
     x:Name="Window1"  
     Title="Window1" Height="300" Width="300">  
      <Grid>   
     </Grid> 
    </Window>
    *******************************************************

    Here the blank window is produced. Height / Width represents the Size of the

    Window. Title determines the text which is displayed in the TitleBar of the

    window. Every control in XAML could be named with x:Name attribute. This will

    be used to reference the Window object in your XAML. x:Class attribute

    represents the class which should be associated with current Window.

    As I already told you, that XAML is not self sufficient, so to define

    logic you need a class in C# or VB.NET.

    Grid is the primary layout for WPF application. Grid can take multiple

    Child elements. So let us put some controls into the grid.

    *******************************************************

    <Grid>   
     <Grid.RowDefinitions>  
    <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition MinWidth="50" />
    <ColumnDefinition Width="Auto" />
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <TextBlock Text="Enter Name :" Grid.Row="0" Grid.Column="0" />
    <TextBox x:Name="txtName" Grid.Row="0" Grid.Column="1" MinWidth="50"/>
    <Button Content="Click Me" Grid.Row="0" Grid.Column="2" Click="Button_Click"/>
    </Grid>
    *******************************************************

    You can see that I have defined RowDefination and ColumnDefination.

    This allows you to divide the grid into cells so that you can place your

    control exactly where you want to. For each RowDefination and ColumnDefination,

    you can use Height and Width of it. You can see I have used 50, Auto,

    and * as width. Auto represents the size which we would define for the control

    during control definition. * indicates the rest of the space which it can

    take. Thus, you can see the button is spread the rest of the area of the

    column it finds.

    Now in the Behind, I put a Messagebox to show the content of TextBox.

    ********************************************************************

    private void Button_Click(object sender, RoutedEventArgs e) 
     {  
        MessageBox.Show(string.Format("Hi {0}", this.txtName.Text)); 
     }
    ********************************************************************






Windows Presentation Foundation :


As the name says all, WPF is actually a new framework introduced with .NET framework 3.0 which actually puts forward a new set of classes and assemblies which allow us to write programs more efficiently and flexibly. It uses Direct3D rendering which employs graphics cards to render the output on the screen. Thus the drawing in the form will be smooth and also there is a chance to utilize the hardware capabilities installed in your machine. In case of traditional GDI forms application, it is not possible to use advanced graphics capabilities and hence Windows Forms application will always be inefficient in comparison to WPF. Another important thing that I must address in this regard, GDI Windows forms application uses Operating system controls to build its application. Thus it is basically very hard to customize them in your own application. WPF controls are actually drawn over the screen, and hence you can customize controls totally and modify their behavior when required.


Difference b/w Windows Forms and WPF Application :


Features of WPF :



WPF comes with lots of advantages. Let me introduce a few of its features:



  • Device Independent Pixel (DPI)

    WPF introduces Device Independent DPI Settings for the applications built with it. For a window, it is very
    important to calculate how many Dots Per inch(DPI) the screen could draw. This is generally dependent on the
    hardware device and operating system in which the application runs and also how the DPI settings is applied on
    the Device. Any user can easily customize these settings and hence make the application look horrible. Windows
    forms application uses pixel based approach so with changing DPI settings, each control will change its size and
    look.

    WPF addresses this issue and makes it independent of DPI settings of the computer. Let's look at
    how it is possible:


    Let's say you have drawn a box, just like the one in the figure, which is 1 inch long in 96 dpi
    screen. Now if you see the same application in 120 dpi settings, the box will appear smaller. This is because
    the things that we see on the screen are totally dependent on dpi settings.

    In case of WPF, this is
    modified to density based approach. That means when the density of pixel is modified, the elements will adjust
    them accordingly and hence the pixel of WPF application is Device Independent Pixel. As you can see in the
    figure, the size of the control remains the same in case of WPF application and it takes more pixels in
    case of 120 DPI application to adjust the size properly.


  • Redefine Styles and Control Templates

    In addition to graphics and animation
    capabilities, WPF also comes with a huge flexibility to define the styles and ControlTemplates.
    Style based technique as you might come across with CSS is a set of definitions which defines how the controls
    will look like when it is rendered on the screen. In case of traditional windows applications, styles are tightly
    coupled with each control, so that you need to define color, style, etc. for each individual control to make it
    look different. In case of WPF, Styles are completely separated from the UIElement. Once you define
    a style, you can change the look and feel of any control by just putting the style on the element.

    Most of
    the UIElements that we generally deal with are actually made using more than one individual elements.
    WPF introduces a new concept of Templates, which you might use to redefine the whole control itself.
    Say for instance, you have a CheckBox, which has a Rectangle in it and a
    ContentPresenter (one where the caption of the TextBox appears). Thus you can redefine
    your checkbox and put a ToggleButton inside it, so that the check will appear on the
    ToggleButton rather than on the Rectangle. This is very interesting. We will look into
    more detail on Styles and ControlTemplates in later section of the article.



  • What is XAML?


    According to the definition, XAML is an XML based declarative markup language for specifying and setting the
    characteristics of classes. In other words, XAML is a language used by WPF, Silverlight or any other application
    which can declare classes by itself. So, you can declare a variable, define the properties of any class and
    directly use it in your application. The XAML parser will automatically parse and create the actual object
    while it renders the application.

    XAML is generally used to define layout of UI, its elements and
    objects for static and visual aspect. We cannot define flow of a program using XAML. So even though there are
    large capabilities of XAML, it is actually not a programming language, rather it is used to design UI of the
    application. Thus XAML employs other programming languages like C#, VB.NET, etc. to define the logic in code
    behind.

    ExpressionBuilder is the best tool to generate XAML.


    WPF Architecture







    For every new technology, it is very essential to have a clear idea about its architecture. So before beginning
    your application, you must grab a few concepts. If you would not like to know WPF in detail, please skip this
    section. As mentioned earlier, WPF is actually a set of assemblies that build up the entire framework. These
    assemblies can be categorized as:

    • Managed Layer
    • UnManaged Layer

    • Core API

    Managed Layer: Managed layer of WPF is built using a number of
    assemblies. These assemblies build up the WPF framework, communicate with lower level unmanaged API to render its
    content. The few assemblies that comprise the WPF framework are:

    1. PresentationFramework.
      dll
      : Creates the top level elements like layout panels, controls, windows, styles, etc.

    2. PresentationCore.dll: It holds base types such as UIElement,
      Visual from which all shapes and controls are Derived in PresentationFramework.dll.

    3. WindowsBase.dll: They hold even more basic elements which are capable of being used
      outside the WPF environment like Dispatcher object, Dependency Objects. I will discuss
      each of them later.

    Unmanaged Layer (milcore.dll): The unmanaged layer
    of WPF is called milcore or Media Integration Library Core. It basically translates the WPF higher level objects
    like layout panels, buttons, animation, etc. into textures that Direct3D expects. It is the main
    rendering engine of WPF.

    WindowsCodecs.dll: This is another low level API which
    is used for imaging support in WPF applications. WindowsCodecs.dll comprises a number of codecs which
    encode / decode images into vector graphics that would be rendered into WPF screen.

    Direct3D: It is the low level API in which the graphics of WPF is rendered.

    User32: It is the primary core API which every program uses. It actually manages memory and process separation.

    GDI & Device Drivers: GDI and Device Drivers are specific to the operating system which is also used from the application to access low level APIs.


    Building Your First WPF Application :


    Now the time has come to build your first WPF Application.
    To do this, let's open Visual Studio 2008 / 2010. For this example, I used Visual Studio 2008. Create a new
    Project. You will see a new window. The XAML will look like:

    *******************************************************

    <
    Window x:Class
    ="FirstWindowsApplication.Window1"
     xmlns
    ="
    http://schemas.microsoft.com/winfx/2006/xaml/presentation"

       xmlns:x
    ="http://schemas.microsoft.com/winfx/2006/xaml"
     x:Name="Window1"  
     Title="Window1" Height="300" Width="300">  
      <Grid>   
     </Grid> 
    </Window>
    *******************************************************

    Here the blank window is produced. Height / Width represents the Size of the

    Window. Title determines the text which is displayed in the TitleBar of the

    window. Every control in XAML could be named with x:Name attribute. This will

    be used to reference the Window object in your XAML. x:Class attribute

    represents the class which should be associated with current Window.

    As I already told you, that XAML is not self sufficient, so to define

    logic you need a class in C# or VB.NET.

    Grid is the primary layout for WPF application. Grid can take multiple

    Child elements. So let us put some controls into the grid.

    *******************************************************

    <Grid>   
     <Grid.RowDefinitions>  
    <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition MinWidth="50" />
    <ColumnDefinition Width="Auto" />
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <TextBlock Text="Enter Name :" Grid.Row="0" Grid.Column="0" />
    <TextBox x:Name="txtName" Grid.Row="0" Grid.Column="1" MinWidth="50"/>
    <Button Content="Click Me" Grid.Row="0" Grid.Column="2" Click="Button_Click"/>
    </Grid>
    *******************************************************

    You can see that I have defined RowDefination and ColumnDefination.

    This allows you to divide the grid into cells so that you can place your

    control exactly where you want to. For each RowDefination and ColumnDefination,

    you can use Height and Width of it. You can see I have used 50, Auto,

    and * as width. Auto represents the size which we would define for the control

    during control definition. * indicates the rest of the space which it can

    take. Thus, you can see the button is spread the rest of the area of the

    column it finds.

    Now in the Behind, I put a Messagebox to show the content of TextBox.

    ********************************************************************

    private void Button_Click(object sender, RoutedEventArgs e) 
     {  
        MessageBox.Show(string.Format("Hi {0}", this.txtName.Text)); 
     }
    ********************************************************************

Interview Questions Part 1


Q 1) MVC Means ?
Ans)
ASP.NET MVC is a part of the ASP.NET Web application framework
MVC stands for multi view controller and this is a part of dot net framework. It has several versions.
MVC application is created by using following 3 attributes namely: Model, View and Controller.

Model: It tells the the core information of an application which includes data, validation rules and data access and aggregation logic.

View: The view is used to encapsulate the presentation of the application.

Controller: The controller contains of the control-flow logic. Controller interacts with the Model and View in order to control the flow and execution of the application.

--------------------------------------------------------------------------------------------------------------------
Q 2) Is it possible to implement an interface to a structure?
Is it possible to extend a struct?
Is it possible to inherit a class to struct?

Is it possible to implement an interface to a structure?
Ans: A struct can implement interfaces, and it does that  exactly 
 as classes do.
Is it possible to extend a struct? 
Ans: struct cannot extend another struct  
Is it possible to inherit a class to struct?
Ans:  A struct cannot inherit from another struct or class
--------------------------------------------------------------------
Q 3)  When static constructor is invoked?
A static constructor is used to initialize any static data, or to  
perform a Particular action that needs performed once only. It is
called automatically before the first instance is created or any
static members are referenced.
Static constructors have the following properties: 
• A static constructor does not take access modifiers or have 
 parameters.
• A static constructor is called automatically to initialize the class 
 before the first instance is created or any static members are referenced.
• A static constructor cannot be called directly.
• The user has no control on when the static constructor is executed in the program.
• A typical use of static constructors is when the class is using a log file and the
  constructor is used to write entries to this file.
• Static constructors are also useful when creating wrapper classes for unmanaged
  code, when the constructor can call the LoadLibrary method.
 public class Bus {    
 // Static constructor:    
 static Bus()   
  {    
     System.Console.WriteLine("The static constructor invoked.");  
   } 
 public static void Drive()  
 {    
     System.Console.WriteLine("The Drive method invoked.");  
 }
  }  
class TestBus {     
static void Main()  
{  Bus.Drive();  
}
 }
Tags : 
MVC,
Is it possible to implement an interface to a structure,
Is it possible to extend a struct,
Is it possible to inherit a class to struct,

Is it possible to implement an interface to a structure,
 

Q 1) MVC Means ?
Ans)
ASP.NET MVC is a part of the ASP.NET Web application framework
MVC stands for multi view controller and this is a part of dot net framework. It has several versions.
MVC application is created by using following 3 attributes namely: Model, View and Controller.

Model: It tells the the core information of an application which includes data, validation rules and data access and aggregation logic.

View: The view is used to encapsulate the presentation of the application.

Controller: The controller contains of the control-flow logic. Controller interacts with the Model and View in order to control the flow and execution of the application.

--------------------------------------------------------------------------------------------------------------------
Q 2) Is it possible to implement an interface to a structure?
Is it possible to extend a struct?
Is it possible to inherit a class to struct?

Is it possible to implement an interface to a structure?
Ans: A struct can implement interfaces, and it does that  exactly 
 as classes do.
Is it possible to extend a struct? 
Ans: struct cannot extend another struct  
Is it possible to inherit a class to struct?
Ans:  A struct cannot inherit from another struct or class
--------------------------------------------------------------------
Q 3)  When static constructor is invoked?
A static constructor is used to initialize any static data, or to  
perform a Particular action that needs performed once only. It is
called automatically before the first instance is created or any
static members are referenced.
Static constructors have the following properties: 
• A static constructor does not take access modifiers or have 
 parameters.
• A static constructor is called automatically to initialize the class 
 before the first instance is created or any static members are referenced.
• A static constructor cannot be called directly.
• The user has no control on when the static constructor is executed in the program.
• A typical use of static constructors is when the class is using a log file and the
  constructor is used to write entries to this file.
• Static constructors are also useful when creating wrapper classes for unmanaged
  code, when the constructor can call the LoadLibrary method.
 public class Bus {    
 // Static constructor:    
 static Bus()   
  {    
     System.Console.WriteLine("The static constructor invoked.");  
   } 
 public static void Drive()  
 {    
     System.Console.WriteLine("The Drive method invoked.");  
 }
  }  
class TestBus {     
static void Main()  
{  Bus.Drive();  
}
 }
Tags : 
MVC,
Is it possible to implement an interface to a structure,
Is it possible to extend a struct,
Is it possible to inherit a class to struct,

Is it possible to implement an interface to a structure,
 

Interview Questions Part 1


Q 1) MVC Means ?
Ans)
ASP.NET MVC is a part of the ASP.NET Web application framework
MVC stands for multi view controller and this is a part of dot net framework. It has several versions.
MVC application is created by using following 3 attributes namely: Model, View and Controller.

Model: It tells the the core information of an application which includes data, validation rules and data access and aggregation logic.

View: The view is used to encapsulate the presentation of the application.

Controller: The controller contains of the control-flow logic. Controller interacts with the Model and View in order to control the flow and execution of the application.

--------------------------------------------------------------------------------------------------------------------
Q 2) Is it possible to implement an interface to a structure?
Is it possible to extend a struct?
Is it possible to inherit a class to struct?

Is it possible to implement an interface to a structure?
Ans: A struct can implement interfaces, and it does that  exactly 
 as classes do.
Is it possible to extend a struct? 
Ans: struct cannot extend another struct  
Is it possible to inherit a class to struct?
Ans:  A struct cannot inherit from another struct or class
--------------------------------------------------------------------
Q 3)  When static constructor is invoked?
A static constructor is used to initialize any static data, or to  
perform a Particular action that needs performed once only. It is
called automatically before the first instance is created or any
static members are referenced.
Static constructors have the following properties: 
• A static constructor does not take access modifiers or have 
 parameters.
• A static constructor is called automatically to initialize the class 
 before the first instance is created or any static members are referenced.
• A static constructor cannot be called directly.
• The user has no control on when the static constructor is executed in the program.
• A typical use of static constructors is when the class is using a log file and the
  constructor is used to write entries to this file.
• Static constructors are also useful when creating wrapper classes for unmanaged
  code, when the constructor can call the LoadLibrary method.
 public class Bus {    
 // Static constructor:    
 static Bus()   
  {    
     System.Console.WriteLine("The static constructor invoked.");  
   } 
 public static void Drive()  
 {    
     System.Console.WriteLine("The Drive method invoked.");  
 }
  }  
class TestBus {     
static void Main()  
{  Bus.Drive();  
}
 }
Tags : 
MVC,
Is it possible to implement an interface to a structure,
Is it possible to extend a struct,
Is it possible to inherit a class to struct,

Is it possible to implement an interface to a structure,
 

Q 1) MVC Means ?
Ans)
ASP.NET MVC is a part of the ASP.NET Web application framework
MVC stands for multi view controller and this is a part of dot net framework. It has several versions.
MVC application is created by using following 3 attributes namely: Model, View and Controller.

Model: It tells the the core information of an application which includes data, validation rules and data access and aggregation logic.

View: The view is used to encapsulate the presentation of the application.

Controller: The controller contains of the control-flow logic. Controller interacts with the Model and View in order to control the flow and execution of the application.

--------------------------------------------------------------------------------------------------------------------
Q 2) Is it possible to implement an interface to a structure?
Is it possible to extend a struct?
Is it possible to inherit a class to struct?

Is it possible to implement an interface to a structure?
Ans: A struct can implement interfaces, and it does that  exactly 
 as classes do.
Is it possible to extend a struct? 
Ans: struct cannot extend another struct  
Is it possible to inherit a class to struct?
Ans:  A struct cannot inherit from another struct or class
--------------------------------------------------------------------
Q 3)  When static constructor is invoked?
A static constructor is used to initialize any static data, or to  
perform a Particular action that needs performed once only. It is
called automatically before the first instance is created or any
static members are referenced.
Static constructors have the following properties: 
• A static constructor does not take access modifiers or have 
 parameters.
• A static constructor is called automatically to initialize the class 
 before the first instance is created or any static members are referenced.
• A static constructor cannot be called directly.
• The user has no control on when the static constructor is executed in the program.
• A typical use of static constructors is when the class is using a log file and the
  constructor is used to write entries to this file.
• Static constructors are also useful when creating wrapper classes for unmanaged
  code, when the constructor can call the LoadLibrary method.
 public class Bus {    
 // Static constructor:    
 static Bus()   
  {    
     System.Console.WriteLine("The static constructor invoked.");  
   } 
 public static void Drive()  
 {    
     System.Console.WriteLine("The Drive method invoked.");  
 }
  }  
class TestBus {     
static void Main()  
{  Bus.Drive();  
}
 }
Tags : 
MVC,
Is it possible to implement an interface to a structure,
Is it possible to extend a struct,
Is it possible to inherit a class to struct,

Is it possible to implement an interface to a structure,