<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8121178714299976765</id><updated>2026-10-14T13:50:40.629-07:00</updated><category term="Ajax"/><title type='text'>A to Z</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>370</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-6663392866751355676</id><published>2015-09-16T00:25:00.002-07:00</published><updated>2015-09-16T00:25:45.549-07:00</updated><title type='text'>Insert and Update BULK XML data into SQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h5 style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14pt; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; margin: 0.5em 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Problem&lt;/h5&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
In my&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;last article, I talked about how you can use an&amp;nbsp; FTP task in SSIS to download files from an FTP server. But what if the file you have downloaded is an XML file and you need to import this data from the XML file into a SQL Server table? How do you process/parse XML data into SQL Server tables?&lt;/div&gt;
&lt;h5 style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14pt; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; margin: 0.5em 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Solution&lt;/h5&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
There are different ways to achieve this task of importing data from an XML file into a SQL Server table, but I am going to demonstrate one of easiest ways to accomplish this task.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
These are the steps I performed for importing data into SQL Server and then parsing the XML into a relational format.&lt;/div&gt;
&lt;ul style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;li&gt;Import XML data from an XML file into SQL Server table using the OPENROWSET function&lt;/li&gt;
&lt;li&gt;Parse the XML data using the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;OPENXML&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;function&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Importing XML data from XML file using OPENROWSET&lt;/h3&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
I have an XML file downloaded from my FTP location to a local folder and data in this XML file looks like this:&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img alt=&quot;Importing XML data from XML file using OPENROWSET &quot; src=&quot;https://www.mssqltips.com/tipimages2/2899_img5.jpg&quot; style=&quot;border: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Now in order to import data from the XML file to a table in SQL Server, I am using the OPENROWSET function as you can see below.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
In the script below, I am first creating a table with a column of data type XML and then reading the XML data from the file using the OPENROWSET function by specifying the file location and name of the XML file as you can see below:&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;codediv&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffffe1; border-collapse: separate; border-spacing: 5px; border: 1px solid rgb(170, 170, 170); color: black; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; overflow: auto; padding: 4px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; width: 750px; word-spacing: 0px;&quot;&gt;
&lt;pre&gt;CREATE DATABASE OPENXMLTesting
GO


USE OPENXMLTesting
GO


CREATE TABLE XMLwithOpenXML
(
Id INT IDENTITY PRIMARY KEY,
&lt;strong&gt;XMLData XML,&lt;/strong&gt;
LoadedDateTime DATETIME
)


INSERT INTO XMLwithOpenXML(XMLData, LoadedDateTime)
SELECT CONVERT(XML, BulkColumn) AS BulkColumn, GETDATE() 
FROM &lt;strong&gt;OPENROWSET&lt;/strong&gt;(BULK &#39;D:\OpenXMLTesting.xml&#39;, SINGLE_BLOB) AS x;


SELECT * FROM XMLwithOpenXML&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
When I query the table in which I have imported the XML data, it looks like this. The XMLData column is an XML data type, it will output a hyperlink as shown below:&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img alt=&quot;As XMLData column is of XML data type, it will give an hyperlink&quot; src=&quot;https://www.mssqltips.com/tipimages2/2899_img4.jpg&quot; style=&quot;border: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Clicking on the hyperlink, in the above image, will open another tab within SSMS with the XML data displayed as shown below.&lt;/div&gt;
&lt;div class=&quot;codediv&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffffe1; border-collapse: separate; border-spacing: 5px; border: 1px solid rgb(170, 170, 170); color: black; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; overflow: auto; padding: 4px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; width: 750px; word-spacing: 0px;&quot;&gt;
&lt;pre&gt;&amp;lt;ROOT&amp;gt;
&amp;lt;Customers&amp;gt;
&amp;lt;Customer CustomerID=&quot;C001&quot; CustomerName=&quot;Arshad Ali&quot;&amp;gt;
&amp;lt;Orders&amp;gt;
&amp;lt;Order OrderID=&quot;10248&quot; OrderDate=&quot;2012-07-04T00:00:00&quot;&amp;gt;
&amp;lt;OrderDetail ProductID=&quot;10&quot; Quantity=&quot;5&quot; /&amp;gt;
&amp;lt;OrderDetail ProductID=&quot;11&quot; Quantity=&quot;12&quot; /&amp;gt;
&amp;lt;OrderDetail ProductID=&quot;42&quot; Quantity=&quot;10&quot; /&amp;gt;
&amp;lt;/Order&amp;gt;
&amp;lt;/Orders&amp;gt;
&amp;lt;Address&amp;gt; Address line 1, 2, 3&amp;lt;/Address&amp;gt;
&amp;lt;/Customer&amp;gt;
&amp;lt;Customer CustomerID=&quot;C002&quot; CustomerName=&quot;Paul Henriot&quot;&amp;gt;
&amp;lt;Orders&amp;gt;
&amp;lt;Order OrderID=&quot;10245&quot; OrderDate=&quot;2011-07-04T00:00:00&quot;&amp;gt;
&amp;lt;OrderDetail ProductID=&quot;11&quot; Quantity=&quot;12&quot; /&amp;gt;
&amp;lt;OrderDetail ProductID=&quot;42&quot; Quantity=&quot;10&quot; /&amp;gt;
&amp;lt;/Order&amp;gt;
&amp;lt;/Orders&amp;gt;
&amp;lt;Address&amp;gt; Address line 5, 6, 7&amp;lt;/Address&amp;gt;
&amp;lt;/Customer&amp;gt;
&amp;lt;Customer CustomerID=&quot;C003&quot; CustomerName=&quot;Carlos Gonzlez&quot;&amp;gt;
&amp;lt;Orders&amp;gt;
&amp;lt;Order OrderID=&quot;10283&quot; OrderDate=&quot;2012-08-16T00:00:00&quot;&amp;gt;
&amp;lt;OrderDetail ProductID=&quot;72&quot; Quantity=&quot;3&quot; /&amp;gt;
&amp;lt;/Order&amp;gt;
&amp;lt;/Orders&amp;gt;
&amp;lt;Address&amp;gt; Address line 1, 4, 5&amp;lt;/Address&amp;gt;
&amp;lt;/Customer&amp;gt;
&amp;lt;/Customers&amp;gt;
&amp;lt;/ROOT&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12pt; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Process XML data using OPENXML function&lt;/h3&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Now as I said before, XML data stored in a column of data type XML can be processed either by using&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;XML functions available in SQL Server&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;or by using the&lt;strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;sp_xml_preparedocument&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;stored procedure along with the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;OPENXML&lt;/strong&gt;function.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
We will first call the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;sp_xml_preparedocument&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;stored procedure by specifying the XML data which will then output the handle of the XML data that it has prepared and stored in internal cache.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Then we will use the handle returned by the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;sp_xml_preparedocument&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;stored procedure in the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;OPENXML&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;function to open the XML data and read it.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Note: the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;sp_xml_preparedocument&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;stored procedure stores the XML data in SQL Server&#39;s internal cache, it is essential to release this stored XML data from internal cache by calling the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;sp_xml_removedocument&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;stored procedure. We should call the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;sp_xml_removedocument&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;stored procedure as early possible, so that internal cache can be freed for other usage.&lt;/div&gt;
&lt;div class=&quot;codediv&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffffe1; border-collapse: separate; border-spacing: 5px; border: 1px solid rgb(170, 170, 170); color: black; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; overflow: auto; padding: 4px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; width: 750px; word-spacing: 0px;&quot;&gt;
&lt;pre&gt;USE OPENXMLTesting
GO


DECLARE @XML AS XML, @hDoc AS INT, @SQL NVARCHAR (MAX)


SELECT @XML = XMLData FROM XMLwithOpenXML


EXEC &lt;strong&gt;sp_xml_preparedocument&lt;/strong&gt; @hDoc OUTPUT, @XML


SELECT CustomerID, CustomerName, Address
FROM &lt;strong&gt;OPENXML&lt;/strong&gt;(@hDoc, &#39;ROOT/Customers/Customer&#39;)
WITH 
(
CustomerID [varchar](50) &#39;@CustomerID&#39;,
CustomerName [varchar](100) &#39;@CustomerName&#39;,
Address [varchar](100) &#39;Address&#39;
)


EXEC &lt;strong&gt;sp_xml_removedocument&lt;/strong&gt; @hDoc
GO&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
From the above XML data, I want to retrieve all the customer information and hence I am navigating to the Customer element and querying CustomerID and CustomerName (please note the use of &quot;@&quot; before the name of the attribute) attributes and Address element in the above SELECT statement using the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;OPENXML&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;function.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The structure of the resultset can be determined with the &quot;WITH&quot; clause as shown above.&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img alt=&quot;Process XML data using OPENXML function&quot; src=&quot;https://www.mssqltips.com/tipimages2/2899_img2.gif&quot; style=&quot;border: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
From the above XML data, I now want to retrieve all the customer information along with OrderID and OrderDate placed by each individual customer and hence I am navigating to the Order element and then querying OrderID and OrderDate attributes.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
If we want to navigate back to the parent or grand parent level and get data from there, we need to use &quot;../&quot; to read the parent&#39;s data and &quot;../../&quot; to read the grand parent&#39;s data and so on.&lt;/div&gt;
&lt;div class=&quot;codediv&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffffe1; border-collapse: separate; border-spacing: 5px; border: 1px solid rgb(170, 170, 170); color: black; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; overflow: auto; padding: 4px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; width: 750px; word-spacing: 0px;&quot;&gt;
&lt;pre&gt;USE OPENXMLTesting
GO


DECLARE @XML AS XML, @hDoc AS INT, @SQL NVARCHAR (MAX)


SELECT @XML = XMLData FROM XMLwithOpenXML


EXEC sp_xml_preparedocument @hDoc OUTPUT, @XML


SELECT CustomerID, CustomerName, Address, OrderID, OrderDate
FROM OPENXML(@hDoc, &#39;ROOT/Customers/Customer/Orders/Order&#39;)
WITH 
(
CustomerID [varchar](50) &#39;../../@CustomerID&#39;,
CustomerName [varchar](100) &#39;../../@CustomerName&#39;,
Address [varchar](100) &#39;../../Address&#39;,
OrderID [varchar](1000) &#39;@OrderID&#39;,
OrderDate datetime &#39;@OrderDate&#39;
)


EXEC sp_xml_removedocument @hDoc
GO&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The result of the above query can be seen in the image below. You can see below all the customers and all the orders placed by each customer.&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img alt=&quot;querying CustomerID and CustomerName&quot; src=&quot;https://www.mssqltips.com/tipimages2/2899_img6.jpg&quot; style=&quot;border: 0px;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Now let&#39;s go one level deeper. This time from the above XML data, I want to retrieve all the customer information and their orders along with ProductID and Quantity from each order placed. And hence, as you can see below I am navigating to the OrderDetail and retrieving the ProductID and Quantity attributes&#39; values. At the same time I am using &quot;../&quot; to reach the parent level to get Order information available at the parent level whereas I am using &quot;../../../&quot; to reach to the great grand parent level to grab Customer information as shown below:&lt;/div&gt;
&lt;div class=&quot;codediv&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffffe1; border-collapse: separate; border-spacing: 5px; border: 1px solid rgb(170, 170, 170); color: black; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; overflow: auto; padding: 4px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; width: 750px; word-spacing: 0px;&quot;&gt;
&lt;pre&gt;USE OPENXMLTesting
GO


DECLARE @XML AS XML, @hDoc AS INT, @SQL NVARCHAR (MAX)


SELECT @XML = XMLData FROM XMLwithOpenXML


EXEC sp_xml_preparedocument @hDoc OUTPUT, @XML


SELECT CustomerID, CustomerName, Address, OrderID, OrderDate, ProductID, Quantity
FROM OPENXML(@hDoc, &#39;ROOT/Customers/Customer/Orders/Order/OrderDetail&#39;)
WITH 
(
CustomerID [varchar](50) &#39;../../../@CustomerID&#39;,
CustomerName [varchar](100) &#39;../../../@CustomerName&#39;,
Address [varchar](100) &#39;../../../Address&#39;,
OrderID [varchar](1000) &#39;../@OrderID&#39;,
OrderDate datetime &#39;../@OrderDate&#39;,
ProductID [varchar](50) &#39;@ProductID&#39;,
Quantity int &#39;@Quantity&#39;
)


EXEC sp_xml_removedocument @hDoc
GO&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The result of the above query can be seen in the image below. You can see all the customer information and their orders along with ProductID and Quantity from each order placed.&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img alt=&quot;The result of the above query &quot; src=&quot;https://www.mssqltips.com/tipimages2/2899_img7.jpg&quot; style=&quot;border: 0px;&quot; /&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
===============================================================&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Update Query:&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;pre style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: Consolas, Courier, monospace !important; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 17.5499992370605px; margin: 0px; orphans: auto; overflow: auto; padding: 5px; text-align: start; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; word-wrap: normal;&quot;&gt;SELECT * FROM T
UPDATE T
SET XmlCol =(
SELECT * FROM OPENROWSET(
&amp;nbsp;&amp;nbsp;&amp;nbsp;BULK &#39;C:\SampleFolder\SampleData3.txt&#39;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SINGLE_BLOB
) AS x
)
WHERE IntCol = 1;
GO&lt;/pre&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;imageborder&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; display: block; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/6663392866751355676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2015/09/insert-and-update-bulk-xml-data-into-sql.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/6663392866751355676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/6663392866751355676'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2015/09/insert-and-update-bulk-xml-data-into-sql.html' title='Insert and Update BULK XML data into SQL'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-1903423683039920610</id><published>2015-09-15T02:42:00.003-07:00</published><updated>2015-09-15T02:42:46.990-07:00</updated><title type='text'>Specification for SQL Server 2008,R2 and 2012</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; width: 100%px; word-spacing: 0px;&quot;&gt;&lt;tbody&gt;
&lt;tr valign=&quot;top&quot;&gt;&lt;td style=&quot;padding-left: 5px;&quot;&gt;&lt;div class=&quot;pageHeader&quot; style=&quot;color: #022873; font-size: 13pt; font-weight: bold;&quot;&gt;
SQL Server 2012 Maximum Capacity Specifications (32-bit Server)&lt;/div&gt;
The following tables specify the maximum sizes and numbers of various objects defined in SQL Server 2012 components, and compared against the maximum sizes and number of various objects defined in SQL Server 2008 and SQL Server 2008 R2 components.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;topicTitle&quot; style=&quot;-webkit-text-stroke-width: 0px; color: #022873; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Database Engine Objects&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The following table specifies the maximum sizes and number of various objects defined in SQL Server databases or referenced in Transact-SQL statements.&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; class=&quot;grid-background maintext&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #bfdbff; color: black; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; width: 100%px; word-spacing: 0px;&quot;&gt;&lt;tbody&gt;
&lt;tr align=&quot;center&quot; class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;&lt;td class=&quot;grid-header&quot; colspan=&quot;4&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;Maximum Sizes / Numbers SQL Server (32-bit)&lt;/td&gt;&lt;/tr&gt;
&lt;tr align=&quot;center&quot; class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server Database Engine Object&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2008&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2008 R2&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2012&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Batch size&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;65,536 * Network Packet Size&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;65,536 * Network Packet Size&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;65,536 * Network Packet Size&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Bytes per short string column&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,000&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Bytes per GROUP BY ORDER BY&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,060&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,060&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,060&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Bytes per index key&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;900&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;900&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;900&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Bytes per foreign key&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;900&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;900&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;900&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Bytes per primary key&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;900&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;900&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;900&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Bytes per row&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,060&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,060&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,060&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Bytes in source text of a stored procedure.&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Lesser of batch size or 250 MB&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Lesser of batch size or 250 MB&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Lesser of batch size or 250 MB&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Bytes per&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;VARCHAR(MAX)&lt;/b&gt;,&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;VARBINARY(MAX)&lt;/b&gt;,&lt;b&gt;XML&lt;/b&gt;,&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;TEXT&lt;/b&gt;, or&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;IMAGE&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;column&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2^31-1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2^31-1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2^31-1&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Characters per&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;NTEXT&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;or&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;NVARCHAR(MAX)&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;column&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2^30-1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2^30-1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2^30-1&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Clustered indexes per table&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns in GROUP BY, ORDER BY&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited only by number of bytes&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited only by number of bytes&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited only by number of bytes&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns or expressions in a GROUP BY WITH CUBE or WITH ROLLUP statement&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;10&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;10&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;10&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns per index key&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns per foreign key&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns per primary key&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns per nonwide table&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,024&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,024&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,024&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns per wide table&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;30,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;30,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;30,000&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns per SELECT statement&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns per INSERT statement&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Connections per client&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Maximum value of configured connections&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Maximum value of configured connections&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Maximum value of configured connections&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Database size&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;524,272 terabytes&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;524,272 terabytes&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;524,272 terabytes&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Databases per instance of SQL Server&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Filegroups per database&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Files per database&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;File size (data)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16 terabytes&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16 terabytes&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;16 terabytes&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;File size (log)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2 terabytes&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2 terabytes&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2 terabytes&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Foreign key table references per table&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;253&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;253&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;253&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Identifier length (in characters)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;128&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;128&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;128&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Instances per computer&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;50 instances on a stand-alone server for all SQL Server editions.&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;50 instances on a stand-alone server for all SQL Server editions.&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;50 instances on a stand-alone server for all SQL Server editions.&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Length of a string containing SQL statements (batch size)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;65,536 * Network packet size&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;65,536 * Network packet size&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;65,536 * Network packet size&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Locks per connection&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Maximum locks per server&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Maximum locks per server&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Maximum locks per server&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Locks per instance of SQL Server&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Up to 2,147,483,647&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Up to 2,147,483,647&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Up to 2,147,483,647&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Nested stored procedure levels&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Nested subqueries&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Nested trigger levels&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Nonclustered indexes per table&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;999&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;999&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;999&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Number of distinct expressions in the GROUP BY clause when any of the following are present: CUBE, ROLLUP, GROUPING SETS, WITH CUBE, WITH ROLLUP&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Number of grouping sets generated by operators in the GROUP BY clause&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Parameters per stored procedure&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2,100&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2,100&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2,100&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Parameters per user-defined function&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2,100&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2,100&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;2,100&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;REFERENCES per table&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;253&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;253&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;253&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Rows per table&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by available storage&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by available storage&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by available storage&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Tables per database&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by number of objects in a database&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by number of objects in a database&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by number of objects in a database&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Partitions per partitioned table or index&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;15,000&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Statistics on non-indexed columns&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;30,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;30,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;30,000&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Tables per SELECT statement&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited only by available resources&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited only by available resources&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited only by available resources&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Triggers per table&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by number of objects in a database.&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by number of objects in a database.&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by number of objects in a database.&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns per UPDATE statement (Wide Tables)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;4,096&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;User connections&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;XML Indexes&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;249&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;249&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;249&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;ins id=&quot;aswift_1_expand&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: transparent; border: none; color: black; display: inline-table; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; height: 90px; letter-spacing: normal; line-height: normal; margin: 0px; orphans: auto; padding: 0px; position: relative; text-align: start; text-indent: 0px; text-transform: none; visibility: visible; white-space: normal; widows: 1; width: 728px; word-spacing: 0px;&quot;&gt;&lt;ins id=&quot;aswift_1_anchor&quot; style=&quot;background-color: transparent; border: none; display: block; height: 90px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 728px;&quot;&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;div class=&quot;topicTitle&quot; style=&quot;-webkit-text-stroke-width: 0px; color: #022873; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
SQL Server Utility Objects&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The following table specifies the maximum sizes and number of various objects that were tested in the SQL Server Utility.&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; class=&quot;grid-background maintext&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #bfdbff; color: black; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; width: 100%px; word-spacing: 0px;&quot;&gt;&lt;tbody&gt;
&lt;tr align=&quot;center&quot; class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;&lt;td class=&quot;grid-header&quot; colspan=&quot;4&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;Maximum Sizes / Numbers SQL Server (32-bit)&lt;/td&gt;&lt;/tr&gt;
&lt;tr align=&quot;center&quot; class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server Utility Object&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2008&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2008 R2&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2012&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Computers (physical computers or virtual machines) per SQL Server Utility&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;100&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;100&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;100&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Instances of SQL Server per computer&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;5&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;5&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;5&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Total number of instances of SQL Server per SQL Server Utility&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;200&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;200&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;200&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;User databases per instance of SQL Server, including data-tier applications&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;50&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;50&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;50&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Total number of user databases per SQL Server Utility&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,000&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;File groups per database&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Data files per file group&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Log files per database&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Volumes per computer&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;3&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;3&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;3&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;topicTitle&quot; style=&quot;-webkit-text-stroke-width: 0px; color: #022873; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
SQL Server Data-Tier Application Objects&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The following table specifies the maximum sizes and number of various objects that were tested in the SQL Server data-tier applications (DAC).&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; class=&quot;grid-background maintext&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #bfdbff; color: black; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; width: 100%px; word-spacing: 0px;&quot;&gt;&lt;tbody&gt;
&lt;tr align=&quot;center&quot; class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;&lt;td class=&quot;grid-header&quot; colspan=&quot;4&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;Maximum Sizes / Numbers SQL Server (32-bit)&lt;/td&gt;&lt;/tr&gt;
&lt;tr align=&quot;center&quot; class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server DAC Object&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2008&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2008 R2&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2012&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Databases per DAC&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Objects per DAC&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by the number of objects in a database, or available memory.&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by the number of objects in a database, or available memory.&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Limited by the number of objects in a database, or available memory.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;topicTitle&quot; style=&quot;-webkit-text-stroke-width: 0px; color: #022873; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
SQL Server Replication Objects&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The following table specifies the maximum sizes and number of various objects defined in SQL Server Replication.&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; class=&quot;grid-background maintext&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #bfdbff; color: black; font-family: &#39;segoe ui&#39;, tahoma; font-size: 13.3333330154419px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; width: 100%px; word-spacing: 0px;&quot;&gt;&lt;tbody&gt;
&lt;tr align=&quot;center&quot; class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;&lt;td class=&quot;grid-header&quot; colspan=&quot;4&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;Maximum Sizes / Numbers SQL Server (32-bit)&lt;/td&gt;&lt;/tr&gt;
&lt;tr align=&quot;center&quot; class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server Replication Object&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2008&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2008 R2&lt;/td&gt;&lt;td class=&quot;grid-header&quot; style=&quot;background-color: #bfdbff; border-color: white rgb(172, 168, 153) rgb(172, 168, 153) white; border-style: solid; border-width: 1px; color: #15428b; font-size: 11pt; font-weight: bold;&quot;&gt;SQL Server 2012&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Articles (merge publication)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;256&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;256&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;256&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Articles (snapshot or transactional publication)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;32,767&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns in a table (merge publication)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;246&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;246&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;246&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns in a table (SQL Server snapshot or transactional publication)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,000&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Columns in a table (Oracle snapshot or transactional publication)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;995&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;995&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;995&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Bytes for a column used in a row filter (merge publication)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,024&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,024&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;1,024&lt;/td&gt;&lt;/tr&gt;
&lt;tr class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;&lt;td class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;Bytes for a column used in a row filter (snapshot or transactional publication)&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,000&lt;/td&gt;&lt;td align=&quot;center&quot; class=&quot;grid-row&quot; style=&quot;background-color: white; color: #333333; text-decoration: none;&quot;&gt;8,000&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/1903423683039920610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2015/09/specification-for-sql-server-2008r2-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/1903423683039920610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/1903423683039920610'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2015/09/specification-for-sql-server-2008r2-and.html' title='Specification for SQL Server 2008,R2 and 2012'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-5932721827910560615</id><published>2015-07-06T00:33:00.002-07:00</published><updated>2015-07-06T00:33:17.976-07:00</updated><title type='text'>ANROID Apps in .Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;header&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0px; orphans: auto; padding: 0px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;summary&quot; id=&quot;ctl00_description&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 30px 0px 0px;&quot;&gt;
If you love C# and want to create an Android application using that language&amp;nbsp;then you have to thank Xamarin as they created this great Cross Platform&amp;nbsp;development tool which enables developers to develop iOS and Android apps in C#&amp;nbsp;language.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;text&quot; id=&quot;contentdiv&quot; itemprop=&quot;articleBody&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0px; orphans: auto; padding: 10px 0px 0px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
If you love C# and want to create an Android application using that language then you have to thank&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Xamarin&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;as they created this great Cross Platform development tool which enables developers to develop iOS and Android apps in C# language. I tried developing before in Android but I did not like the experience in using the available IDE, as its slow and resource hungry, so I gave up. A couple of years after that I attended&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;TechEd NZ 2013&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and was introduced to this wonderful platform called Xamarin.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Xamarin is offered in different licenses from free to enterprise levels but for not I will be using the starter version which is the free version. It includes the Xamarin Studio which is great start for those who want to try out creating their first apps for Android, they also offer a Business license which lets you develop in Visual Studio so you can use that rich experience similar to developing Web Apps or Windows Apps, then they have this Enterprise which contains everything. For now lets see what the free stuff can offer, I did a simple project which I will be discussing below and it looks very promising, I love it.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/01-new-android-project.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;442&quot; src=&quot;http://www.codeproject.com/KB/android/663461/01-new-android-project.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Like what I said above we will be using the free version so we will make this simple project by using Xamarin Studio. Now I was thinking what to do, I don’t want to create the boring &quot;Hello World!&quot; demo so what I will be developing is a simple calculator which acts like a normal desk calculator. Most of the calculator projects online regardless its C#, VB.Net developed as Windows&lt;br /&gt;forms does not act like a normal desk calculator where you can continuously perform operations and deliver results through the screen, you can’t even change operations along the way, so I decided I will make this one and I accepted my own challenge.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Lets start! First you need to download Xamarin at&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://store.xamarin.com/&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;https://store.xamarin.com/&lt;/a&gt;, while installing it will ask you to download as well prerequisites but is you are a developer most or all of them are already set up in your machine.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Once its downloaded you’re ready to roll!&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Fire up Xamarin Studio and select new Solution then Android Application, give it a solution name and in this case we use &quot;Calculator&quot;.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/02-xamarin-new-project.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;390&quot; src=&quot;http://www.codeproject.com/KB/android/663461/02-xamarin-new-project.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Once all ok you will see the IDE which is like a cross between Visual Studio and Eclipse, it has intellisense and fancy text colours and highlighting.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/05-intellisense.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;234&quot; src=&quot;http://www.codeproject.com/KB/android/663461/05-intellisense.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
You will notice if you go to the Resources\layout they the UI is in a file called Main.axml which is a &quot;Hello World&quot; template.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/03-hello-world-template.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;352&quot; src=&quot;http://www.codeproject.com/KB/android/663461/03-hello-world-template.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;271&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
At this point we are more interested on the 2 files on the solution, that layout and the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;MainActivity.cs&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;where we will be doing our coding.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/04-new-project-interface.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;547&quot; src=&quot;http://www.codeproject.com/KB/android/663461/04-new-project-interface.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
First lets design you calculator, you need to go to that&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Main.axml&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and start coding, you will notice its like Windows form where you can drag and drop items from the Toolbox on the right, it will also have its property window on the bottom left.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/06-ui.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;399&quot; src=&quot;http://www.codeproject.com/KB/android/663461/06-ui.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Were not interested with the dragging and dropping part so let’s go the code behind (you can control it more), so hit that Source tab below the UI beside the content source. First thing you will notice is that it is in XML format, if you’re so used to drag and drop or HTML coding then you need a bit of learning here specially the layouts.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Common layouts used are Linear Layout, Relative Layout, List View and Grid View. To see how each of them would look like here is an illustration&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/07-linear-layout.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;200&quot; src=&quot;http://www.codeproject.com/KB/android/663461/07-linear-layout.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Linear Layout&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– you can organize objects in either horizontal or vertical rows.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/08-relative-layout.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;200&quot; src=&quot;http://www.codeproject.com/KB/android/663461/08-relative-layout.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Relative Layout&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– specify the location of child objects relative to each other. For example object A is placed on the left of object B or it can be aligned to a parent.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/09-list-view.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;200&quot; src=&quot;http://www.codeproject.com/KB/android/663461/09-list-view.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;List View&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– Displays it in a scrolling single column list.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/10-grid-view.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;200&quot; src=&quot;http://www.codeproject.com/KB/android/663461/10-grid-view.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Grid View&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– Displays it in a scrolling grid view of columns and rows.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Now lets start designing, for this project we will using a mix of Linear and Relative. Copy and Paste the code below then I will give you some explanation of what it does.&lt;/div&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain404272&quot; style=&quot;border: 0px; color: #999999; display: block; font-size: 11px; margin: 0px; padding: 0px; text-align: right; width: 700px;&quot;&gt;
&lt;span id=&quot;prehide404272&quot; style=&quot;-webkit-transition: color 0.1s linear; border: 0px; cursor: pointer; margin: 0px; padding: 0px; transition: color 0.1s linear;&quot;&gt;Hide&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span id=&quot;preShrink404272&quot; style=&quot;-webkit-transition: color 0.1s linear; border: 0px; cursor: pointer; margin: 0px; padding: 0px; transition: color 0.1s linear;&quot;&gt;Shrink&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img id=&quot;preimg404272&quot; src=&quot;http://www.codeproject.com/images/arrow-up-16.png&quot; style=&quot;-webkit-transition: opacity 0.1s linear; border: 0px; height: 16px; margin: 0px; max-width: 100%; opacity: 0.5; overflow: auto; padding: 0px; transition: opacity 0.1s linear; vertical-align: text-top; width: 16px;&quot; /&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;-webkit-transition: color 0.1s linear; border: 0px; cursor: pointer; margin: 0px; padding: 0px; transition: color 0.1s linear;&quot;&gt;Copy Code&lt;/span&gt;&lt;/div&gt;
&lt;pre id=&quot;pre404272&quot; lang=&quot;xml&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); color: black; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin-top: 0px; overflow: auto; padding: 6px; tab-size: 4; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;xml&lt;/span&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;1.0&quot;&lt;/span&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;encoding&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;utf-8&quot;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;RelativeLayout&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;xmlns:android&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;http://schemas.android.com/apk/res/android&quot;&lt;/span&gt;
    &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:orientation&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;vertical&quot;&lt;/span&gt;
    &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;fill_parent&quot;&lt;/span&gt;
    &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;fill_parent&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;EditText&lt;/span&gt;
      &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:inputType&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;number&quot;&lt;/span&gt;
      &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;fill_parent&quot;&lt;/span&gt;
      &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
      &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/resultText&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;LinearLayout&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper0&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;fill_parent&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_below&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/resultText&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:weightSum&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;1.0&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;Clear&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignParentRight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;true&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonClear&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;LinearLayout&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;LinearLayout&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper1&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;fill_parent&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_below&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper0&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:weightSum&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;1.0&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;1&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button1&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;2&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button1&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button1&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button2&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;3&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button2&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button2&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button3&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;+&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button3&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button3&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonAdd&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;LinearLayout&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;LinearLayout&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper2&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;fill_parent&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_below&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper1&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:weightSum&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;1.0&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;4&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_below&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper2&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button4&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;5&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button4&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button4&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button5&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;6&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button5&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button5&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button6&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;-&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button6&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button6&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonSubtract&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;LinearLayout&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;LinearLayout&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper3&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;fill_parent&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_below&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper2&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:weightSum&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;1.0&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;7&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_below&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper3&quot;&lt;/span&gt;
    &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button7&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;8&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button7&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button7&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button8&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;9&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button8&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button8&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button9&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;x&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button9&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button9&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonMultiply&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;LinearLayout&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;LinearLayout&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper4&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;fill_parent&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_below&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper3&quot;&lt;/span&gt;
&lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:weightSum&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;1.0&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;(-)&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_below&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button7&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonNegative&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonNegative&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonNegative&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button0&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/button0&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonNegative&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonDot&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;0dp&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_toRightOf&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonDot&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_alignTop&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonDot&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_weight&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;.25&quot;&lt;/span&gt;
        &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonDivide&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;LinearLayout&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;Button&lt;/span&gt;
      &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:text&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;
      &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_width&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;match_parent&quot;&lt;/span&gt;
      &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_height&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;wrap_content&quot;&lt;/span&gt;
      &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:layout_below&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/wrapper4&quot;&lt;/span&gt;
      &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;android:id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;@+id/buttonEquals&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;RelativeLayout&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Most of the objects are created similar to an HTML tags like and &amp;lt;EditText&amp;gt;. Also like HTML Tags they will have properties and the common ones we used are:&lt;/div&gt;
&lt;ul style=&quot;border: 0px; margin: 10px 0px; padding: 0px 0px 0px 40px;&quot;&gt;
&lt;li style=&quot;border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;orientation&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– this sets our object orientation either vertical or horizontal.&lt;/li&gt;
&lt;li style=&quot;border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;layout_width&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– fill_parent will fill depending on the parent with, you can also specify a with by using something like 200dp. If you want to use percentage use 0dp but we will be indicating percentage on layout_weight.&lt;/li&gt;
&lt;li style=&quot;border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;layout_height&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– similar to layout_width.&lt;/li&gt;
&lt;li style=&quot;border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;layout_weight&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– this indicated the percentage you will use on the width.&lt;/li&gt;
&lt;li style=&quot;border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;id&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– identifier to the object.&lt;/li&gt;
&lt;li style=&quot;border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;layout_toRightOf&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– this indicates you will place this object to the right of what object Id.&lt;/li&gt;
&lt;li style=&quot;border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;layout_alignTop&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– this aligns your object similar to what object Id.&lt;/li&gt;
&lt;li style=&quot;border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;layout_below&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– this will place your object below the object Id.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
other elements would sound similar to .Net object properties. Now click your content tab to see how it looks. It should be something like this&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/11-ui.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;350&quot; src=&quot;http://www.codeproject.com/KB/android/663461/11-ui.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;269&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Now you have your UI, you need to start coding in C#, so go to your&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;MainActivity.cs&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
To display the layout you need to do this.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;SetContentView (Resource.Layout.Main);&lt;/code&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Then you will notice that objects are not natively available in code, you cant do something like this&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;resultText.Text = &quot;&quot;;&lt;/code&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
you need to find it like how you find objects but ID in a grid during the ASP.Net days. To do it here is a sample for button1&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;Button button1 = FindViewById&amp;lt;Button&amp;gt; (Resource.Id.button1);&lt;/code&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Now you have your button1, you can assign a delegate and define what it should do when you click&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
button1.Click += delegate {&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
//Your stuff here&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
};&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Other than that you’re good to go, everything should be easy. So for the full code just copy and paste the one below, it’s an operational calculator.&lt;/div&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain927298&quot; style=&quot;border: 0px; color: #999999; display: block; font-size: 11px; margin: 0px; padding: 0px; text-align: right; width: 700px;&quot;&gt;
&lt;span id=&quot;prehide927298&quot; style=&quot;-webkit-transition: color 0.1s linear; border: 0px; cursor: pointer; margin: 0px; padding: 0px; transition: color 0.1s linear;&quot;&gt;Hide&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span id=&quot;preShrink927298&quot; style=&quot;-webkit-transition: color 0.1s linear; border: 0px; cursor: pointer; margin: 0px; padding: 0px; transition: color 0.1s linear;&quot;&gt;Shrink&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img id=&quot;preimg927298&quot; src=&quot;http://www.codeproject.com/images/arrow-up-16.png&quot; style=&quot;-webkit-transition: opacity 0.1s linear; border: 0px; height: 16px; margin: 0px; max-width: 100%; opacity: 0.5; overflow: auto; padding: 0px; transition: opacity 0.1s linear; vertical-align: text-top; width: 16px;&quot; /&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;-webkit-transition: color 0.1s linear; border: 0px; cursor: pointer; margin: 0px; padding: 0px; transition: color 0.1s linear;&quot;&gt;Copy Code&lt;/span&gt;&lt;/div&gt;
&lt;pre id=&quot;pre927298&quot; lang=&quot;xml&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); color: black; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin-top: 0px; overflow: auto; padding: 6px; tab-size: 4; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace SampleAndroidApp
{
    [Activity(Label = &quot;Ray&#39;s Calculator&quot;, MainLauncher = true)]
    public class MainActivity : Activity
    {
        private enum Operation { Addition, Subtraction, Division, Multiplication };
        private enum LastKeyInput { Digit, Operator, Equal, DecimalPoint, Sign }

        decimal? digitMemory = null;
        decimal? totalMemory = null;

        Operation? operationMemory = null;

        LastKeyInput? lastKeyInput = LastKeyInput.Digit;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the &quot;main&quot; layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button1 = FindViewById(Resource.Id.button1);
            Button button2 = FindViewById(Resource.Id.button2);
            Button button3 = FindViewById(Resource.Id.button3);
            Button button4 = FindViewById(Resource.Id.button4);
            Button button5 = FindViewById(Resource.Id.button5);
            Button button6 = FindViewById(Resource.Id.button6);
            Button button7 = FindViewById(Resource.Id.button7);
            Button button8 = FindViewById(Resource.Id.button8);
            Button button9 = FindViewById(Resource.Id.button9);
            Button button0 = FindViewById(Resource.Id.button0);
            Button buttonDot = FindViewById(Resource.Id.buttonDot);
            Button buttonNegative = FindViewById(Resource.Id.buttonNegative);

            EditText resultText = FindViewById(Resource.Id.resultText);

            Button buttonAdd = FindViewById(Resource.Id.buttonAdd);
            Button buttonSubtract = FindViewById(Resource.Id.buttonSubtract);
            Button buttonMultiply = FindViewById(Resource.Id.buttonMultiply);
            Button buttonDivide = FindViewById(Resource.Id.buttonDivide);
            Button buttonEquals = FindViewById(Resource.Id.buttonEquals);
            Button buttonClear = FindViewById(Resource.Id.buttonClear);

            buttonNegative.Click += delegate
            {
                //handles if negative sign is the first input after calculation
                if (lastKeyInput != LastKeyInput.Digit &amp;amp;&amp;amp; lastKeyInput != LastKeyInput.DecimalPoint &amp;amp;&amp;amp; lastKeyInput != LastKeyInput.Sign)
                {
                    resultText.Text = &quot;-&quot;;
                    lastKeyInput = LastKeyInput.Sign;
                    return;
                }
                //handles multiple negative sign
                if (!resultText.Text.Contains(&quot;-&quot;))
                {
                    resultText.Text = &quot;-&quot; + digitMemory.ToString();
                    lastKeyInput = LastKeyInput.Sign;
                }

            };
            buttonDot.Click += delegate
            {
                //handles if decimal point is the first input after calculation
                if (lastKeyInput != LastKeyInput.Digit &amp;amp;&amp;amp; lastKeyInput != LastKeyInput.DecimalPoint &amp;amp;&amp;amp; lastKeyInput != LastKeyInput.Sign)
                {
                    resultText.Text = &quot;.&quot;;
                    lastKeyInput = LastKeyInput.DecimalPoint;
                    return;
                }
                //handles multiple decimal point
                if (!resultText.Text.Contains(&quot;.&quot;))
                {
                    resultText.Text = digitMemory.ToString() + &quot;.&quot;;
                    lastKeyInput = LastKeyInput.DecimalPoint;
                }

            };
            button1.Click += delegate
            {
                //Renders Text on Screen
                RenderCurrentValue(resultText.Text, &quot;1&quot;);
                resultText.Text = digitMemory.ToString();

                //Perform calculation based on current operator
                Calculate();
                lastKeyInput = LastKeyInput.Digit;
            };

            button2.Click += delegate
            {
                RenderCurrentValue(resultText.Text, &quot;2&quot;);
                resultText.Text = digitMemory.ToString();
                Calculate();
                lastKeyInput = LastKeyInput.Digit;
            };

            button3.Click += delegate
            {
                RenderCurrentValue(resultText.Text, &quot;3&quot;);
                resultText.Text = digitMemory.ToString();
                Calculate();
                lastKeyInput = LastKeyInput.Digit;
            };

            button4.Click += delegate
            {
                RenderCurrentValue(resultText.Text, &quot;4&quot;);
                resultText.Text = digitMemory.ToString();
                Calculate();
                lastKeyInput = LastKeyInput.Digit;
            };

            button5.Click += delegate
            {
                RenderCurrentValue(resultText.Text, &quot;5&quot;);
                resultText.Text = digitMemory.ToString();
                Calculate();
                lastKeyInput = LastKeyInput.Digit;
            };

            button6.Click += delegate
            {
                RenderCurrentValue(resultText.Text, &quot;6&quot;);
                resultText.Text = digitMemory.ToString();
                Calculate();
                lastKeyInput = LastKeyInput.Digit;
            };

            button7.Click += delegate
            {
                RenderCurrentValue(resultText.Text, &quot;7&quot;);
                resultText.Text = digitMemory.ToString();
                Calculate();
                lastKeyInput = LastKeyInput.Digit;
            };

            button8.Click += delegate
            {
                RenderCurrentValue(resultText.Text, &quot;8&quot;);
                resultText.Text = digitMemory.ToString();
                Calculate();
                lastKeyInput = LastKeyInput.Digit;
            };

            button9.Click += delegate
            {
                RenderCurrentValue(resultText.Text, &quot;9&quot;);
                resultText.Text = digitMemory.ToString();
                Calculate();
                lastKeyInput = LastKeyInput.Digit;
            };

            button0.Click += delegate
            {
                RenderCurrentValue(resultText.Text, &quot;0&quot;);
                resultText.Text = digitMemory.ToString();
                Calculate();
                lastKeyInput = LastKeyInput.Digit;
            };

            buttonClear.Click += delegate
            {
                resultText.Text = &quot;&quot;;
                ResetMemory();
            };

            buttonAdd.Click += delegate
            {
                if (lastKeyInput == LastKeyInput.Digit || lastKeyInput == LastKeyInput.Operator)
                {
                    operationMemory = Operation.Addition;
                }
                resultText.Text = totalMemory.ToString();
                lastKeyInput = LastKeyInput.Operator;
            };

            buttonSubtract.Click += delegate
            {
                if (lastKeyInput == LastKeyInput.Digit || lastKeyInput == LastKeyInput.Operator)
                {
                    operationMemory = Operation.Subtraction;
                }
                resultText.Text = totalMemory.ToString();
                lastKeyInput = LastKeyInput.Operator;
            };

            buttonMultiply.Click += delegate
            {
                if (lastKeyInput == LastKeyInput.Digit || lastKeyInput == LastKeyInput.Operator)
                {
                    operationMemory = Operation.Multiplication;
                }
                resultText.Text = totalMemory.ToString();
                lastKeyInput = LastKeyInput.Operator;
            };

            buttonDivide.Click += delegate
            {
                if (lastKeyInput == LastKeyInput.Digit || lastKeyInput == LastKeyInput.Operator)
                {
                    operationMemory = Operation.Division;
                }
                resultText.Text = totalMemory.ToString();
                lastKeyInput = LastKeyInput.Operator;
            };

            buttonEquals.Click += delegate
            {
                lastKeyInput = LastKeyInput.Equal;
                resultText.Text = totalMemory.ToString();
                ResetMemory();
            };

        }

        private void Calculate()
        {
            if (operationMemory != null)
            {
                switch (operationMemory)
                {
                    case Operation.Addition:
                        if (totalMemory == null)
                        {
                            //Handles first entry
                            totalMemory = digitMemory;
                        }
                        else
                        {
                            totalMemory = totalMemory + digitMemory;
                        }
                        lastKeyInput = LastKeyInput.Operator;
                        break;

                    case Operation.Subtraction:
                        if (totalMemory == null)
                        {
                            //Handles first entry
                            totalMemory = digitMemory;
                        }
                        else
                        {
                            totalMemory = totalMemory - digitMemory;
                        }
                        lastKeyInput = LastKeyInput.Operator;
                        break;

                    case Operation.Multiplication:
                        if (totalMemory == null)
                        {
                            //Handles first entry
                            totalMemory = digitMemory;
                        }
                        else
                        {
                            totalMemory = totalMemory * digitMemory;
                        }
                        lastKeyInput = LastKeyInput.Operator;
                        break;

                    case Operation.Division:
                        if (totalMemory == null)
                        {
                            //Handles first entry
                            totalMemory = digitMemory;
                        }
                        else
                        {
                            totalMemory = totalMemory / digitMemory;
                        }
                        lastKeyInput = LastKeyInput.Operator;
                        break;
                }
            }
            else
            {

                totalMemory = digitMemory;

            }
        }

        private void RenderCurrentValue(string currentRenderedValue, string character)
        {
            //display multiple digits
            if (lastKeyInput == LastKeyInput.Digit || lastKeyInput == LastKeyInput.DecimalPoint || lastKeyInput == LastKeyInput.Sign)
            {
                digitMemory = decimal.Parse(currentRenderedValue + character);
            }
            else
            {
                digitMemory = decimal.Parse(character);
            }
        }

        private void ResetMemory()
        {
            totalMemory = null;
            digitMemory = null;
            operationMemory = null;
            lastKeyInput = LastKeyInput.Digit;
        }
    }

}&lt;/pre&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Just a side note : You might notice Calculate happens on each digit press, this makes sure you have a running total even before you hit the operator. The operator buttons will just store the current operator needed for your next digit press.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Other than that you are now all good to go, just hit run&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/12-run.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;359&quot; src=&quot;http://www.codeproject.com/KB/android/663461/12-run.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
It will now ask you for a device, if you don’t have an emulator yet then you can create one, choose create emulator then hit OK.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/13-emulator.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;345&quot; src=&quot;http://www.codeproject.com/KB/android/663461/13-emulator.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;411&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Click New&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/14-new-emulator1.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;457&quot; src=&quot;http://www.codeproject.com/KB/android/663461/14-new-emulator1.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Then I suggest create something similar to a device you have, so you can play around with it on your device.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/15-define.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;692&quot; src=&quot;http://www.codeproject.com/KB/android/663461/15-define.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;414&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Once created hit start, then launch&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/16-start.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;456&quot; src=&quot;http://www.codeproject.com/KB/android/663461/16-start.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
You will now see it will start, and it will also show you any errors it encounter.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/17-starting.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;300&quot; src=&quot;http://www.codeproject.com/KB/android/663461/17-starting.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;450&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Once started go back to Xamarin and choose the device you want your app to run on, in this case your newly created emulator, it will then be automatically deployed on the emulator.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/18-select-device.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;345&quot; src=&quot;http://www.codeproject.com/KB/android/663461/18-select-device.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;411&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
You will then see the progress on the middle top part of the IDE.&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/19-middle-message-box.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;48&quot; src=&quot;http://www.codeproject.com/KB/android/663461/19-middle-message-box.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;630&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
Then on your emulator&lt;/div&gt;
&lt;div style=&quot;color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; line-height: normal;&quot;&gt;
&lt;a href=&quot;http://anyrest.files.wordpress.com/2013/09/20-final-product.jpg&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img height=&quot;1035&quot; src=&quot;http://www.codeproject.com/KB/android/663461/20-final-product.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;577&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/5932721827910560615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2015/07/anroid-apps-in-net.html#comment-form' title='47 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/5932721827910560615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/5932721827910560615'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2015/07/anroid-apps-in-net.html' title='ANROID Apps in .Net'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>47</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-7089276463934074748</id><published>2015-07-06T00:28:00.004-07:00</published><updated>2015-07-06T00:28:52.231-07:00</updated><title type='text'>LINQ Joins</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;firstpara&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 10px 0px 5px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
There are&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Different Types of SQL Joins&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;which are used to query data from more than one tables. In this article, I would like to share how joins work in LINQ. LINQ has a JOIN query operator that provide SQL JOIN like behavior and syntax. Let&#39;s see how JOIN query operator works for joins. This article will explore the SQL Joins with C# LINQ.&lt;/div&gt;
&lt;ol class=&quot;orderlist&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 22px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; list-style-type: decimal-leading-zero; margin-bottom: 10px; margin-left: 2px; margin-top: 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;box-sizing: border-box; padding: 5px 0px; text-align: justify;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; font-size: 14px; font-weight: normal; margin: 0px; padding: 0px; vertical-align: top;&quot;&gt;
INNER JOIN&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; padding: 5px 0px; text-align: justify;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; font-size: 14px; font-weight: normal; margin: 0px; padding: 0px; vertical-align: top;&quot;&gt;
LEFT OUTER JOIN&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; padding: 5px 0px; text-align: justify;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; font-size: 14px; font-weight: normal; margin: 0px; padding: 0px; vertical-align: top;&quot;&gt;
CROSS JOIN&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; padding: 5px 0px; text-align: justify;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; font-size: 14px; font-weight: normal; margin: 0px; padding: 0px; vertical-align: top;&quot;&gt;
GROUP JOIN&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/LinqJoin.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/crossjoinimg.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The JOIN query operator compares the specified properties/keys of two collections for equality by using the EQUALS keyword. By default, all joins queries written by the JOIN keyword are treated as equijoins.&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #4466c5; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
LINQ PAD for running and debugging LINQ Query&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
I am a big fan of LINQ Pad since it allow us to run LINQ to SQL and LINQ to Entity Framework query and gives the query output. Whenever, I need to write LINQ to SQL and LINQ to Entity Framework query then, I prefer to write and run query on LINQ PAD. By using LINQ PAD, you can test and run your desired LINQ query and avoid the head-ache for testing LINQ query with in Visual Studio. You can download the LINQ Pad script used in this article by&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;link&quot; href=&quot;https://www.box.com/s/sd0zuf820ililmy0rdf4&quot; style=&quot;-webkit-transition: all 250ms linear 0s; box-sizing: border-box; color: #3171b0; text-align: left; text-decoration: none; text-shadow: rgb(255, 255, 255) 1px 1px 0px; transition: all 250ms linear 0s;&quot; target=&quot;_blank&quot;&gt;using this link&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
In this article, I am using LINQ PAD for query data from database. It is simple and useful. For more help about&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;link&quot; href=&quot;http://www.linqpad.net/&quot; style=&quot;-webkit-transition: all 250ms linear 0s; box-sizing: border-box; color: #3171b0; text-align: left; text-decoration: none; text-shadow: rgb(255, 255, 255) 1px 1px 0px; transition: all 250ms linear 0s;&quot; target=&quot;_blank&quot;&gt;LINQ PAD refer the link&lt;/a&gt;. You can download the database script used in this article by&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;link&quot; href=&quot;https://www.box.com/s/23nvakall8iska093hyv&quot; style=&quot;-webkit-transition: all 250ms linear 0s; box-sizing: border-box; color: #3171b0; text-align: left; text-decoration: none; text-shadow: rgb(255, 255, 255) 1px 1px 0px; transition: all 250ms linear 0s;&quot; target=&quot;_blank&quot;&gt;using this link&lt;/a&gt;. Suppose we following three tables and data in these three tables is shown in figure.&lt;/div&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/tbljoins.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #4466c5; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
INNER JOIN&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Inner join returns only those records or rows that match or exists in both the tables.&lt;/div&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
C# Code&lt;/h3&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-family: monospace, monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; overflow: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; widows: 1; width: 730px; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; list-style-type: decimal-leading-zero; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; var q&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;from pd in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblProducts join od in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblOrders on pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; equals od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; orderby od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;OrderID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; select &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;OrderID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;UnitPrice&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Quantity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Price&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ToList&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
LINQ Pad Query&lt;/h3&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/innerjoin.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/innerjoinsql.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #4466c5; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
INNER JOIN among more than two tables&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Like SQL, we can also apply join on multiple tables based on conditions as shown below.&lt;/div&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
C# Code&lt;/h3&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-family: monospace, monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; overflow: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; widows: 1; width: 730px; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; list-style-type: decimal-leading-zero; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; var q&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;from pd in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblProducts join od in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblOrders on pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; equals od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; join ct in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblCustomers on od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;CustomerID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; equals ct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;CustID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; orderby od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;OrderID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; select &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;OrderID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;UnitPrice&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Quantity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Price&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Customer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;ct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;//define anonymous type Customer&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L7&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ToList&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
LINQ Pad Query&lt;/h3&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/innerjoinmoretbl.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/innerjoinmoretblsql.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #4466c5; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
INNER JOIN On Multiple Conditions&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Sometimes, we required to apply join on multiple coditions. In this case, we need to make two anonymous types (one for left table and one for right table) by using new keyword then we compare both the anonymous types.&lt;/div&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
C# Code&lt;/h3&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-family: monospace, monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; overflow: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; widows: 1; width: 730px; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; list-style-type: decimal-leading-zero; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; var q&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;from pd in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblProducts join od in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblOrders on pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; equals od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; join ct in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblCustomers on &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;CustomerID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ContactNo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; equals &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;ct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;CustID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;ct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ContactNo&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; orderby od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;OrderID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; select &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;OrderID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;UnitPrice&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Quantity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Price&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Customer&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;ct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;//define anonymous type Customer&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L7&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ToList&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
LINQ Pad Query&lt;/h3&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/innerjoinmulcondition.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/innerjoinmulcondition1.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/innerjoinmulconditionsql.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;h4 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #e17218; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
NOTE&lt;/h4&gt;
&lt;ol class=&quot;notelist&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(225, 114, 24); border-left-style: solid; border-left-width: 2px; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin-bottom: 10px; margin-left: 2px; margin-top: 0px; orphans: auto; padding: 5px 5px 5px 35px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;box-sizing: border-box; font-size: 20px; padding: 1px 0px 1px 2px; text-align: justify;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; font-size: 14px; font-weight: normal; margin: 0px; padding: 0px 5px 0px 0px; vertical-align: top;&quot;&gt;
Always remember, both the anonymous types should have exact same number of properties with same name and datatype other wise you will get the compile time error &quot;Type inferencce failed in the call to Join&quot;.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; font-size: 20px; padding: 1px 0px 1px 2px; text-align: justify;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; font-size: 14px; font-weight: normal; margin: 0px; padding: 0px 5px 0px 0px; vertical-align: top;&quot;&gt;
Both the comparing fields should define either NULL or NOT NULL values.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; font-size: 20px; padding: 1px 0px 1px 2px; text-align: justify;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; font-size: 14px; font-weight: normal; margin: 0px; padding: 0px 5px 0px 0px; vertical-align: top;&quot;&gt;
If one of them is defined NULL and other is defined NOT NULL then we need to do typecasting of NOT NULL field to NULL data type like as above fig.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #4466c5; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
LEFT JOIN or LEFT OUTER JOIN&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
LEFT JOIN returns all records or rows from left table and from right table returns only matched records. If there are no columns matching in the right table, it returns NULL values.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
In LINQ to achieve LEFT JOIN behavior, it is mandatory to use &quot;INTO&quot; keyword and &quot;DefaultIfEmpty()&quot; method. We can apply LEFT JOIN in LINQ like as :&lt;/div&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
C# Code&lt;/h3&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-family: monospace, monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; overflow: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; widows: 1; width: 730px; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; list-style-type: decimal-leading-zero; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; var q&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;from pd in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblProducts join od in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblOrders on pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; equals od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;o t from rt in t&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;DefaultIfEmpty&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; orderby pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; select &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;//To handle null values do type casting as int?(NULL int) &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;//since OrderID is defined NOT NULL in tblOrders&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;OrderID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;?)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;rt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;OrderID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;UnitPrice&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;//no need to check for null since it is defined NULL in database&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L7&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; rt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Quantity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L8&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; rt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Price&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L9&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ToList&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
LINQ Pad Query&lt;/h3&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/leftjoin.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/leftjoinsql.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #4466c5; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
CROSS JOIN&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Cross join is a cartesian join means cartesian product of both the tables. This join does not need any condition to join two tables. This join returns records or rows that are multiplication of record number from both the tables means each row on left table will related to each row of right table.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
In LINQ to achieve CROSS JOIN behavior, there is no need to use Join clause and where clause. We will write the query as shown below.&lt;/div&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
C# Code&lt;/h3&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-family: monospace, monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; overflow: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; widows: 1; width: 730px; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; list-style-type: decimal-leading-zero; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; var q &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; from c in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Customers&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; from o in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Orders&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; select &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;CustomerID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; c&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ContactName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;OrderID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;OrderDate&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;};&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
LINQ Pad Query&lt;/h3&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/crossjoin.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/crossjoinsql.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #4466c5; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
GROUP JOIN&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Whene a join clause use an INTO expression, then it is called a group join. A group join produces a sequence of object arrays based on properties equivalence of left collection and right collection. If right collection has no matching elements with left collection then an empty array will be produced.&lt;/div&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
C# Code&lt;/h3&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-family: monospace, monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; overflow: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; widows: 1; width: 730px; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; list-style-type: decimal-leading-zero; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; var q&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;from pd in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblProducts join od in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblOrders on pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; equals od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;o t orderby pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; select &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;new&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;UnitPrice&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Order&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;t&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L7&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ToList&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
LINQ Pad Query&lt;/h3&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/gpjoin.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/gpjoinsql.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Basically, GROUP JOIN is like as INNER-EQUIJOIN except that the result sequence is organized into groups.&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #4466c5; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
GROUP JOIN As SubQuery&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
We can also use the result of a GROUP JOIN as a subquery like as:&lt;/div&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
C# Code&lt;/h3&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-family: monospace, monospace; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; overflow: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; widows: 1; width: 730px; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; list-style-type: decimal-leading-zero; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; var q&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;from pd in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblProducts join od in dataContext&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;tblOrders on pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; equals od&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;o t from rt in t &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;where&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; rt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Price&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;box-sizing: border-box; color: #007efd; margin: 0px; vertical-align: top;&quot;&gt;70000&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; orderby pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; select &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; rt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;OrderID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; pd&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;UnitPrice&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; rt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Quantity&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; rt&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Price&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;ToList&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
LINQ Pad Query&lt;/h3&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/gpjoinsubquery.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;center&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fcfcfc; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; text-align: center; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/linq/gpjoinsubquerysql.png&quot; style=&quot;-webkit-box-shadow: rgb(157, 157, 157) 0px 0px 10px; border: 0px; box-shadow: rgb(157, 157, 157) 0px 0px 10px; box-sizing: border-box; height: auto; margin: 10px; max-width: 100%; vertical-align: middle;&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/7089276463934074748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2015/07/linq-joins.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/7089276463934074748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/7089276463934074748'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2015/07/linq-joins.html' title='LINQ Joins'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-3853389799766551570</id><published>2014-08-12T02:44:00.000-07:00</published><updated>2014-08-12T02:44:24.451-07:00</updated><title type='text'>Active Directory in C#.Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;Microsoft Technet offers a script repository
 to work with AD User Accounts; however, I needed to work with .NET and I
 could not find samples for all the tasks I needed to program. I 
promised to myself that one day I would publish the code samples I found
 and created to help other developers who are working with Directory 
Services. So, I wish you a happy AD.NET programming and I hope my work 
saves you some time. The code samples I provide are written in C#.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;1. Create a connection to Active Directory&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method used to create an entry to the AD.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Replace the path, username, and password.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;DirectoryEntry&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DirectoryEntry GetDirectoryEntry()&lt;br /&gt;{&lt;br /&gt;DirectoryEntry de = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DirectoryEntry();&lt;br /&gt;de.Path = LDAP://192.168.1.1/CN=Users;DC=Yourdomain;&lt;br /&gt;de.Username = @&quot;yourdomain\sampleuser&quot;;&lt;br /&gt;de.Password = &quot;samplepassword&quot;;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; de;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;2. Create a secure connection to Active Directory&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;To
 connect to the AD, you need a user account that belongs to the domain 
you want to connect to. Most user accounts have permissions to search 
the AD; however, to modify the AD, you need a user account that is a 
member of the group of Domain Administrators (DomainAdmin). An account 
that belongs to this group has high privileges and hardcoding the user 
and password of this account in your code can compromise the security of
 the AD. I don&#39;t recommend you to create directory entries where 
usernames and passwords are hardcoded. Try to connect to the AD using a 
secure connection.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method used to create an entry to the AD using a secure connection.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Replace the path.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;DirectoryEntry&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DirectoryEntry GetDirectoryEntry()&lt;br /&gt;{&lt;br /&gt;DirectoryEntry de = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DirectoryEntry();&lt;br /&gt;de.Path = LDAP://192.168.1.1/CN=Users;DC=Yourdomain;&lt;br /&gt;de.AuthenticationType = AuthenticationTypes.Secure;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; de;&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;To
 connect to the AD using a secure connection, you need to delegate the 
permissions of a user account with DomainAdmin permissions to the thread
 that is running a program. For instance, I created an exe and I ran the
 program using the Run As command to start a program.
 I delegated the user&#39;s principal identity and culture to the current 
thread that runs the program. To delegate the principal identity and 
culture to the current thread, I used the following code:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Establish identity (principal) and culture for a thread.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; SetCultureAndIdentity()&lt;br /&gt;{&lt;br /&gt;AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);&lt;br /&gt;WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal;&lt;br /&gt;WindowsIdentity identity = (WindowsIdentity)principal.Identity;&lt;br /&gt;System.Threading.Thread.CurrentThread.CurrentCulture = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; CultureInfo(&quot;en-US&quot;);&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;3. Validate if a user exists&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method to validate if a user exists in the AD.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;UserName&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;bool&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; UserExists(&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; UserName)&lt;br /&gt;{&lt;br /&gt;DirectoryEntry de = ADHelper.GetDirectoryEntry();&lt;br /&gt;DirectorySearcher deSearch = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DirectorySearcher();&lt;br /&gt;deSearch.SearchRoot =de;&lt;br /&gt;deSearch.Filter = &quot;(&amp;amp;(objectClass=user) (cn=&quot; + UserName +&quot;))&quot;; &lt;br /&gt;SearchResultCollection results = deSearch.FindAll();&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(results.Count == 0)&lt;br /&gt;{&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;4. Set user&#39;s properties&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Helper method that sets properties for AD users.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;de&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;PropertyName&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;PropertyValue&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; SetProperty(DirectoryEntry de, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; PropertyName, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; PropertyValue)&lt;br /&gt;{&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(PropertyValue!=&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;)&lt;br /&gt;{&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;(de.Properties.Contains(PropertyName))&lt;br /&gt;{&lt;br /&gt;de.Properties[PropertyName][0]=PropertyValue; &lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;{&lt;br /&gt;de.Properties[PropertyName].Add(PropertyValue);&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;5. Set user&#39;s country&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;To
 set the country property for a user was one of the tasks that took me 
some time to figure out. After some hours of research I realized that 
you need to know the ISO 3166 Codes for countries and set three 
properties to define a user&#39;s country: c, co, and countryCode.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;// Set the co property using the name of the country.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;SetProperty(newuser,&quot;co&quot;,&quot;MEXICO&quot;);&lt;/span&gt;&lt;span style=&quot;color: green; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;// Set the c property using the two-letter country code (ISO 3166 A 2).&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;SetProperty(newuser,&quot;c&quot;,&quot;MX&quot;);&lt;/span&gt;&lt;span style=&quot;color: green; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;// Set the countryCode property using the numeric value (ISO 3166 Number) of the country.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;SetProperty(newuser,&quot;countryCode&quot;,&quot;484&quot;);&lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;6. Set user&#39;s password&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;Setting the password for a user requires some work. I will walk you through the steps I followed to set a password for a user:&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;a)
 Create or download a helper class that generates random passwords that 
comply with the strong password rules. I was short of time and couldn&#39;t 
develop one, so I downloaded the RandomPassword class created by Obviex.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;b) Create a method that consumes the RandomPassword helper class&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method that consumes a helper class library&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; to generate random passwords.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; SetSecurePassword()&lt;br /&gt;{&lt;br /&gt;RandomPassword rp = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; RandomPassword();&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; rp.Generate(8,8);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;c) Set the password property using the usr.Invoke method.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method to set a user&#39;s password&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;path&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; SetPassword(&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; path)&lt;br /&gt;{&lt;br /&gt;DirectoryEntry usr = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DirectoryEntry();&lt;br /&gt;usr.Path = path;&lt;br /&gt;usr.AuthenticationType = AuthenticationTypes.Secure;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;[] password = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;[] {SetSecurePassword()};&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; ret = usr.Invoke(&quot;SetPassword&quot;, password );&lt;br /&gt;usr.CommitChanges();&lt;br /&gt;usr.Close();&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;The &lt;strong&gt;usr.Invoke&lt;/strong&gt;
 method can be called once within the same AppDomain, otherwise your 
program will crash. If you place a call to the usr.Invoke method inside a
 for construct, the first run will be succesful, but the second one will
 crash the compiler. I created a workaround that helped me to solve this
 problem. I made a separate console application (SetPassword.exe) and I 
called and started the process programatically from the &lt;strong&gt;SetPassword&lt;/strong&gt; method.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Download the SetPassword project.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Copy the SetPassword.exe file in your application.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Call and start SetPassword.exe from your application.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method that calls and starts SetPassword.exe&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;path&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;password&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; SetPassword(&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; path, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; password)&lt;br /&gt;{&lt;br /&gt;StringBuilder args = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; StringBuilder();&lt;br /&gt;args.Append(path);&lt;br /&gt;args.Append(&quot; &quot;);&lt;br /&gt;args.Append(password);&lt;br /&gt;ProcessStartInfo startInfo = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; ProcessStartInfo(&quot;SetPassword.exe&quot;,args.ToString());&lt;br /&gt;startInfo.WindowStyle = ProcessWindowStyle.Hidden;&lt;br /&gt;Process.Start(startInfo);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;7. Enable a user account&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method to enable a user account in the AD.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;de&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; EnableAccount(DirectoryEntry de)&lt;br /&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;//UF_DONT_EXPIRE_PASSWD 0x10000&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; exp = (&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;) de.Properties[&quot;userAccountControl&quot;].Value;&lt;br /&gt;de.Properties[&quot;userAccountControl&quot;].Value = exp | 0x0001;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;de.CommitChanges();&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;//UF_ACCOUNTDISABLE 0x0002&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; val = (&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;) de.Properties[&quot;userAccountControl&quot;].Value;&lt;br /&gt;de.Properties[&quot;userAccountControl&quot;].Value = val &amp;amp; ~0x0002;&lt;br /&gt;de.CommitChanges();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;8. Add a user to a group&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method to add a user to a group&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;de&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;deUser&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;GroupName&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; AddUserToGroup(DirectoryEntry de, DirectoryEntry deUser, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; GroupName)&lt;br /&gt;{&lt;br /&gt;DirectorySearcher deSearch = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DirectorySearcher();&lt;br /&gt;deSearch.SearchRoot = de;&lt;br /&gt;deSearch.Filter = &quot;(&amp;amp;(objectClass=group) (cn=&quot; + GroupName +&quot;))&quot;; &lt;br /&gt;SearchResultCollection results = deSearch.FindAll();&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;bool&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; isGroupMember = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; (results.Count&amp;gt;0)&lt;br /&gt;{&lt;br /&gt;DirectoryEntry group = GetDirectoryEntry(results[0].Path);&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; members = group.Invoke(&quot;Members&quot;,&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; ( &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; member &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; (IEnumerable) members)&lt;br /&gt;{&lt;br /&gt;DirectoryEntry x = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DirectoryEntry(member);&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; (x.Name! = deUser.Name)&lt;br /&gt;{&lt;br /&gt;isGroupMember = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;br /&gt;isGroupMember = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;break&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; (!isGroupMember)&lt;br /&gt;{&lt;br /&gt;group.Invoke(&quot;Add&quot;, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;[] {deUser.Path.ToString()});&lt;br /&gt;}&lt;br /&gt;group.Close();&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;9. Generate a mailbox for a user in Microsoft Exchange Server&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;You
 might need to create a mailbox for a user in Microsoft Exchange Server.
 Network configuration and server architecture can add complexity to the
 process of programmatically creating mailboxes for users, but you know,
 there&#39;s always a workaround. You can invoke a script that creates 
mailboxes from a remote machine. I will walk you through the steps I 
followed to create a mailbox for a user in Microsoft Exchange Server.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;On the Domain Controller server, create the directory C:\TestRemoteMailbox.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Download the scripts MailBox.vbs and WSHControl.vbs.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Copy the script Mailbox.vbs to the directory C:\TestRemoteMailbox.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Note: Mailbox.vbs is a script that creates MailBoxes in Microsoft Exchange.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Copy the script WSHControl.vbs to your application directory.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Note: WSHControl.vbs is a script that invokes the MailBox.vbs script on a remote machine (Domain Controller)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;From your application, call and start WSHControl.vbs.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method that calls and starts a WSHControl.vbs&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;userAlias&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; GenerateMailBox(&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; userAlias)&lt;br /&gt;{&lt;br /&gt;StringBuilder mailargs = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; StringBuilder();&lt;br /&gt;mailargs.Append(&quot;WSHControl.vbs&quot;);&lt;br /&gt;mailargs.Append(&quot; &quot;);&lt;br /&gt;mailargs.Append(userAlias);&lt;br /&gt;ProcessStartInfo sInfo = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; ProcessStartInfo(&quot;Wscript.exe&quot;,mailargs.ToString());&lt;br /&gt;sInfo.WindowStyle = ProcessWindowStyle.Hidden;;&lt;br /&gt;Process.Start(sInfo);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;10. Create a user account&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method that creates a new user account&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;employeeID&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;name&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;login&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;email&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;group&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; CreateNewUser(&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; employeeID, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; name, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; login, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; email, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; group)&lt;br /&gt;{&lt;br /&gt;Catalog catalog = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Catalog();&lt;br /&gt;DirectoryEntry de = ADHelper.GetDirectoryEntry();&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; 1. Create user account&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;DirectoryEntries users = de.Children;&lt;br /&gt;DirectoryEntry newuser = users.Add(&quot;CN=&quot; + login, &quot;user&quot;);&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; 2. Set properties&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;SetProperty(newuser,&quot;employeeID&quot;, employeeID);&lt;br /&gt;SetProperty(newuser,&quot;givenname&quot;, name);&lt;br /&gt;SetProperty(newuser,&quot;SAMAccountName&quot;, login);&lt;br /&gt;SetProperty(newuser,&quot;userPrincipalName&quot;, login);&lt;br /&gt;SetProperty(newuser,&quot;mail&quot;, email);&lt;br /&gt;newuser.CommitChanges();&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; 3. Set password&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;SetPassword(newuser.Path);&lt;br /&gt;newuser.CommitChanges();&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; 4. Enable account &lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;EnableAccount(newuser);&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; 5. Add user account to groups&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;AddUserToGroup(de,newuser,group);&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; 6. Create a mailbox in Microsoft Exchange &lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;GenerateMailBox(login); &lt;br /&gt;newuser.Close();&lt;br /&gt;de.Close();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;11. Disable a user account&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method that disables a user account in the AD and hides user&#39;s email from Exchange address lists.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;EmployeeID&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DisableAccount(&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; EmployeeID)&lt;br /&gt;{&lt;br /&gt;DirectoryEntry de = GetDirectoryEntry();&lt;br /&gt;DirectorySearcher ds = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DirectorySearcher(de);&lt;br /&gt;ds.Filter = &quot;(&amp;amp;(objectCategory=Person)(objectClass=user)(employeeID=&quot; + EmployeeID + &quot;))&quot;;&lt;br /&gt;ds.SearchScope = SearchScope.Subtree;&lt;br /&gt;SearchResult results = ds.FindOne();&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(results != &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;)&lt;br /&gt;{&lt;br /&gt;DirectoryEntry dey = GetDirectoryEntry(results.Path);&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; val = (&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;)dey.Properties[&quot;userAccountControl&quot;].Value;&lt;br /&gt;dey.Properties[&quot;userAccountControl&quot;].Value = val | 0x0002;&lt;br /&gt;dey.Properties[&quot;msExchHideFromAddressLists&quot;].Value = &quot;TRUE&quot;;&lt;br /&gt;dey.CommitChanges();&lt;br /&gt;dey.Close();&lt;br /&gt;}&lt;br /&gt;de.Close();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;12. Update user account&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method that updates user&#39;s properties&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;employeeID&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;department&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;title&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;company&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; ModifyUser(&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; employeeID, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; department, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; title, &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; company)&lt;br /&gt;{&lt;br /&gt;DirectoryEntry de = GetDirectoryEntry();&lt;br /&gt;DirectorySearcher ds = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DirectorySearcher(de);&lt;br /&gt;ds.Filter = &quot;(&amp;amp;(objectCategory=Person)(objectClass=user)(employeeID=&quot; + employeeID + &quot;))&quot;;&lt;br /&gt;ds.SearchScope = SearchScope.Subtree;&lt;br /&gt;SearchResult results = ds.FindOne();&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(results!=&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;)&lt;br /&gt;{&lt;br /&gt;DirectoryEntry dey = GetDirectoryEntry(results.Path);&lt;br /&gt;SetProperty(dey, &quot;department&quot;, department);&lt;br /&gt;SetProperty(dey, &quot;title&quot;, title);&lt;br /&gt;SetProperty(dey, &quot;company&quot;, company);&lt;br /&gt;dey.CommitChanges();&lt;br /&gt;dey.Close();&lt;br /&gt;}&lt;br /&gt;de.Close();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;13. Validate if a string has a correct email pattern.&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method that validates if a string has an email pattern.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;mail&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;bool&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; IsEmail(&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; mail)&lt;br /&gt;{&lt;br /&gt;Regex mailPattern = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Regex(@&quot;\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*&quot;);&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; mailPattern.IsMatch(mail);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;14. Extract a user alias from an email account.&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method to extract the alias from an email account.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; dada una cuenta de correo electrÃ³nico&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;mailAddress&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; GetAlias(&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; mailAddress)&lt;br /&gt;{&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; (IsEmail(mailAddress))&lt;br /&gt;{&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; mailAddress.Substring(0,mailAddress.IndexOf(&quot;@&quot;));&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; &quot;&quot;;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;15. Format dates to AD date format (AAAAMMDDMMSSSS.0Z)&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method that formats a date in the required format&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; needed (AAAAMMDDMMSSSS.0Z) to compare dates in AD.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;date&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt;Date in valid format for AD&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; ToADDateString(DateTime date)&lt;br /&gt;{&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; year = date.Year.ToString();&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; month = date.Month;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; day = date.Day;&lt;br /&gt;StringBuilder sb = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; StringBuilder();&lt;br /&gt;sb.Append(year);&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; (month &amp;lt;10)&lt;br /&gt;{&lt;br /&gt;sb.Append(&quot;0&quot;);&lt;br /&gt;}&lt;br /&gt;sb.Append(month.ToString());&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; (day &amp;lt;10)&lt;br /&gt;{&lt;br /&gt;sb.Append(&quot;0&quot;);&lt;br /&gt;}&lt;br /&gt;sb.Append(day.ToString());&lt;br /&gt;sb.Append(&quot;000000.0Z&quot;);&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt; sb.ToString();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;strong&gt;16. Search users&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;When
 you use Directory Services, you can accomplish many interesting tasks 
such as searching and filtering users. The DirectorySearcher object 
allows you to query the AD. The following sample code queries the AD to 
search all the user accounts that were modified from a given date. The 
results are stored in a DataTable, so you can easily databind them.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; Method that returns a DataTable with a list of users modified from a given date.&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;///&lt;/span&gt;&lt;span style=&quot;color: green; font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: grey; font-size: x-small;&quot;&gt;&amp;lt;param name=&quot;fromdate&quot;&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DataTable GetModifiedUsers(DateTime fromdate)&lt;br /&gt;{&lt;br /&gt;DataTable dt = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DataTable();&lt;br /&gt;dt.Columns.Add(&quot;EmployeeID&quot;);&lt;br /&gt;dt.Columns.Add(&quot;Name&quot;);&lt;br /&gt;dt.Columns.Add(&quot;Email&quot;);&lt;br /&gt;DirectoryEntry de = GetDirectoryEntry();&lt;br /&gt;DirectorySearcher ds = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DirectorySearcher(de);&lt;br /&gt;StringBuilder filter = &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; StringBuilder();&lt;br /&gt;filter.Append(&quot;(&amp;amp;(objectCategory=Person)(objectClass=user)(whenChanged&amp;gt;=&quot;);&lt;br /&gt;filter.Append(date.ToADDateString());&lt;br /&gt;filter.Append(&quot;))&quot;);&lt;br /&gt;ds.Filter=filter.ToString();&lt;br /&gt;ds.SearchScope = SearchScope.Subtree;&lt;br /&gt;SearchResultCollection results= ds.FindAll();&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;(SearchResult result &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; results)&lt;br /&gt;{&lt;br /&gt;DataRow dr = dt.NewRow();&lt;br /&gt;DirectoryEntry dey = GetDirectoryEntry(result.Path);&lt;br /&gt;dr[&quot;EmployeeID&quot;] = dey.Properties[&quot;employeeID&quot;].Value;&lt;br /&gt;dr[&quot;Name&quot;] = dey.Properties[&quot;givenname&quot;].Value;&lt;br /&gt;dr[&quot;Email&quot;] = dey.Properties[&quot;mail&quot;].Value;&lt;br /&gt;dt.Rows.Add(dr);&lt;br /&gt;dey.Close();&lt;br /&gt;}&lt;br /&gt;de.Close();&lt;/span&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt; dt;&lt;br /&gt;}&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/3853389799766551570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/08/active-directory-in-cnet.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/3853389799766551570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/3853389799766551570'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/08/active-directory-in-cnet.html' title='Active Directory in C#.Net'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-2922124819217229070</id><published>2014-07-23T22:43:00.001-07:00</published><updated>2014-07-23T22:43:10.309-07:00</updated><title type='text'> jQuery 1.4  New Features you Must Know</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
jQuery 1.4 was &lt;a href=&quot;http://jquery14.com/day-01/jquery-14&quot; sl-processed=&quot;1&quot;&gt;recently released&lt;/a&gt;. This wasn&#39;t simply a maintenance release as some had speculated; there are &lt;strong&gt;many&lt;/strong&gt;
 new features, enhancements and performance improvements included in 
1.4! This post covers the new features and enhancements that you may 
find beneficial.&lt;br /&gt;
You can download jQuery 1.4 right now, here:   &lt;a href=&quot;http://code.jquery.com/jquery-1.4.js&quot; sl-processed=&quot;1&quot;&gt;http://code.jquery.com/jquery-1.4.js&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
1. Passing Attributes to jQuery(…)&lt;/h3&gt;
Pre 1.4, jQuery supported adding attributes to an element collection via the useful &quot;&lt;code&gt;attr&lt;/code&gt;&quot;
 method, which can be passed both an attribute name and value, or an 
object specifying several attributes. jQuery 1.4 adds support for 
passing an attributes object as the second argument to the jQuery 
function itself, upon element creation.&lt;br /&gt;
Let&#39;s say you need to create an anchor element with several attributes. With 1.4 it&#39;s as simple as:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_745926&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
4&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
5&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
6&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
7&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;&amp;lt;a/&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;, {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;id: &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;foo&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;,&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;href: &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;&lt;a href=&quot;http://google.com/&quot; sl-processed=&quot;1&quot;&gt;http://google.com&lt;/a&gt;&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;,&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;title: &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;Become a Googler&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;,&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;rel: &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;external&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;,&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;text: &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;Go to Google!&#39;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
You may have noticed the &quot;&lt;code&gt;text&lt;/code&gt;&quot; attribute— you&#39;ll probably be wondering what that&#39;s doing there, after all there&#39;s no &quot;&lt;code&gt;text&lt;/code&gt;&quot;
 attribute for anchors! Well, jQuery 1.4 utilises its very own methods 
when you pass certain attributes. So the &quot;text&quot; attribute specified 
above would cause jQuery to call the &quot;&lt;code&gt;.text()&lt;/code&gt;&quot; method, passing &quot;Go to Google!&quot; as its only argument.&lt;br /&gt;
A better example of this in action:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_402275&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
01&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
02&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
03&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
04&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
05&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
06&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
07&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
08&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
09&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
10&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;&amp;lt;div/&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;, {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;id: &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;foo&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;,&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;css: {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;fontWeight: 700,&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;color: &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;green&#39;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;},&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;click: &lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;(){&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;Foo has been clicked!&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
The &quot;id&quot; is added as a regular attribute, but the &quot;css&quot; and &quot;click&quot; 
properties trigger calling of each respective method. The above code, 
before the 1.4 release, would have been written like this: &lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_55968&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
4&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
5&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
6&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
7&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
8&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
9&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;&amp;lt;div/&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;)&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;.attr(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;id&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;foo&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;)&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;.css({&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;fontWeight: 700,&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;color: &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;green&#39;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;})&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;.click(&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;(){&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;Foo has been clicked!&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
2. Everything &quot;until&quot;!&lt;/h3&gt;
Three new methods have been added to the DOM traversal arsenal in 1.4, &quot;&lt;code&gt;nextUntil&lt;/code&gt;&quot;, &quot;&lt;code&gt;prevUntil&lt;/code&gt;&quot; and &quot;&lt;code&gt;parentsUntil&lt;/code&gt;&quot;.
 Each of these methods will traverse the DOM in a certain direction 
until the passed selector is satisfied. So, let&#39;s say you have a list of
 fruit:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  html&quot; id=&quot;highlighter_266934&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
4&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
5&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
6&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
7&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
8&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
9&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;ul&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Apple&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Banana&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Grape&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Strawberry&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Pear&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Peach&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
&lt;code class=&quot;html plain&quot;&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;ul&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
You want to select all of items after &quot;Apple&quot;, but you want to stop once you reach &quot;Strawberry&quot;. It couldn&#39;t be simpler:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js &quot; id=&quot;highlighter_142677&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;ul li:contains(Apple)&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).nextUntil(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;:contains(Pear)&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js comments&quot;&gt;// Selects Banana, Grape, Strawberry&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
3. Binding Multiple Event Handlers&lt;/h3&gt;
Instead of chaining a bunch of event binding methods together, you can lump them all into the same call, like so:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_89319&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
01&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
02&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
03&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
04&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
05&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
06&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
07&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
08&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
09&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
10&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
11&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&#39;&lt;/code&gt;&lt;code class=&quot;js preprocessor&quot;&gt;#foo).bind({&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;click: &lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;() {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// do something&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;},&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;mouseover: &lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;() {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// do something&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;},&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;mouseout: &lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;() {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// do something&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;})&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
This also works with &quot;&lt;code&gt;.one()&lt;/code&gt;&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
4. Per-Property Easing&lt;/h3&gt;
Instead of just defining one easing function for a single animation, 
you can now define a different easing function for each property that 
you&#39;re animating. jQuery includes two easing functions, swing (the 
default) and linear. For other ones you&#39;ll need to download them separately!&lt;br /&gt;
To specify an easing function for each property simply define the 
property as an array, with the first value being what you want to 
animate that property to, and the second being the easing function to 
use:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_477050&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
4&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;#foo&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).animate({&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;left: 500,&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;top: [500, &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;easeOutBounce&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;]&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;}, 2000);&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
You can also define per-property easing functions in the optional 
options object as property name-value pairs in the &quot;specialEasing&quot; 
object:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_562165&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
4&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
5&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
6&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
7&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
8&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
9&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;#foo&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).animate({&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;left: 500,&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;top: 500&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;}, {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;duration: 2000,&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;specialEasing: {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;top: &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;easeOutBounce&#39;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;strong&gt;Editor&#39;s Note - The author of this article, James Padolsey, is being modest. This new feature was his idea! &lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
5. New Live Events!&lt;/h3&gt;
jQuery 1.4 adds support for delegating the &quot;&lt;strong&gt;submit&lt;/strong&gt;&quot;, &quot;&lt;strong&gt;change&lt;/strong&gt;&quot;, &quot;&lt;strong&gt;focus&lt;/strong&gt;&quot; and &quot;&lt;strong&gt;blur&lt;/strong&gt;&quot; events. In jQuery, we use the &quot;&lt;code&gt;.live()&lt;/code&gt;&quot;
 method to delegate events. This is useful when you have to register 
event handlers on many elements, and when new elements may be added over
 time (using &quot;&lt;code&gt;.live()&lt;/code&gt;&quot; is less-costly than re-binding continually).&lt;br /&gt;
&lt;strong&gt;But, be careful!&lt;/strong&gt; You must use the event names, &quot;&lt;strong&gt;focusin&lt;/strong&gt;&quot; and &quot;&lt;strong&gt;focusout&lt;/strong&gt;&quot; if you want to delegate the &quot;focus&quot; and &quot;blur&quot; events!&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_288294&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;input&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).live(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;focusin&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;(){&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// do something with this&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
6. Controlling a Function&#39;s Context&lt;/h3&gt;
jQuery 1.4 provides a new &quot;&lt;code&gt;proxy&lt;/code&gt;&quot; function under the 
jQuery namespace. This function takes two arguments,&amp;nbsp;either a &quot;scope&quot; 
and a method name, or a function and the intended scope. JavaScript&#39;s 
&quot;this&quot; keyword can be quite tricky to keep a hold of. Sometimes you 
won&#39;t want it to be an element, but instead  an object that you&#39;ve 
previously created.&lt;br /&gt;
For&amp;nbsp;example, here we&#39;ve got an &quot;&lt;code&gt;app&lt;/code&gt;&quot; object which has two properties, a &quot;&lt;code&gt;clickHandler&lt;/code&gt;&quot; method and a config object:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_927035&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
4&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
5&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
6&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
7&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
8&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;js plain&quot;&gt;app = {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;config: {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;clickMessage: &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;Hi!&#39;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;},&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;clickHandler: &lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;() {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;this&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;.config.clickMessage);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;};&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
The &quot;&lt;code&gt;clickHandler&lt;/code&gt;&quot; method, when called like &quot;&lt;code&gt;app.clickHandler()&lt;/code&gt;&quot; will have &quot;&lt;code&gt;app&lt;/code&gt;&quot; as its context, meaning that the &quot;&lt;code&gt;this&lt;/code&gt;&quot; keyword will allow it access to &quot;&lt;code&gt;app&lt;/code&gt;&quot;. This works quite well&amp;nbsp;if&amp;nbsp;we simply call:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_204208&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;app.clickHandler(); &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// &quot;Hi!&quot; is alerted&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
Let&#39;s try binding it as an event handler:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_253051&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;a&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).bind(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;click&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;, app.clickHandler);&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
When we click an anchor it doesn&#39;t appear to work (nothing is 
alerted). That&#39;s because jQuery (and most sane event models) will, by 
default, set the context of the handler as the target element,- that is,
 the element that&#39;s just been clicked will be accessible via &quot;&lt;code&gt;this&lt;/code&gt;&quot;. But we don&#39;t want that, we want &quot;&lt;code&gt;this&lt;/code&gt;&quot; to be set to &quot;&lt;code&gt;app&lt;/code&gt;&quot;. Achieving this in jQuery 1.4 couldn&#39;t be simpler:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_588825&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
4&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;a&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).bind(&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;click&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;,&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;jQuery.proxy(app, &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;clickHandler&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;)&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
Now whenever an anchor is clicked, &quot;Hi!&quot; will be alerted!&lt;br /&gt;
The proxy function returns a &quot;wrapped&quot; version of your function, with &quot;&lt;code&gt;this&lt;/code&gt;&quot;
 set to whatever you specify. It&#39;s useful in other contexts too, such as
 passing callbacks to other jQuery methods, or to plugins.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
7. Delay an Animation Queue&lt;/h3&gt;
You can now add a delay to your animation queues. In&amp;nbsp;fact, this works
 on any queue, but its most common use case will probably be with the 
&quot;fx&quot; queue. This allows you to pause between animations without having 
to mess with callbacks and calls to &quot;&lt;code&gt;setTimeout&lt;/code&gt;&quot;. The first argument to &quot;&lt;code&gt;.delay()&lt;/code&gt;&quot; is the amount of milliseconds you&amp;nbsp;want to delay for.&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_17219&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
4&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;#foo&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;)&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;.slideDown() &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// Slide down&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;.delay(200) &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// Do nothing for 200 ms&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;.fadeIn(); &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// Fade in&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
If you want to delay a queue other than the&amp;nbsp;default &quot;fx&quot; queue, then 
you&#39;ll need to pass the queue name as the second argument to &quot;&lt;code&gt;.delay()&lt;/code&gt;&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
8. Check if an Element &lt;em&gt;Has&lt;/em&gt; Something&lt;/h3&gt;
jQuery 1.4 makes it easy to check if an element (or collection) &quot;&lt;code&gt;.has()&lt;/code&gt;&quot; something.&amp;nbsp;This is the programmatic equivalent   to jQuery&#39;s selector filter, &quot;&lt;code&gt;:has()&lt;/code&gt;&quot;.
 This method will select all elements in the current collection that 
contain at least one element that complies with&amp;nbsp;the passed selector.&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_480485&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;div&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).has(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;ul&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
That would select all DIV elements that contain UL elements. In this situation you&#39;d probably just use the selector filter (&quot;&lt;code&gt;:has()&lt;/code&gt;&quot;), but this method is still useful when you need to filter a collection programmatically.&lt;br /&gt;
jQuery 1.4 also reveals the &quot;&lt;code&gt;contains&lt;/code&gt;&quot; function under 
the jQuery namespace. This is a low-level function that accepts two DOM 
nodes. It&#39;ll return&amp;nbsp;a boolean indicating whether the second element is 
contained within the first element. E.g.&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_418811&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery.contains(document.documentElement, document.body);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js comments&quot;&gt;// Returns true - &amp;lt;body&amp;gt; is within &amp;lt;html&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
9. Unwrap&amp;nbsp;Elements!&lt;/h3&gt;
We&#39;ve had the &quot;&lt;code&gt;.wrap()&lt;/code&gt;&quot; method for a while now. jQuery 1.4 adds the &quot;&lt;code&gt;.unwrap()&lt;/code&gt;&quot; method which does the complete opposite. If we assume the following DOM structure:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  html&quot; id=&quot;highlighter_123720&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;p&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Foo&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;p&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;html plain&quot;&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;div&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
We can unwrap the paragraph element like so:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_279966&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;p&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).unwrap();&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
The resulting DOM structure&amp;nbsp;would be:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  html&quot; id=&quot;highlighter_620965&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;p&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Foo&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;p&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
Essentially, this method simply removes the parent of any element.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
10. Remove Elements Without Deleting Data&lt;/h3&gt;
The new &quot;&lt;code&gt;&lt;strong&gt;.detach()&lt;/strong&gt;&lt;/code&gt;&quot; method allows you to remove elements from the DOM, much like the &quot;&lt;code&gt;.remove()&lt;/code&gt;&quot;
 method. The key difference with this new method is that it doesn&#39;t 
destroy the data held by jQuery on that element. This includes data 
added via &quot;&lt;code&gt;.data()&lt;/code&gt;&quot; and any event handlers added via&amp;nbsp;jQuery&#39;s event&amp;nbsp;system.&lt;br /&gt;
This can be useful when you need to&amp;nbsp;remove an element from the DOM, 
but you know you&#39;ll need to add it back at a later stage. Its 
event&amp;nbsp;handlers and any other data will persist.&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_917240&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
01&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
02&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
03&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
04&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
05&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
06&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
07&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
08&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
09&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
10&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
11&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
12&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
13&lt;/div&gt;
&lt;div class=&quot;line number14 index13 alt1&quot;&gt;
14&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;js plain&quot;&gt;foo = jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;#foo&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js comments&quot;&gt;// Bind an important event handler&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;foo.click(&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;(){&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;Foo!&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;foo.detach(); &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// Remove it from the DOM&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
&lt;code class=&quot;js comments&quot;&gt;// … do stuff&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;foo.appendTo(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;body&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;); &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// Add it back to the DOM&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number14 index13 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;foo.click(); &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// alerts &quot;Foo!&quot;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
11. index(…) Enhancements&lt;/h3&gt;
jQuery 1.4 gives you two new ways to use the &quot;&lt;code&gt;.index()&lt;/code&gt;&quot; 
method. Previously, you could only pass an element as its argument and 
you&#39;d expect a number to be returned indicating the index of that 
element within the current collection.&lt;br /&gt;
Passing no arguments now returns the index of an element amongst its siblings. So, assuming the following DOM structure:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  html&quot; id=&quot;highlighter_518740&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
4&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
5&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
6&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
7&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
8&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
9&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;ul&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Apple&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Banana&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Grape&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Strawberry&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Pear&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&lt;code class=&quot;html spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;Peach&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;li&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
&lt;code class=&quot;html plain&quot;&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot;&gt;ul&lt;/code&gt;&lt;code class=&quot;html plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
When a list item is clicked you want to find out the index of the 
clicked element amongst all the other list items. It&#39;s as simple as:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_429307&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;li&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).click(&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;(){&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;alert( jQuery(&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;this&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).index() );&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
jQuery 1.4 also allows you to specify a selector as the first argument to &quot;&lt;code&gt;.index()&lt;/code&gt;&quot;, doing so will give you the index of the current element amongst the collection produced from that selector.&lt;br /&gt;
You should note that&amp;nbsp;what&#39;s returned from this method is an integer, 
and it will return -1 if the selector/element passed cannot be found in 
the document. &lt;br /&gt;
&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
12. DOM Manipulation Methods Accept Callbacks&lt;/h3&gt;
Most&amp;nbsp;of the DOM manipulation methods now support passing&amp;nbsp;a function as the sole argument (or second, in the case of &quot;&lt;code&gt;.css()&lt;/code&gt;&quot; &amp;amp; &quot;&lt;code&gt;.attr()&lt;/code&gt;&quot;).
 This function will be run on every element in the collection to 
determine what should be used as the real value&amp;nbsp;for that method. &lt;br /&gt;
The following methods have this capability:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;after&lt;/li&gt;
&lt;li&gt;before&lt;/li&gt;
&lt;li&gt;append&lt;/li&gt;
&lt;li&gt;prepend&lt;/li&gt;
&lt;li&gt;addClass&lt;/li&gt;
&lt;li&gt;toggleClass&lt;/li&gt;
&lt;li&gt;removeClass&lt;/li&gt;
&lt;li&gt;wrap&lt;/li&gt;
&lt;li&gt;wrapAll&lt;/li&gt;
&lt;li&gt;wrapInner&lt;/li&gt;
&lt;li&gt;val&lt;/li&gt;
&lt;li&gt;text&lt;/li&gt;
&lt;li&gt;replaceWith&lt;/li&gt;
&lt;li&gt;css&lt;/li&gt;
&lt;li&gt;attr&lt;/li&gt;
&lt;li&gt;html&lt;/li&gt;
&lt;/ul&gt;
Within the callback function, you&#39;ll have access to the current element in the collection via &quot;&lt;code&gt;this&lt;/code&gt;&quot; and its index via the first argument.&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_266493&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;li&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).html(&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;(i){&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;js string&quot;&gt;&#39;Index of this list item: &#39;&lt;/code&gt; &lt;code class=&quot;js plain&quot;&gt;+ i;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
Also, with some of the above methods you&#39;ll also get a second argument. If you&#39;re calling a setter method (like &quot;&lt;code&gt;.html()&lt;/code&gt;&quot; or &quot;&lt;code&gt;.attr(&#39;href)&lt;/code&gt;&quot;) you&#39;ll have access to the current value. E.g.&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_240016&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;a&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).attr(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;href&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;(i, currentHref){&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;js plain&quot;&gt;currentHref + &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;?foo=bar&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
As you can see, with the &quot;&lt;code&gt;.css()&lt;/code&gt;&quot; and &quot;&lt;code&gt;.attr()&lt;/code&gt;&quot;
 methods, you would pass the function as the second argument, since the 
first would be used to name the property you wish to change:&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_539670&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;li&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).css(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;color&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;(i, currentCssColor){&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;js plain&quot;&gt;i % 2 ? &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;red&#39;&lt;/code&gt; &lt;code class=&quot;js plain&quot;&gt;: &lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;blue&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
13. Determine the Type of Object&lt;/h3&gt;
jQuery 1.4 adds two new helper functions (stored directly under the 
jQuery namespace) that help you determine what type of object you&#39;re 
dealing with.&lt;br /&gt;
First, there&#39;s&amp;nbsp;&quot;&lt;code&gt;isEmptyObject&lt;/code&gt;&quot;, this function returns a boolean indicating whether or not the the passed object is empty (devoid of  properties - direct &lt;em&gt;and&lt;/em&gt; inherited). Second, there&#39;s &quot;&lt;code&gt;isPlainObject&lt;/code&gt;&quot;, which will return a boolean indicating whether&amp;nbsp;the passed object is a plain JavaScript object, that is, one created via &quot;&lt;code&gt;{}&lt;/code&gt;&quot; or &quot;&lt;code&gt;new Object()&lt;/code&gt;&quot;.&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_909865&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
4&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
5&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
6&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery.isEmptyObject({}); &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// true&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery.isEmptyObject({foo:1}); &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// false&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery.isPlainObject({}); &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// true&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery.isPlainObject(window); &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// false &lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery.isPlainObject(jQuery()); &lt;/code&gt;&lt;code class=&quot;js comments&quot;&gt;// false&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
Read more about: &lt;code&gt;isPlainObject(…)&lt;/code&gt;, &lt;code&gt;isEmptyObject(…)&lt;/code&gt;&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
14. Closest(…) Enhancements&lt;/h3&gt;
jQuery&#39;s &quot;&lt;code&gt;.closest()&lt;/code&gt;&quot; method now accepts an array of 
selectors. This is useful when you want to traverse the ancestors of an 
element, looking for (more than one) closest elements with certain 
characteristics.&lt;br /&gt;
In addition, it now accepts a context as the second argument, meaning
 that you can control just how far or how close you want the DOM 
traversed to. Both of these enhancements accommodate    rare use cases 
but they are used internally to great effect!&lt;br /&gt;
Read more about &lt;code&gt;.closest(…)&lt;/code&gt;&lt;br /&gt;
&lt;h3 class=&quot;nolinks&quot;&gt;
15. New Events! focusIn and focusOut&lt;/h3&gt;
As mentioned, to delegate the &quot;focus&quot; and &quot;blur&quot; events you must use 
these new events, called &quot;focusin&quot; and &quot;focusout&quot;. These events allow 
you to take action when&amp;nbsp;an element, or a descendant of an element, gains
 focus. &lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  js&quot; id=&quot;highlighter_762035&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
3&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
4&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
5&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
6&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
7&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;form&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;)&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;.focusin(&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;(){&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;this&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).addClass(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;focused&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;.focusout(&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;(){&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;jQuery(&lt;/code&gt;&lt;code class=&quot;js keyword&quot;&gt;this&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;).removeClass(&lt;/code&gt;&lt;code class=&quot;js string&quot;&gt;&#39;focused&#39;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;js spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;js plain&quot;&gt;});&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
You should also note that both of these events do not propagate 
(&quot;bubble&quot;); they are captured. This means that the&amp;nbsp;outermost (ancestor) 
element will be triggered before the causal &quot;target&quot; element.&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/2922124819217229070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/jquery-14-new-features-you-must-know.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/2922124819217229070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/2922124819217229070'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/jquery-14-new-features-you-must-know.html' title=' jQuery 1.4  New Features you Must Know'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-8351622315452978632</id><published>2014-07-23T06:21:00.002-07:00</published><updated>2014-07-23T06:21:53.999-07:00</updated><title type='text'>Multiple Models in a View in MVC</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;
Introduction&lt;/h2&gt;
When I was a beginner for ASP.NET MVC, I faced a question many times:
 how many ways do you know to use/pass multiple models in/to a view? At 
that time, I knew only two ways, then I learned some other ways to 
achieve the same. In this article, I will share my learning so far. Hope
 it will be helpful for others.&lt;br /&gt;
&lt;b style=&quot;color: blue;&quot;&gt;Pre-requisite:&lt;/b&gt; &lt;i style=&quot;color: #ff9900;&quot;&gt;
 you should be at intermediate level with C# and ASP.NET MVC. If you are
 absolute new to C# and ASP.NET MVC, please look for other resources to 
understand terms used here. You can put comment below article in case 
you need any detail. I will be happy to help. Thanks. &lt;/i&gt;&lt;br /&gt;
There are many ways of using multiple models in a view, most frequently used are given below:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ViewData&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ViewBag&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PartialView&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TempData&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ViewModel&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Tuple&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
All the above ways of using multiple models in view have their place 
but we need to think and pick which one fits our requirements. All 
techniques have their own advantages and disadvantages.&lt;br /&gt;
To understand the article better, please download the attached code, 
have an overview of the&amp;nbsp;code, then follow the steps given in this 
article.&lt;br /&gt;
&lt;h2&gt;
Overview of Sample Demo&lt;/h2&gt;
The attached code solution has six views demonstrating the following:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;How to pass multiple models using &lt;code&gt;ViewData&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;How to pass multiple models using &lt;code&gt;ViewBag&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;How to pass multiple models using &lt;code&gt;PartialView&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;How to pass multiple models using &lt;code&gt;TempData&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;How to pass multiple models using &lt;code&gt;ViewModel&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;How to pass multiple models using &lt;code&gt;Tuple&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
In the sample demo, all views will have similar HTML structure to get
 same layout but implementation to pass models to the view will be 
different.&lt;br /&gt;
Structure of the HTML tags is shown below only code inside the &lt;code&gt;scripts &lt;/code&gt;tag will be changed as per the scenarios.&lt;br /&gt;
&lt;img alt=&quot;HTML Layout of Views&quot; border=&quot;0&quot; height=&quot;160&quot; hspace=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/aspnet/687061/Fig01-HtmlLayout.png&quot; width=&quot;624&quot; /&gt;&lt;br /&gt;
Output of all demos will be similar to the screenshot shown below:&lt;br /&gt;
&lt;img alt=&quot;HTML Layout of Views&quot; border=&quot;0&quot; height=&quot;612&quot; hspace=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/aspnet/687061/Fig02-OutputPage.png&quot; width=&quot;640&quot; /&gt;&lt;br /&gt;
&lt;h2&gt;
Creating Basic Structure of Sample Demo&lt;/h2&gt;
Let&#39;s get started by creating a sample demo application. Follow the below steps:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Open Visual Studio 2012, select ASP.NET MVC4 Web Application template and give it project name as &lt;code&gt;MultipleModelDemo &lt;/code&gt;and click OK. If you are using Visual Studio 2013 and MVC 5, Please look into the &lt;strong&gt;&lt;em&gt; Update for VS 2013 / MVC 5&lt;/em&gt;&lt;/strong&gt; section below.

 &lt;img alt=&quot;Choose Application Template for ASP.NET MVC4&quot; border=&quot;0&quot; height=&quot;256&quot; hspace=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/aspnet/687061/Fig03-ProjectType.png&quot; width=&quot;492&quot; /&gt;&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;Select a template as Basic application then click OK. Visual Studio adds a &lt;code&gt;MultipleModelDemo &lt;/code&gt;project in solution as shown below in screenshot.
 &lt;img alt=&quot;Choose Application Template for ASP.NET MVC4&quot; border=&quot;0&quot; height=&quot;356&quot; hspace=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/aspnet/687061/Fig04-ProjectTemplate.png&quot; width=&quot;396&quot; /&gt;&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;Right click on the &lt;em&gt;Models&lt;/em&gt; folder, add a &lt;em&gt;Models.cs&lt;/em&gt; file. Now we need to add three models named as &lt;code&gt;Course&lt;/code&gt;, &lt;code&gt;Faculty &lt;/code&gt;and &lt;code&gt;Student &lt;/code&gt;by writing the following code as shown below:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain0&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre0&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; Course
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; int CourseId { get; set; }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; string CourseName { get; set; }
}

&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; Faculty
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; int FacultyId { get; set; }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; string FacultyName { get; set; }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; List&amp;lt;Course&amp;gt; AllotedCourses { get; set; }
}

&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; Student
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; int EnrollmentNo { get; set; }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; string StudentName { get; set; }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; List&amp;lt;Course&amp;gt; EnrolledCourses { get; set; }
}&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Add a class file under the &lt;em&gt;Models&lt;/em&gt; folder named as &lt;em&gt;Repository.cs&lt;/em&gt; file, which will have the implementation of methods to get hardcoded data for application in order to keep it convenient.
 Following is the code for &lt;code&gt;GetCourse &lt;/code&gt;method which will return a list of courses:&lt;br /&gt;


 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain1&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre1&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; List&amp;lt;Course&amp;gt; GetCourses()
{
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;Course&amp;gt; { 
        &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () {  CourseId = &lt;span class=&quot;code-digit&quot;&gt;1&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Chemistry&quot;&lt;/span&gt;}, 
        &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () {  CourseId = &lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Physics&quot;&lt;/span&gt;},
        &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () {  CourseId = &lt;span class=&quot;code-digit&quot;&gt;3&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Math&quot;&lt;/span&gt; },
        &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () {  CourseId = &lt;span class=&quot;code-digit&quot;&gt;4&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Computer Science&quot;&lt;/span&gt; }
    };
}           &lt;/pre&gt;
Following is the code &lt;code&gt;GetFaculties &lt;/code&gt;method which will return a list of faculties:&lt;br /&gt;


 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain2&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre2&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; List&amp;lt;Faculty&amp;gt; GetFaculties()
{
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;Faculty&amp;gt; {                 
        &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Faculty () {  FacultyId = &lt;span class=&quot;code-digit&quot;&gt;1&lt;/span&gt;, FacultyName= &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Prakash&quot;&lt;/span&gt;,
            AllotedCourses = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;Course&amp;gt; 
            {&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;1&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Chemistry&quot;&lt;/span&gt;},
                             &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Physics&quot;&lt;/span&gt;},
                             &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;3&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Math&quot;&lt;/span&gt;},
        }}, 
        &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Faculty () {  FacultyId = &lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;, FacultyName= &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Ponty&quot;&lt;/span&gt; ,
            AllotedCourses = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;Course&amp;gt; 
            {&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Physics&quot;&lt;/span&gt;},
                             &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;4&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Computer Science&quot;&lt;/span&gt;}
        }},
        &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Faculty () {  FacultyId = &lt;span class=&quot;code-digit&quot;&gt;3&lt;/span&gt;, FacultyName= &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Methu&quot;&lt;/span&gt;, 
            AllotedCourses = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;Course&amp;gt; 
            {&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;3&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Math&quot;&lt;/span&gt;},
                             &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;4&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Computer Science&quot;&lt;/span&gt;}
        }}
    };
}           &lt;/pre&gt;
Following is the code for &lt;code&gt;GetStudents &lt;/code&gt;method which will return a list of students:&lt;br /&gt;


 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain3&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre3&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; List&amp;lt;Student&amp;gt; GetStudents()
{
    List&amp;lt;Student&amp;gt; result = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;Student&amp;gt; { 
        &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Student () { EnrollmentNo = &lt;span class=&quot;code-digit&quot;&gt;1&lt;/span&gt;, StudentName= &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Jim&quot;&lt;/span&gt;, 
            EnrolledCourses = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;Course&amp;gt; 
            { &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;1&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Chemistry&quot;&lt;/span&gt;},
                              &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Physics&quot;&lt;/span&gt;},
                              &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;4&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Computer Science&quot;&lt;/span&gt;}
        }},
        
        &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Student () {  EnrollmentNo = &lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;, StudentName= &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Joli&quot;&lt;/span&gt;,
            EnrolledCourses = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;Course&amp;gt; 
            { &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Physics&quot;&lt;/span&gt;} ,
                              &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () 
                              { CourseId = &lt;span class=&quot;code-digit&quot;&gt;4&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Computer Science&quot;&lt;/span&gt;}
        }},
        
        &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Student () {  EnrollmentNo = &lt;span class=&quot;code-digit&quot;&gt;3&lt;/span&gt;, StudentName= &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Mortin&quot;&lt;/span&gt;,
            EnrolledCourses = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;Course&amp;gt;
            {  &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;3&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Math&quot;&lt;/span&gt;},
                               &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Course () { CourseId = &lt;span class=&quot;code-digit&quot;&gt;4&lt;/span&gt;, CourseName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Computer Science&quot;&lt;/span&gt;}
        }}
    };
    
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; result;
}           &lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;HomeController &lt;/code&gt;to &lt;em&gt;Controller&lt;/em&gt; folder. We will write the code in &lt;code&gt;HomeController &lt;/code&gt;later.&lt;/li&gt;
&lt;li&gt;In &lt;em&gt;Shared&lt;/em&gt; folder, we will modify the&amp;nbsp;existing code in &lt;em&gt;_Layout.cshtml&lt;/em&gt; file. First write the following code in &lt;code&gt;head &lt;/code&gt;tag:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain4&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre4&quot; lang=&quot;jscript&quot;&gt;         &amp;lt;head&amp;gt;
            &amp;lt;meta charset=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;utf-8&quot;&lt;/span&gt; /&amp;gt;
            &amp;lt;meta name=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;viewport&quot;&lt;/span&gt; content=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;width=device-width&quot;&lt;/span&gt; /&amp;gt;           

           @*Referenced  js and css files which comes &lt;span class=&quot;code-keyword&quot;&gt;with&lt;/span&gt; template*@
            &amp;lt;script src=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;~/Scripts/jquery-1.8.2.min.js&quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;link&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;~/Content/Site.css&quot;&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;rel&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;

            @*Referenced appcss file having custom CSS*@
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;link&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;~/Content/appcss/appcss.css&quot;&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;rel&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;stylesheet&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;    
        &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;           &lt;/pre&gt;
Write the following code in &lt;code&gt;body &lt;/code&gt;tag:&lt;br /&gt;


 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain5&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre5&quot; lang=&quot;jscript&quot;&gt;&amp;lt;body&amp;gt;
    @* Define the place &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; navigation links &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; left side of the page*@
    &amp;lt;div class=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;navigationPanel&quot;&lt;/span&gt;&amp;gt;
        &amp;lt;div style=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;margin: 40px 25px 2px 25px;&quot;&lt;/span&gt;&amp;gt;
            &amp;lt;h3&amp;gt;Links to Demostrations&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;h3&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;~/Home/ViewDataDemo&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;ViewData Demo&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;~/Home/ViewBagDemo&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;ViewBag Demo&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;~/Home/PartialViewDemo&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;PartialView Demo&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;~/Home/TempDataDemo&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;TempData Demo&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;~/Home/ViewModelDemo&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;ViewModel Demo&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;br&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;href&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;~/Home/TupleDemo&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;Tuple Demo&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;float: left; margin: 25px 2px 2px 80px;&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
        @RenderBody()
    &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
So far, we have created basic code which we will be using in all scenarios. Further, we will learn each scenario one by one.&lt;br /&gt;

 &lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
Passing Multiple Models using ViewData&lt;/h2&gt;
&lt;code&gt;ViewData &lt;/code&gt;is used to pass data from a controller to a view. &lt;code&gt;ViewData &lt;/code&gt;is a dictionary of objects that is a type of &lt;code&gt;ViewDataDictionary &lt;/code&gt;class. &lt;code&gt;ViewData &lt;/code&gt;is defined as property in &lt;code&gt;ControllerBase &lt;/code&gt;class. Values stored in &lt;code&gt;ViewData &lt;/code&gt;require typecasting to their &lt;code&gt;datatype &lt;/code&gt;in view. The values in &lt;code&gt;ViewData &lt;/code&gt;are accessible using a key.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;First, create a object of &lt;code&gt;Repository &lt;/code&gt;class in &lt;code&gt;HomeController&lt;/code&gt;.

 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain6&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre6&quot; lang=&quot;jscript&quot;&gt;Repository _repository = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Repository();             &lt;/pre&gt;
Add the following code in HomeController.&lt;br /&gt;


 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain7&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre7&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult ViewDataDemo()
{
    ViewData[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Courses&quot;&lt;/span&gt;] = _repository.GetCourses();
    ViewData[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Students&quot;&lt;/span&gt;] = _repository.GetStudents();
    ViewData[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Faculties&quot;&lt;/span&gt;] = _repository.GetFaculties();
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View();
}           &lt;/pre&gt;
Here &lt;code&gt;ViewDataDemo &lt;/code&gt;action method will be passing all three models to its view using &lt;code&gt;ViewData&lt;/code&gt;.&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;Add a view named as &lt;code&gt;ViewDataDemo &lt;/code&gt;and write the same code as written below in &lt;code&gt;body &lt;/code&gt;tag.
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain8&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre8&quot; lang=&quot;jscript&quot;&gt;&amp;lt;body style=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;background-color: #DBDBB7&quot;&lt;/span&gt;&amp;gt;
 &amp;lt;h3&amp;gt;Passing Multiple Models using &amp;lt;span class=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;
 specialText&quot;&lt;/span&gt;&amp;gt;  &amp;lt;i&amp;gt;ViewData &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;span&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;h3&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
     &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;sltCourseText&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
             &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;h3&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;Select a Course  &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;h3&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
             &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;select&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;sltCourse&quot;&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;sltStyle&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;Select Course &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
                @*Iterating Course model using ViewData string as a key *@
                @foreach (var item in ViewData[&quot;Courses&quot;] 
                as List &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;MultipleModelDemo.Models.Course&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;)
                {         
                     &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;@item.CourseName
                     &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;            
                }
             &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
     &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
     
 &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;facultyDetailSection&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
     &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;h4&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;Faculties who teach selected course &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;h4&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
     &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;facultyDetailTable&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
     
 &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;studentDetailSection&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
     &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;h4&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;Students who learn selected course &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;h4&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
     &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;studentDetailTable&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;        &lt;/pre&gt;
Here we are iterating &lt;code&gt;Course &lt;/code&gt;model using &lt;code&gt;ViewData &lt;/code&gt;and casting it into a &lt;code&gt;List&amp;lt;Course&amp;gt;&lt;/code&gt;.&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;Inside the &lt;code&gt;body &lt;/code&gt;tag, add a &lt;code&gt;script &lt;/code&gt;tag and write the following code. Here we would show the table only when user will select a valid course otherwise the &lt;code&gt;facultyDetailSection &lt;/code&gt;and &lt;code&gt;studentDetailSection &lt;/code&gt;should not be appearing. We are using &lt;code&gt;fadeout &lt;/code&gt;and &lt;code&gt;fadeIn &lt;/code&gt;function of jQuery for that purpose.
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain9&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre9&quot; lang=&quot;jscript&quot;&gt; &amp;lt;script&amp;gt;
        $(document).ready(&lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt;(){
            $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#facultyDetailSection&quot;&lt;/span&gt;).fadeOut(&lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;);
            $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#studentDetailSection&quot;&lt;/span&gt;).fadeOut(&lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;);
        });
        
        &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; selectedCourseName;
        
        $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#sltCourse&quot;&lt;/span&gt;).change(&lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; () {           
            selectedCourseName = $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#sltCourse&quot;&lt;/span&gt;).val().trim();
            
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (selectedCourseName === &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Select Course&quot;&lt;/span&gt;) {
                $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#facultyDetailSection&quot;&lt;/span&gt;).fadeOut();
                $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#studentDetailSection&quot;&lt;/span&gt;).fadeOut();
            }
            &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
                getFacultyTable();
                getStudentTable();
                $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#facultyDetailSection&quot;&lt;/span&gt;).fadeIn();
                $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#studentDetailSection&quot;&lt;/span&gt;).fadeIn();
            }
        });
 &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;            &lt;/pre&gt;
Here on the change event of &lt;code&gt;Course &lt;/code&gt;dropdown, we will 
read the value and confirm if there is a valid selection to display 
faculties and students. In case of a valid selection, &lt;code&gt;getFacultyTable &lt;/code&gt;and &lt;code&gt;getStudentTable &lt;/code&gt;function will be executed. Add the following functions in &lt;code&gt;script &lt;/code&gt;tag:&lt;br /&gt;


 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain10&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre10&quot; lang=&quot;jscript&quot;&gt;    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Create table to display faculty detail
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; getFacultyTable() {         
    $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#facultyDetailTable&quot;&lt;/span&gt;).empty();
    $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#facultyDetailTable&quot;&lt;/span&gt;).append(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;&amp;lt;table id=&#39;tblfaculty&#39;  
    class=&#39;tableStyle&#39;&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;th class=&#39;tableHeader&#39; style=&#39;width:60px;&#39;&amp;gt;
                                        Employee ID &amp;lt;/th&amp;gt; 
                                        &amp;lt;th class=&#39;tableHeader&#39;&amp;gt;Faculty Name 
                                        &amp;lt;/th&amp;gt; &amp;lt;/tr&amp;gt; &amp;lt;/table&amp;gt;&quot;&lt;/span&gt;);

    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Get all faculties with the help of model 
&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;(ViewData[&quot;Faculties&quot;]), and convert data into json format. 
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allFaculties = @Html.Raw(Json.Encode(ViewData[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Faculties&quot;&lt;/span&gt;]));

    &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; i = &lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;; i  &amp;lt; allFaculties.length; i++) {
        &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allotedCourses = allFaculties[i].AllotedCourses;
        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; j = &lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;; j  &amp;lt; allotedCourses.length; j++) {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(allotedCourses[j].CourseName === selectedCourseName)
                $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#tblfaculty&quot;&lt;/span&gt;).append
                (&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt; &amp;lt;tr&amp;gt; &amp;lt;td class=&#39;tableCell&#39;&amp;gt;&quot;&lt;/span&gt;  + 
                allFaculties[i].FacultyId 
                    + &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt; &amp;lt;/td&amp;gt; &amp;lt;td class=&#39;tableCell&#39;&amp;gt;&quot;&lt;/span&gt;+
                    allFaculties[i].FacultyName+&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt; &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&quot;&lt;/span&gt;);
        }
    }
}

&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Create table to display student detail
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; getStudentTable() {
    $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#studentDetailTable&quot;&lt;/span&gt;).empty();
    $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#studentDetailTable&quot;&lt;/span&gt;).append(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt; &amp;lt;table id=&#39;tblStudent&#39; 
    class=&#39;tableStyle&#39;&amp;gt; &amp;lt;tr&amp;gt; &amp;lt;th class=&#39;tableHeader&#39; style=&#39;width:60px;&#39;&amp;gt;
                                        Roll No &amp;lt;/th&amp;gt; &amp;lt;th 
                                        class=&#39;tableHeader&#39;&amp;gt;Student Name 
                                        &amp;lt;/th&amp;gt; &amp;lt;/tr&amp;gt; &amp;lt;/table&amp;gt;&quot;&lt;/span&gt;);

    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Get all students with the help of model 
&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;(ViewData[&quot;Students&quot;]), and convert data into json format. 
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allStudents = @Html.Raw(Json.Encode(ViewData[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Students&quot;&lt;/span&gt;]));

    &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; i = &lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;; i  &amp;lt; allStudents.length; i++) {
        &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; studentCourses = allStudents[i].EnrolledCourses;
        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; j = &lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;; j  &amp;lt; studentCourses.length; j++) {
            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(studentCourses[j].CourseName === selectedCourseName)                      
                $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#tblStudent&quot;&lt;/span&gt;).append(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt; &amp;lt;tr&amp;gt; 
                &amp;lt;td class=&#39;tableCell&#39;&amp;gt;&quot;&lt;/span&gt;  + allStudents[i].EnrollmentNo 
                    + &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt; &amp;lt;/td&amp;gt; &amp;lt;td  class=&#39;tableCell&#39;&amp;gt;
                    &quot;&lt;/span&gt;+allStudents[i].StudentName+&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt; &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&quot;&lt;/span&gt;);
        }
    }           
}            &lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;strong&gt;Note:&lt;/strong&gt; As we have mentioned, all view will have same layout so further demos will have almost the same code as you have written in &lt;code&gt;body &lt;/code&gt;tag of &lt;em&gt;ViewDataDemo.cshtml&lt;/em&gt; file, now in further demos we just need to modify &lt;code&gt;foreach &lt;/code&gt;function to fill data in dropdown and two lines of code in &lt;code&gt;getFacultyTable &lt;/code&gt;and &lt;code&gt;getStudentTable &lt;/code&gt;JavaScript function.&lt;br /&gt;
&lt;h2&gt;
Passing Multiple Models using ViewBag&lt;/h2&gt;
&lt;code&gt;ViewBag &lt;/code&gt;is also used to pass data from a controller to a view. It is a dynamic property which comes in &lt;code&gt;ControllerBase &lt;/code&gt;class that is why it doesn’t require typecasting for &lt;code&gt;datatype&lt;/code&gt;.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Add the following code in &lt;code&gt;HomeController&lt;/code&gt;:

 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain11&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre11&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult ViewBagDemo()
{
    ViewBag.Courses = _repository.GetCourses();
    ViewBag.Students = _repository.GetStudents();
    ViewBag.Faculties = _repository.GetFaculties();
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View();
}            &lt;/pre&gt;
Here &lt;code&gt;ViewBagDemo &lt;/code&gt;action method will be passing data to view (&lt;em&gt;ViewBagDemo.cshtml&lt;/em&gt;) file using &lt;code&gt;ViewBag&lt;/code&gt;.&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;Add a view named as &lt;code&gt;ViewBagDemo&lt;/code&gt;. All code will be same as you have written in &lt;em&gt;ViewDataDemo.cshtml&lt;/em&gt; file. Just modify input model to &lt;code&gt;foreach &lt;/code&gt;function.
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain12&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre12&quot; lang=&quot;jscript&quot;&gt;@*Iterating Course model using ViewBag *@
@foreach (&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; item &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; ViewBag.Courses)
{         
    &amp;lt;option&amp;gt;@item.CourseName&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;            
}            &lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;script &lt;/code&gt;tag, replace the following line of code in &lt;code&gt;getFacultyTable &lt;/code&gt;function:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain13&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre13&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Get all faculties with the help of model 
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; (ViewBag.Faculties), and convert data into json format.                
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allFaculties = @Html.Raw(Json.Encode(ViewBag.Faculties));&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Replace the following line of code in &lt;code&gt;getStudentTable &lt;/code&gt;function:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain14&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre14&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Get all students with the help of model(ViewBag.Students), 
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;and convert data into json format.
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allStudents = @Html.Raw(Json.Encode(ViewBag.Students));&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
Passing Multiple Models using PartialView&lt;/h2&gt;
Partial view is used where you need to share the same code (Razor and HTML code) in more than one view. For more details about &lt;code&gt;PartialView&lt;/code&gt;, please visit here.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;In Home controller, add the following code, &lt;code&gt;PartialViewDemo &lt;/code&gt;action
 method will return a view having the list of all courses only. This 
action method will not have or pass any faculty or student information 
as of now.

 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain15&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre15&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult PartialViewDemo()
{
    List&amp;lt;Course&amp;gt; allCourse = _repository.GetCourses();
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(allCourse);
}            &lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Add a view named as &lt;code&gt;PartialViewDemo&lt;/code&gt;. All HTML code will be same as you have written before. Just modify &lt;code&gt;foreach &lt;/code&gt;function.
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain16&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre16&quot; lang=&quot;jscript&quot;&gt;@*Iterating Course Model*@
@foreach(&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; item &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; Model)
{         
    &amp;lt;option&amp;gt;@item.CourseName
    &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;            
}            &lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;script &lt;/code&gt;tag, modify &lt;code&gt;getFacultyTable &lt;/code&gt;function as written below:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain17&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre17&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; getFacultyTable() {
  $.ajax({
         &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Get Faculty PartialView
&lt;/span&gt;         url: &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;/Home/FacultiesToPVDemo&quot;&lt;/span&gt;,
     type: &lt;span class=&quot;code-string&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Get&#39;&lt;/span&gt;,
     data: { courseName: selectedCourseName },
     success: &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; (data) {
        $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#facultyDetailTable&quot;&lt;/span&gt;).empty().append(data);
     },
     error: &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; () {
        alert(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;something seems wrong&quot;&lt;/span&gt;);
 }
  });
}&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Modify &lt;code&gt;getStudentTable &lt;/code&gt;function as written below:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain18&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre18&quot; lang=&quot;jscript&quot;&gt;    &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; getStudentTable() {
    $.ajax({
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Get Student PartialView
&lt;/span&gt;        url: &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;/Home/StudentsToPVDemo&quot;&lt;/span&gt;,
        type: &lt;span class=&quot;code-string&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Get&#39;&lt;/span&gt;,
        data: { courseName: selectedCourseName },
        success: &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; (data) {
            $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#studentDetailTable&quot;&lt;/span&gt;).empty().append(data);
        },
        error: &lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; () {
            alert(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;something seems wrong&quot;&lt;/span&gt;);
        }
    });
}        &lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Add a new Action method in &lt;code&gt;HomeController &lt;/code&gt;as &lt;code&gt;StudentsToPVDemo &lt;/code&gt;and add the following code in &lt;code&gt;StudentsToPVDemo &lt;/code&gt;action method.
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain19&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre19&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult StudentsToPVDemo(string courseName)
{
    IEnumerable &amp;lt;Course&amp;gt; allCourses = _repository.GetCourses();
    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; selectedCourseId = (from c &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; allCourses where 
    c.CourseName == courseName select c.CourseId).FirstOrDefault();
    
    IEnumerable &amp;lt;Student&amp;gt; allStudents = _repository.GetStudents();
    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; studentsInCourse = allStudents.Where(s =&amp;gt; 
    s.EnrolledCourses.Any(c =&amp;gt; c.CourseId == selectedCourseId)).ToList();
    
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; PartialView(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;StudentPV&quot;&lt;/span&gt;, studentsInCourse); 
}&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
 Add a &lt;code&gt;PartialView &lt;/code&gt;to the Shared folder by right clicking on &lt;code&gt;StudentsToPVDemo &lt;/code&gt;action method, give it name as &lt;code&gt;StudentPV&lt;/code&gt;. &lt;code&gt;StudentsToPVDemo &lt;/code&gt;action will return &lt;code&gt;StudentPV PartialView &lt;/code&gt;having the list of students studying in a particular course.&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;Add the following code in &lt;em&gt;StudentPV.cshtml&lt;/em&gt; file.
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain20&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre20&quot; lang=&quot;jscript&quot;&gt;@model  IEnumerable &amp;lt;MultipleModelDemo.Models.Student&amp;gt;
 &amp;lt;table id=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;tblFacultyDetail&quot;&lt;/span&gt; class=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;tableStyle&quot;&lt;/span&gt;&amp;gt;
         &amp;lt;tr&amp;gt;
         &amp;lt;th class=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;tableHeader&quot;&lt;/span&gt; style=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;width:60px;&quot;&lt;/span&gt;&amp;gt;Roll No &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;th&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;th&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;tableHeader&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;Student Name &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;th&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
    @foreach (var item in Model)
    {
          &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
             &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;td&lt;/span&gt;  &lt;span class=&quot;code-attribute&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;tableCell&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;@item.EnrollmentNo &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
             &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;tableCell&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;@item.StudentName &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
         &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
    }       
 &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Add a new action method to call &lt;code&gt;PatialView &lt;/code&gt;for faculties in &lt;code&gt;HomeController&lt;/code&gt;. Name it as &lt;code&gt;FacultiesToPVDemo &lt;/code&gt;and add the following code:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain21&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre21&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult FacultiesToPVDemo(string courseName)
{
    IEnumerable &amp;lt;Course&amp;gt; allCourses = _repository.GetCourses();
    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; selectedCourseId = (from c &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; allCourses where 
    c.CourseName == courseName select c.CourseId).FirstOrDefault();
    
    IEnumerable &amp;lt;Faculty&amp;gt; allFaculties = _repository.GetFaculties();
    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; facultiesForCourse = allFaculties.Where(f =&amp;gt; 
    f.AllotedCourses.Any(c =&amp;gt;  c.CourseId == selectedCourseId)).ToList();
    
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; PartialView(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;FacultyPV&quot;&lt;/span&gt;, facultiesForCourse);
  }            &lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;PartialView &lt;/code&gt;named as &lt;code&gt;FacultyPV &lt;/code&gt;as we did for student &lt;code&gt;PartialView&lt;/code&gt;, write the same code as you have written in &lt;em&gt;StudentPV.cshtml&lt;/em&gt; file. Just replace one line of code as:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain22&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre22&quot; lang=&quot;jscript&quot;&gt;@model  IEnumerable&amp;lt;MultipleModelDemo.Models.Faculty&amp;gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;FacultiesToPVDemo &lt;/code&gt;action will return &lt;code&gt;FacultyPV PartialView &lt;/code&gt;having the list of faculties who teach a particular course.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
Passing Multiple Models using TempData&lt;/h2&gt;
&lt;code&gt;TempData &lt;/code&gt;is a dictionary of objects that is a type of &lt;code&gt;TempDataDictionary &lt;/code&gt;class. &lt;code&gt;TempData &lt;/code&gt;is defined as property in &lt;code&gt;ControllerBase &lt;/code&gt;class. Values stored in &lt;code&gt;TempData &lt;/code&gt;require typecasting to &lt;code&gt;datatype &lt;/code&gt;in view. The values in &lt;code&gt;TempData &lt;/code&gt;are accessible using a key. It is similar to &lt;code&gt;ViewData &lt;/code&gt;but
 the difference is that it allow us to send and receive the data from 
one controller to another controller and from one action to another 
action. It’s all about possible because it internally uses session 
variables.&lt;br /&gt;
For more information about &lt;code&gt;TempData&lt;/code&gt;, please visit here. Here, we will use &lt;code&gt;TempData &lt;/code&gt;only to hold (at server side &lt;code&gt;HomeController&lt;/code&gt;) and pass (to the &lt;em&gt;TempDataDemo.cshtml&lt;/em&gt;) List of Courses.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;In home controller, add the following code:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain23&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre23&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult TempDataDemo()
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; TempData demo uses repository to get List&amp;lt;courses&amp;gt; only one time
&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; for subsequent request to get List&amp;lt;courses&amp;gt; it will use TempData
&lt;/span&gt;    TempData[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Courses&quot;&lt;/span&gt;] = _repository.GetCourses();

    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; This will keep Courses data untill next request is served
&lt;/span&gt;    TempData.Keep(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Courses&quot;&lt;/span&gt;);
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View();
}&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;TempData&lt;/code&gt;, we can pass values from one action to another action. &lt;code&gt;TempData[&quot;Courses&quot;] &lt;/code&gt;having the list of course. We will access this list in &lt;code&gt;FacultiesToTempDataDemo &lt;/code&gt;action as shown below:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain24&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre24&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult FacultiesToTempDataDemo(string courseName)
{
    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allCourses = TempData[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Courses&quot;&lt;/span&gt;] as IEnumerable &amp;lt;Course&amp;gt;;
    
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Since there are two AJAX call on TempDataPage
&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; So we keep to keep Courses data for the next one
&lt;/span&gt;    TempData.Keep(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Courses&quot;&lt;/span&gt;);
    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; selectedCourseId = (from c &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; allCourses where 
    c.CourseName == courseName select c.CourseId).FirstOrDefault();
    
    IEnumerable &amp;lt;Faculty&amp;gt; allFaculties = _repository.GetFaculties();
    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; facultiesForCourse = allFaculties.Where(f =&amp;gt; 
    f.AllotedCourses.Any(c =&amp;gt; c.CourseId == selectedCourseId)).ToList();
    
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; PartialView(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;FacultyPV&quot;&lt;/span&gt;, facultiesForCourse);
}

&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult StudentsToTempDataDemo(string courseName)
{
    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allCourses = TempData[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Courses&quot;&lt;/span&gt;] as IEnumerable &amp;lt;Course&amp;gt;;
    
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; If there is change in course again...it may cause more AJAX calls
&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; So we need to keep Courses data
&lt;/span&gt;    TempData.Keep(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Courses&quot;&lt;/span&gt;);
    
     &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; selectedCourseId = (from c &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; allCourses where 
     c.CourseName == courseName select c.CourseId).FirstOrDefault();
     
    IEnumerable &amp;lt;Student&amp;gt; allStudents = _repository.GetStudents();
    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; studentsInCourse = allStudents.Where(s =&amp;gt; 
    s.EnrolledCourses.Any(c =&amp;gt; c.CourseId == selectedCourseId)).ToList();
    
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; PartialView(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;StudentPV&quot;&lt;/span&gt;, studentsInCourse);
}            &lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Add a view by right clicking on &lt;code&gt;TempDataDemo &lt;/code&gt;action method. Write the same code as you have written in &lt;em&gt;PartialViewDemo.cshtml&lt;/em&gt;. Only one line of code needs to modify as written below:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain25&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre25&quot; lang=&quot;jscript&quot;&gt;@*Iterating Course model using TempData[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Courses&quot;&lt;/span&gt;] *@
@foreach (&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; item &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; TempData[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Courses&quot;&lt;/span&gt;] 
 as List &amp;lt;MultipleModelDemo.Models.Course&amp;gt;)
{         
    &amp;lt;option&amp;gt;@item.CourseName &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;            
}           &lt;/pre&gt;
Modify &lt;code&gt;url &lt;/code&gt;in &lt;code&gt;getFacultyTable &lt;/code&gt;and &lt;code&gt;getStudentTable &lt;/code&gt;function respectively as written below:&lt;br /&gt;


 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain26&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre26&quot; lang=&quot;jscript&quot;&gt;url: &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;/Home/FacultiesToTempDataDemo&quot;&lt;/span&gt;,
url: &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;/Home/StudentsToTempDataDemo&quot;&lt;/span&gt;,            &lt;/pre&gt;
Both Action methods &lt;code&gt;FacultiesToTempDataDemo &lt;/code&gt;and &lt;code&gt;StudentsToTempDataDemo &lt;/code&gt;will return the same &lt;code&gt;PartialView &lt;/code&gt;which we used for &lt;code&gt;PartialView &lt;/code&gt;demo.&lt;br /&gt;

 &lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
Passing Multiple Models using ViewModel&lt;/h2&gt;
&lt;code&gt;ViewModel &lt;/code&gt;is a pattern that&amp;nbsp;allow us to have multiple 
models as a single class. It contains properties of entities exactly 
need to be used in a view. &lt;code&gt;ViewModel &lt;/code&gt;should not have methods. It should be a collection of properties needed for a view.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;We have three models (classes) named as &lt;code&gt;Student&lt;/code&gt;, &lt;code&gt;Course &lt;/code&gt;and &lt;code&gt;Faculty&lt;/code&gt;. All are different models but we need to use all three models in a view. We will create a &lt;code&gt;ViewModel &lt;/code&gt;by adding a new folder called &lt;em&gt;ViewModels&lt;/em&gt; and add a class file called &lt;em&gt;ViewModelDemoVM.cs&lt;/em&gt; and write the following code as shown below:

 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain27&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre27&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; ViewModelDemoVM
{        
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; List &amp;lt;Course&amp;gt; allCourses { get; set; }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; List &amp;lt;Student&amp;gt; allStudents { get; set; }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; List &amp;lt;Faculty&amp;gt; allFaculties { get; set; }
}            &lt;/pre&gt;
&lt;strong&gt;Note:&lt;/strong&gt; As a good practice when you create any &lt;code&gt;ViewModel&lt;/code&gt;, it should have suffix as VM or &lt;code&gt;ViewModel&lt;/code&gt;.&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;In the &lt;code&gt;HomeController&lt;/code&gt;, add the following code:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain28&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre28&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult ViewModelDemo()
{
    ViewModelDemoVM vm = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ViewModelDemoVM();
    vm.allCourses = _repository.GetCourses();
    vm.allFaculties = _repository.GetFaculties();
    vm.allStudents = _repository.GetStudents();

    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(vm);
}            &lt;/pre&gt;
&lt;code&gt;ViewModelDemo &lt;/code&gt;is an action method that will return a view having &lt;code&gt;ViewModelDemoVM &lt;/code&gt;which has lists of all &lt;code&gt;Courses&lt;/code&gt;, &lt;code&gt;Faculties &lt;/code&gt;and &lt;code&gt;Students&lt;/code&gt;.&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;Right click on &lt;code&gt;ViewModelDemo &lt;/code&gt;to add a view is called &lt;code&gt;ViewModelDemo&lt;/code&gt;. &lt;em&gt;ViewModelDemo.cshtml&lt;/em&gt; view will use &lt;code&gt;ViewModelDemoVM &lt;/code&gt;as &lt;code&gt;Model &lt;/code&gt;as shown below:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain29&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre29&quot; lang=&quot;jscript&quot;&gt;@model MultipleModelDemo.ViewModel.ViewModelDemoVM            &lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Modify &lt;code&gt;foreach &lt;/code&gt;function.
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain30&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre30&quot; lang=&quot;jscript&quot;&gt;@*Iterating Course ViewModel *@
@foreach (&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; item &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; Model.allCourses)
    {         
        &amp;lt;option&amp;gt;@item.CourseName&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;            
    }            &lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Replace the following line of code in &lt;code&gt;getFacultyTable &lt;/code&gt;function:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain31&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre31&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Get all faculties with the help of viewmodel
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;(Model.allFaculties), and convert data into json format.
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allFaculties = @Html.Raw(Json.Encode(Model.allFaculties));&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Replace the following line of code in &lt;code&gt;getStudentTable &lt;/code&gt;function:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain32&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre32&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Get all students with the help of viewmodel(Model.allStudents), 
&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;and convert data into json format.
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allStudents = @Html.Raw(Json.Encode(Model.allStudents));            &lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
Passing Multiple Models using Tuple&lt;/h2&gt;
&lt;code&gt;Tuple &lt;/code&gt;is a new class introduced in .NET Framework 4.0. 
It is an ordered sequence, immutable, fixed-size collection of 
heterogeneous (allows us to group multiple kind of data types) objects.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Add the following code in Home controller.
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain33&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre33&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult TupleDemo()
{
    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allModels = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Tuple &amp;lt;List &amp;lt;Course&amp;gt;, 
    List &amp;lt;Faculty&amp;gt;,  List &amp;lt;Student&amp;gt;&amp;gt;
    (_repository.GetCourses(), _repository.GetFaculties(),  _repository.GetStudents()) { };
     &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(allModels);
}            &lt;/pre&gt;
Here, we are defining a &lt;code&gt;tuple &lt;/code&gt;which is having lists of courses, faculties and students. We are passing this &lt;code&gt;tuple &lt;/code&gt;to the &lt;code&gt;View&lt;/code&gt;.&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;View &lt;/code&gt;named as &lt;code&gt;TupleDemo&lt;/code&gt;. Write code as you have written in &lt;em&gt;ViewModelDemo.cshtml&lt;/em&gt;
 file. Just need to replace few lines of code. Replace model 
declarations as shown below. Here, we will use the namespace used to 
avoid long fully qualified class names.
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain34&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre34&quot; lang=&quot;jscript&quot;&gt;@using MultipleModelDemo.Models;
@model Tuple &amp;lt;List &amp;lt;Course&amp;gt;, List &amp;lt;Faculty&amp;gt;, List &amp;lt;Student&amp;gt;&amp;gt;            &lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Modify &lt;code&gt;foreach &lt;/code&gt;function:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain35&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre35&quot; lang=&quot;jscript&quot;&gt;@*Iterating Course model using tuple *@
@foreach (&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; item &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; Model.Item1)
    {         
         &amp;lt;option&amp;gt;@item.CourseName &lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;option&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;            
    }            &lt;/pre&gt;
Here &lt;code&gt;Model.Item1 &lt;/code&gt;is mapped to &lt;code&gt;Course &lt;/code&gt;model.&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;Inside the JavaScript function called &lt;code&gt;getFacultyTable &lt;/code&gt;replace the following line of code:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain36&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre36&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allFaculties = @Html.Raw(Json.Encode(Model.Item2));            &lt;/pre&gt;
Here &lt;code&gt;Model.Item2 &lt;/code&gt;is mapped with &lt;code&gt;Faculty &lt;/code&gt;model.&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;Inside the JavaScript function called &lt;code&gt;getStudentTable&lt;/code&gt;, replace the following line of code:
 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain37&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre37&quot; lang=&quot;jscript&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; allStudents = @Html.Raw(Json.Encode(Model.Item3));            &lt;/pre&gt;
Here &lt;code&gt;Model.Item3 &lt;/code&gt;is mapped with &lt;code&gt;Student &lt;/code&gt;model.&lt;br /&gt;

 &lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;UpdateForVS2013-MVC5&quot;&gt;&lt;/a&gt;Update for VS 2013 / MVC 5&lt;/h2&gt;
If you would like to use Visual Studio 2013 / MVC 5, Step 1 and 2 as 
given for MVC 4 would be different, So please follow the steps as given 
below and then start from steps 3 as given for MVC 4 above.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Open Visual Studio 2013, Click on &quot;New Project&quot; and select ASP.NET Web Application template and give it project name as &lt;code&gt;MultipleModelDemo &lt;/code&gt;and click OK.

 &lt;img alt=&quot;Choose Application Template for ASP.NET MVC 5&quot; border=&quot;0&quot; height=&quot;400&quot; hspace=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/aspnet/687061/VisualStudio2013-NewProject.png&quot; width=&quot;492&quot; /&gt;&lt;br /&gt;

 &lt;/li&gt;
&lt;li&gt;Select a template as MVC and make sure that all check box given in 
lower section of popup are unchecked other than MVC. Before clicking OK,
 we need to change Authentication (since for this demo we are not using 
either Authentication or Unit Tests to keep it simple and to the point).
 Please find screen shots below for the same:
 &lt;img alt=&quot;Visual Studio 2013-MVC-Tempate&quot; border=&quot;0&quot; height=&quot;400&quot; hspace=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/aspnet/687061/VisualStudio2013-MVC-Tempate.png&quot; width=&quot;492&quot; /&gt;&lt;br /&gt;

 &lt;br /&gt;
 Changing the Authentication from &quot;Individual User Account&quot; to &quot;No Authentication&quot;:
 &lt;img alt=&quot;VisualStudio2013 - No Authentication.png&quot; border=&quot;0&quot; height=&quot;400&quot; hspace=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/aspnet/687061/VisualStudio2013-NoAuthentication.png&quot; width=&quot;492&quot; /&gt;&lt;br /&gt;

 &lt;br /&gt;
 Visual Studio adds a &lt;code&gt;MultipleModelDemo &lt;/code&gt;project in solution. Now you can follow the step 3 and further as given for MVC 4.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
Conclusion&lt;/h2&gt;
&lt;br /&gt;
In this article, we learned how to use multiple models in a view. In the article &lt;em&gt;&lt;strong&gt;How to Choose the Best Way to Pass Multiple Models&lt;/strong&gt;&lt;/em&gt;,
 I have shared my findings about when and where to pick a particular way
 to use multiple models in a view. Your inputs and queries are most 
welcome. Thanks.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/8351622315452978632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/multiple-models-in-view-in-mvc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/8351622315452978632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/8351622315452978632'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/multiple-models-in-view-in-mvc.html' title='Multiple Models in a View in MVC'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-1283367666928914625</id><published>2014-07-23T06:18:00.003-07:00</published><updated>2014-07-23T06:18:37.895-07:00</updated><title type='text'>Tuples in DotNet</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
Tuples are not new to software engineering. But 
ofcource it&#39;s new to C#. C# has introduced as a Static programming 
language where tuples were applicable to dynamic programming languages. 
What&#39;s this Static and Dynamic programming languages. There are dynamic 
and static programming languages. In a dynamic language, such as Perl or
 LISP, a developer can create variables without specifying their type. 
This creates more flexible programs and can simplify prototyping and 
some object-oriented coding. In a static programming language, such as C
 or C#, a developer must declare the type of each variable before the 
code is compiled, making the coding less flexible, but also less 
error-prone. But in static programming scenario too we have scenarios 
where tuples can reduce the effort and avoid unwanted lines of code. The
 latest functional programming language from Microsoft, F# also supports
 tuples in a far better syntax. Let me explain the tuples world in a C# 
4.0 scenario. I hope you already downloaded the attached solution.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The
 main purpose of tuples introduction in .NET4.0 are based on below needs
 which were not available till .NET 3.5 and now can be handled with 
tuples.&lt;/div&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;Developers using used 
KeyValuePair{TKey,TValue} just to hold a pair of values together. i.e. 
only 2 dependent values, but using a type which is meant to store more 
number of items&lt;/li&gt;
&lt;li&gt;Anonymous types cannot be passed out of the method&lt;/li&gt;
&lt;li&gt;Need
 to pass multiple out references to a method, if we needed multiple 
values from a method. Otherwise declaring a full class and defining 
properties to return that type from the method.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div&gt;
Above
 are the scenarios faced till 4.0. How we can tackle these in 4.0 using 
tuples? Just go through each method in my uploaded code.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;1.&amp;nbsp;Method returning 2 values with tuples&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;
GetFandLNames(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; name)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;
flNames = &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[]
names = name.Split(&lt;span style=&quot;color: #a31515;&quot;&gt;&#39;,&#39;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;flNames = &lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;.Create&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;(names[0],
names[1]);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;
flNames;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;As
 you can see we are not using any out parameters. &amp;nbsp;Tuples can be created
 2 ways i.e. either using new key word just like creating any object or 
using static method of Create. Here I used Create. You also need to 
mention the types exists in side tuple as I mentioned 2 string types 
which carries first name and last name. Then the method returns the 
tuple which carries the required first name and last name. Now how we 
can retrieve the values from tuple? It&#39;s using properties. If you have 2
 items inside a tuple, you will have 2 properties name &quot;Item1&quot; and 
&quot;Item2&quot; like below screen shot.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;img alt=&quot;11.gif&quot; border=&quot;0&quot; height=&quot;46&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/jaishmathews/using-tuples-with-net-4-0/Images/11.gif&quot; width=&quot;500&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;b&gt;2.&amp;nbsp;Method returning 2 values of different types using tuples&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;Here
 explaining tuples which carrying 2 different types rather than same 
data type. Below is the method which is returning tuple of 2 different 
typed i.e. Date and int.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;DateTime&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;gt;
GetDOBAge()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;DateTime&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;gt;
flNames = &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;flNames = &lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;.Create&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;DateTime&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;gt;(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;DateTime&lt;/span&gt;(1973,5,22),30);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;
flNames;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;Values are retrieving same manner as like above. But this time the properties Item1 and Item2 are of different data types.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;img alt=&quot;2.gif&quot; border=&quot;0&quot; height=&quot;67&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/jaishmathews/using-tuples-with-net-4-0/Images/2.gif&quot; width=&quot;652&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;b&gt;3. Method returning custom information using Dictionary&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;, &lt;span style=&quot;color: #2b91af;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;,&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;&amp;gt;
GetEmployeeDetails()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;Dictionary&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;
emp = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;emp.Add(1, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Jaish&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;emp.Add(2, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Ramji&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;emp.Add(3, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Vulise&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt; dept
= &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;dept.Add(1, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Dev&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;dept.Add(2, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Sales&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;dept.Add(3, &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Test&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;,
&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;, &lt;span style=&quot;color: #2b91af;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;&amp;gt;
empDetails = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;,
&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;, &lt;span style=&quot;color: #2b91af;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;&amp;gt;(emp,
dept);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt;
empDetails;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;Above
 method contains employee and department details. It returns all those 
details as a single tuple. This tuple contains 2 dictionary types. More 
over for you people I made this tuple creation using new key word, just 
for a change. Below explaining the code to iterate through each items in
 this case.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;Tuple&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;, &lt;span style=&quot;color: #2b91af;&quot;&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;,
&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;&amp;gt; empDetails =
GetEmployeeDetails();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt; (&lt;span style=&quot;color: #2b91af;&quot;&gt;KeyValuePair&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;
keyValue &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; empDetails.Item1)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #2b91af;&quot;&gt;MessageBox&lt;/span&gt;.Show(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;ID :&quot;&lt;/span&gt; + keyValue.Key + &lt;span style=&quot;color: #2b91af;&quot;&gt;Environment&lt;/span&gt;.NewLine + &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Name
:&quot;&lt;/span&gt; + keyValue.Value);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;foreach&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt; (&lt;span style=&quot;color: #2b91af;&quot;&gt;KeyValuePair&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;
keyValue &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; empDetails.Item2)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;MessageBox&lt;/span&gt;.Show(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;ID :&quot;&lt;/span&gt; + keyValue.Key + &lt;span style=&quot;color: #2b91af;&quot;&gt;Environment&lt;/span&gt;.NewLine + &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Dept
:&quot;&lt;/span&gt; + keyValue.Value);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;This time Item1 and Item2 contains more information in the form of Dictionary.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;img alt=&quot;22.gif&quot; border=&quot;0&quot; height=&quot;33&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/jaishmathews/using-tuples-with-net-4-0/Images/22.gif&quot; width=&quot;500&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;b&gt;4. How many items can keep in side Tuples&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;When you check the Tuple, you can see only 8 items are supporting using overriding like below screen shot.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;img alt=&quot;4.gif&quot; border=&quot;0&quot; height=&quot;79&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/jaishmathews/using-tuples-with-net-4-0/Images/4.gif&quot; width=&quot;377&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;Then
 how about more numbers? If we need more than 8 items to be kept inside a
 tuple, we need to care about the last parameter in above screen shot 
which saying &quot;TRest&quot;. We will replace this RTest with another tuple 
which again can carry 8 items so on. Below is a simple example which is 
storing 9 numbers in a tuple by replacing the 8th parameter with another
 new tule.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;color: #2b91af; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;Tuple&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;gt;&amp;gt; tup = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;,
&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;gt;&amp;gt;(1, 2, 3, 4, 5, 6, 7, &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Tuple&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&amp;gt;(8, 9));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.5pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-bidi-font-family: Consolas;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana; font-size: 12px;&quot;&gt;The
 .NET Framework 4 provides the System.Tuple class for creating tuple 
objects that contain structured data. It also provides generic tuple 
classes to support tuples that have from one to eight components (that 
is, singletons through octuples). To support tuple objects that have 
nine or more components, there is a generic tuple class with seven type 
parameters and an eighth parameter of any tuple type.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/1283367666928914625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/tuples-in-dotnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/1283367666928914625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/1283367666928914625'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/tuples-in-dotnet.html' title='Tuples in DotNet'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-2084064890026095957</id><published>2014-07-23T06:17:00.005-07:00</published><updated>2014-07-23T06:17:54.031-07:00</updated><title type='text'> Intellisense for jQuery</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 class=&quot;separator&quot;&gt;
Problem&lt;a class=&quot;headeranchor&quot; href=&quot;http://www.asp.net/Ajaxlibrary/jquery_intellisense.ashx#Problem_6&quot; id=&quot;Problem_6&quot; title=&quot;Link to this Section&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
In my programming environment I have strong support for code-completion 
through IntelliSense. I would like the same feature when I&#39;m working 
with the jQuery library.&lt;br /&gt;&lt;br /&gt;&lt;a class=&quot;editsectionlink&quot; href=&quot;http://www.asp.net/Ajaxlibrary/Edit.aspx?Page=jquery_intellisense&amp;amp;Section=7&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2 class=&quot;separator&quot;&gt;
Solution&lt;a class=&quot;headeranchor&quot; href=&quot;http://www.asp.net/Ajaxlibrary/jquery_intellisense.ashx#Solution_7&quot; id=&quot;Solution_7&quot; title=&quot;Link to this Section&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
Visual Studio 2008 SP1 and Visual Studio 2010 use formatted comments in 
JavaScript source files in a very similar fashion to c# and VB.NET. By 
leveraging readily available commented versions of the jQuery library 
you&#39;ll get the full-featured power of IntelliSense. &lt;br /&gt;&lt;br /&gt;Don&#39;t have a
 documentation file?  Even without the specialized commenting 
IntelliSense works with library references to give you a rich set of 
features such as code-completion and method signature information.&lt;br /&gt;&lt;br /&gt;Additionally, you can learn to apply comments to expose summary and parameter information for the code in your own libraries.&lt;br /&gt;&lt;br /&gt;&lt;a class=&quot;editsectionlink&quot; href=&quot;http://www.asp.net/Ajaxlibrary/Edit.aspx?Page=jquery_intellisense&amp;amp;Section=0&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3 class=&quot;separator&quot;&gt;
The Goal&lt;a class=&quot;headeranchor&quot; href=&quot;http://www.asp.net/Ajaxlibrary/jquery_intellisense.ashx#The_Goal_0&quot; id=&quot;The_Goal_0&quot; title=&quot;Link to this Section&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
What we&#39;re looking for is pretty straightforward. Basically, we want to 
see object members, code-completion and parameter information.  It 
should look something like this:
&lt;img alt=&quot;Image&quot; src=&quot;http://www.asp.net/Ajaxlibrary/GetFile.aspx?Page=jquery_intellisense&amp;amp;File=intellisense-goal.PNG&quot; /&gt;&lt;br /&gt;&lt;br /&gt;This
 is achieved by including a special version of jQuery in our project. 
You will need to download a copy of this documention from the jQuery web site,
 listed as &quot;Visual Studio&quot; in the Documentation section of the 
downloads. The downloaded file name will include &quot;vsdoc&quot;, as in &quot;Visual 
Studio Documentation&quot;, in it&#39;s name.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Grab a copy of the file and add it to your project, saving it in the same directory as the jQuery library.
&lt;a class=&quot;editsectionlink&quot; href=&quot;http://www.asp.net/Ajaxlibrary/Edit.aspx?Page=jquery_intellisense&amp;amp;Section=1&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3 class=&quot;separator&quot;&gt;
Enabling IntelliSense in a Web Form or View Page&lt;a class=&quot;headeranchor&quot; href=&quot;http://www.asp.net/Ajaxlibrary/jquery_intellisense.ashx#Enabling_IntelliSense_in_a_Web_Form_or_View_Page_1&quot; id=&quot;Enabling_IntelliSense_in_a_Web_Form_or_View_Page_1&quot; title=&quot;Link to this Section&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
Remeber,
 you can get most of IntelliSense&#39;s features (code completion, limited 
parameter information) even when the file you reference does not have a 
commented version available. But, once you&#39;ve put a properly-formatted 
VSDoc file in the same directory as the jQuery library you&#39;ve done all 
you need to do to get all aspects of the tool. The rest is up to Visual 
Studio.&lt;br /&gt;&lt;br /&gt;Visual Studio opportunistically searches for 
documentation files (and debug versions of your libraries) in the same 
directory as any script you&#39;ve referenced.  Following a naming 
convention with the name of a library as a root, for example &lt;b&gt;jquery-1.4.1&lt;/b&gt;.js, the IDE will search for:
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;jquery-1.4.1&lt;/b&gt;-vsdoc.js, then if the IDE can&#39;t find it will search for...&lt;/li&gt;
&lt;li&gt;&lt;b&gt;jquery-1.4.1&lt;/b&gt;.debug.js, then if the IDE can&#39;t find it will search for...&lt;/li&gt;
&lt;li&gt;&lt;b&gt;jquery-1.4.1&lt;/b&gt;.js&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;These
 files are sought out for any script reference you make, be it as 
standard HTML script tags, in ASP.NET Script Manager and Script Manager 
Proxy tags, as well as in XML comment references (which we&#39;ll see in a 
moment).&lt;br /&gt;&lt;br /&gt;This makes it easy for any developers who already have 
debug versions of their scripts with the &quot;dot debug&quot; convention.  By 
keeping the VSDoc or DEBUG files next to your runtime version you give 
the IDE everything it needs to serve up some IntelliSense coolness.&lt;br /&gt;&lt;br /&gt;&lt;a class=&quot;editsectionlink&quot; href=&quot;http://www.asp.net/Ajaxlibrary/Edit.aspx?Page=jquery_intellisense&amp;amp;Section=2&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3 class=&quot;separator&quot;&gt;
Enabling IntelliSense in a Script&lt;a class=&quot;headeranchor&quot; href=&quot;http://www.asp.net/Ajaxlibrary/jquery_intellisense.ashx#Enabling_IntelliSense_in_a_Script_2&quot; id=&quot;Enabling_IntelliSense_in_a_Script_2&quot; title=&quot;Link to this Section&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
You
 can take advantage of the same great feature in script files, too.  The
 idea is the same, but the markup is a little simpler; it is achieved 
through XML comment references:
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;///&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;reference&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;path&lt;/span&gt;=&lt;span class=&quot;attribute-value&quot;&gt;&quot;jquery-1.4.1.js&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;/&amp;gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
That one line at the top of a stand-alone JavaScript file is all you need, provided the VSDoc file is in the same directory.&lt;br /&gt;&lt;br /&gt;&lt;a class=&quot;editsectionlink&quot; href=&quot;http://www.asp.net/Ajaxlibrary/Edit.aspx?Page=jquery_intellisense&amp;amp;Section=3&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3 class=&quot;separator&quot;&gt;
Visual Studio 2010, IntelliSense and the CDN&lt;a class=&quot;headeranchor&quot; href=&quot;http://www.asp.net/Ajaxlibrary/jquery_intellisense.ashx#Visual_Studio_CABA_IntelliSense_and_the_CDN_3&quot; id=&quot;Visual_Studio_CABA_IntelliSense_and_the_CDN_3&quot; title=&quot;Link to this Section&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
We&#39;ll
 shift gears here quickly and talk about Content Delivery Networks, or 
CDNs. CDNs are made up of multiple servers, positioned at critical sites
 world wide. These servers all host the same set of files, allowing the 
closest server to the user respond to the request for a given file. CDNs
 reduce the amount of traffic on the internet by serving content locally
 with the added benefit of increasing the performance of downloads for 
users.&lt;br /&gt;&lt;br /&gt;Why is this relevant to IntelliSense and Visual Studio 
2010? With the latest version of the IDE you are now able reference 
files that are not located locally, i.e., that are out on the network 
somewhere, including on a CDN.&lt;br /&gt;&lt;br /&gt;Have a look at how you can do this with the jQuery library:
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;script&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;src&lt;/span&gt;=&lt;span class=&quot;attribute-value&quot;&gt;&quot;http://ajax.microsoft.com/ajax/jquery/jquery-1.4.1.min.js&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;type&lt;/span&gt;=&lt;span class=&quot;attribute-value&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;Let&#39;s consider some of the immediate benefits gained by this feature of VS 2010:
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;you get the same opportunistic VSDoc and DEBUG file searching from the cloud and don&#39;t have to download the documentation files&lt;/li&gt;
&lt;li&gt;you don&#39;t have to download or deploy the library itself&lt;/li&gt;
&lt;li&gt;you will likely improve the download speed of your web page for users&lt;/li&gt;
&lt;li&gt;some
 CDNs will automatically serve the latest copy of a script if you omit 
the revision number, meaning your pages will benefit from performance or
 security upgrades as they become available &lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;Again, 
Visual Studio 2008 SP1 will not grab the files off the network; however 
it is able to grab VSDoc and DEBUG files from the local file system. 
&lt;a class=&quot;editsectionlink&quot; href=&quot;http://www.asp.net/Ajaxlibrary/Edit.aspx?Page=jquery_intellisense&amp;amp;Section=4&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3 class=&quot;separator&quot;&gt;
Getting IntelliSense for Your Script Files&lt;a class=&quot;headeranchor&quot; href=&quot;http://www.asp.net/Ajaxlibrary/jquery_intellisense.ashx#Getting_IntelliSense_for_Your_Script_Files_4&quot; id=&quot;Getting_IntelliSense_for_Your_Script_Files_4&quot; title=&quot;Link to this Section&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
Excellent,
 so we&#39;re humming along with jQuery and - in Visual Studio 2010 - we&#39;re 
able to take advantage of IntelliSense from files even if they live in 
the cloud, but eventually we&#39;re going to have to write our own code too,
 right? &lt;br /&gt;&lt;br /&gt;So, how do we get IntelliSense for our own libraries?&lt;br /&gt;&lt;br /&gt;Let&#39;s examine the following script:
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;function&amp;nbsp;Shape(sides)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;this.numsides&lt;/span&gt;&amp;nbsp;=&amp;nbsp;sides;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;this.ShowSides&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;attribute-value&quot;&gt;function&lt;/span&gt;&amp;nbsp;()&amp;nbsp;{&amp;nbsp;alert(this.numsides)&amp;nbsp;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;attribute&quot;&gt;Shape.prototype.AddSide&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;attribute-value&quot;&gt;function&lt;/span&gt;&amp;nbsp;()&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.numsides&amp;nbsp;+=&amp;nbsp;1;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;Let&#39;s assume the code above is stored in a file called &lt;code&gt;shapes.js&lt;/code&gt;
 and that we have it referenced in the source file we&#39;re working on, as 
we did with the jQuery library. With no extra effort we get code 
completion and some hinting about the method&#39;s parameters.&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;Image&quot; src=&quot;http://www.asp.net/Ajaxlibrary/GetFile.aspx?Page=jquery_intellisense&amp;amp;File=intellisense-free.PNG&quot; /&gt;&lt;br /&gt;&lt;br /&gt;We
 see member variables, methods defined through closure as well as 
through the prototype, and this is all free. To take it to the next 
level we&#39;re going to have to resort to a trick we&#39;ve been using for 
years in Visual Studio with a syntax meant for documentation.&lt;br /&gt;&lt;br /&gt;Consider the revised script:
&lt;br /&gt;
&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;tools&quot;&gt;
view plaincopy to clipboardprint&lt;a href=&quot;http://www.asp.net/Ajaxlibrary/jquery_intellisense.ashx#&quot;&gt;?&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ol class=&quot;dp-xml&quot; start=&quot;1&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;function&amp;nbsp;Shape(sides)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;Creates&amp;nbsp;a&amp;nbsp;new&amp;nbsp;shape&amp;nbsp;with&amp;nbsp;the&amp;nbsp;number&amp;nbsp;of&amp;nbsp;sides&amp;nbsp;specified.&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;param&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;name&lt;/span&gt;=&lt;span class=&quot;attribute-value&quot;&gt;&quot;sides&quot;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;type&lt;/span&gt;=&lt;span class=&quot;attribute-value&quot;&gt;&quot;integer&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;The&amp;nbsp;number&amp;nbsp;of&amp;nbsp;sides&amp;nbsp;for&amp;nbsp;a&amp;nbsp;shape.&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;param&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;this.numsides&lt;/span&gt;&amp;nbsp;=&amp;nbsp;sides;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;attribute&quot;&gt;this.ShowSides&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;attribute-value&quot;&gt;function&lt;/span&gt;&amp;nbsp;()&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;Alerts&amp;nbsp;the&amp;nbsp;user&amp;nbsp;to&amp;nbsp;the&amp;nbsp;current&amp;nbsp;number&amp;nbsp;of&amp;nbsp;sides&amp;nbsp;on&amp;nbsp;the&amp;nbsp;shape.&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;alert(this.numsides)&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&lt;span class=&quot;attribute&quot;&gt;Shape.prototype.AddSide&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;attribute-value&quot;&gt;function&lt;/span&gt;&amp;nbsp;()&amp;nbsp;{&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;Adds&amp;nbsp;a&amp;nbsp;side&amp;nbsp;to&amp;nbsp;the&amp;nbsp;shape.&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;tag-name&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.numsides&amp;nbsp;+=&amp;nbsp;1;&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;&quot;&gt;}&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;With a set of triple slashes and some XML style comments, we can now unleash IntelliSense on our code with full force:&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;Image&quot; src=&quot;http://www.asp.net/Ajaxlibrary/GetFile.aspx?Page=jquery_intellisense&amp;amp;File=intellisense-full.PNG&quot; /&gt;&lt;br /&gt;&lt;br /&gt;For a complete breakdown of how to fully comment your library see this post by Bertrand Le Roy.&lt;br /&gt;&lt;br /&gt;&lt;a class=&quot;editsectionlink&quot; href=&quot;http://www.asp.net/Ajaxlibrary/Edit.aspx?Page=jquery_intellisense&amp;amp;Section=5&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3 class=&quot;separator&quot;&gt;
Wrapping Up&lt;a class=&quot;headeranchor&quot; href=&quot;http://www.asp.net/Ajaxlibrary/jquery_intellisense.ashx#Wrapping_Up_5&quot; id=&quot;Wrapping_Up_5&quot; title=&quot;Link to this Section&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
IntelliSense
 is a feature that just keeps getting better in every release of Visual 
Studio. Over the years it has evolved from it&#39;s humble beginnings adding
 features, additional languages, pre-compilation support, richer 
interaction from within the IDE, and now even support for files in the 
cloud. It&#39;s likely something that you use already, so you&#39;ll be glad to 
see such strong support for jQuery with this excellent tool.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/2084064890026095957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/intellisense-for-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/2084064890026095957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/2084064890026095957'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/intellisense-for-jquery.html' title=' Intellisense for jQuery'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-8557147816463041116</id><published>2014-07-14T02:52:00.003-07:00</published><updated>2014-08-08T03:56:50.929-07:00</updated><title type='text'>MVC Interview Questions </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;Introduction&lt;br /&gt;&lt;br /&gt;This
 article provides some interview questions and answers of MVC, basically
 covering most of MVC 2, MVC 3 and MVC 4 topics that are more likely to 
be asked in job interviews/tests/exams.&lt;br /&gt;&lt;br /&gt;The sole purpose of this 
article is to sum up important questions and answers that can be used by
 developers to brush-up on MVC before they go to an interview including 
it.&lt;br /&gt;&lt;br /&gt;What is MVC?&lt;br /&gt;&lt;br /&gt;MVC is a framework 
pattern that splits an application&#39;s implementation logic into three 
component roles: models, views, and controllers.&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Model:
 The business entity on which the overall application operates. Many 
applications use a persistent storage mechanism (such as a database) to 
store data. MVC does not specifically mention the data access layer 
because it is understood to be encapsulated by the Model.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;View: The user interface that renders the Model into a form of interaction.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Controller: Handles a request from a View and updates the Model that results in a change of the Model&#39;s state.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;To implement MVC in .NET we need mainly three classes (View, Controller and the Model). &lt;br /&gt;&lt;br /&gt;Explain MVC Architecture?&lt;br /&gt;&lt;img alt=&quot;image1.gif&quot; border=&quot;0&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/1492b1/mvc-3-interview-questions-and-answers/Images/image1.gif&quot; height=&quot;223&quot; width=&quot;567&quot; /&gt;&lt;br /&gt;&lt;br /&gt;The
 architecture is self-explanatory. The browser (as usual) sends a 
request to IIS, IIS searches for the route defined in the MVC 
application and passes the request to the controller as specified by the
 route, the controller communicates with the model and passes the 
populated model (entity) to View (front end), Views are populated with 
model properties, and are rendered on the browser, passing the response 
to the browser through IIS via controllers that invoked the specified 
View.&lt;br /&gt;&lt;br /&gt;What are the new features of MVC 2?&lt;br /&gt;&lt;br /&gt;ASP.NET MVC 2 was released in March 2010. Its main features are:&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Introduction of UI helpers with automatic scaffolding with customizable templates.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Attribute-based model validation on both client and server.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Strongly typed HTML helpers.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Improved Visual Studio tooling.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;There
 were also many API enhancements and &quot;pro&quot; features, based on feedback 
from developers building a variety of applications on ASP.NET MVC 1, 
such as:&lt;/span&gt; &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Support for partitioning large applications into areas.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Asynchronous controllers support.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Support for rendering subsections of a page/site using Html.RenderAction.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Many new helper functions, utilities, and API enhancements.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;What are the new features of MVC 3?&lt;br /&gt;ASP.NET MVC 3 shipped just 10 months after MVC 2 in Jan 2011. Some of the top features in MVC 3 included:&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;The Razor view engine.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Support for .NET 4 Data Annotations.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Improved model validation&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Greater control and flexibility with support for dependency resolution and global action filters.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Better JavaScript support with unobtrusive JavaScript, jQuery Validation, and JSON binding.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Use of NuGet to deliver software and manage dependencies throughout the platform.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;What are the new features of MVC 4?&lt;br /&gt;&lt;br /&gt;The following are the top features of MVC 4:&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;ASP.NET Web API.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Enhancements to default project templates.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Mobile project template using jQuery Mobile.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Display Modes.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Task support for Asynchronous Controllers.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Bundling and minification.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;Explain &quot;page lifecycle&quot; of ASP.NET MVC&lt;br /&gt;&lt;br /&gt;The following processes are performed by ASP.NET MVC page::&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;App initialization&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Routing&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Instantiate and execute controller&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Locate and invoke controller action&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Instantiate and render view&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;Advantages of MVC Framework&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Provides
 a clean separation of concerns among UI (Presentation layer), model 
(Transfer objects/Domain Objects/Entities) and Business Logic 
(Controller).&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Easy to UNIT Test.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Improved reusability of views/model. One can have multiple views that can point to the same model and vice versa.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Improved structuring of the code.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;What is meant by Separation of Concerns?&lt;br /&gt;&lt;br /&gt;As
 per Wikipedia &#39;the process of breaking a computer program into distinct
 features that overlap in functionality as little as possible&#39;. The MVC 
design pattern aims to separate content from presentation and 
data-processing from content. &lt;br /&gt;&lt;br /&gt;Where do we see Separation of Concerns in MVC?&lt;br /&gt;Between the data-processing (Model) and the rest of the application.&lt;br /&gt;&lt;br /&gt;When
 we talk about Views and Controllers, their ownership itself explains 
separate. The views are just the presentation form of an application, it
 does not need to know specifically about the requests coming from the 
controller. The Model is independent of View and Controllers, it only 
holds business entities that can be passed to any View by the controller
 as required for exposing them to the end user. The controller is 
independent of Views and Models, its sole purpose is to handle requests 
and pass it on as per the routes defined and as per the need of 
rendering the views. Thus our business entities (model), business logic 
(controllers) and presentation logic (views) lie in logical/physical 
layers independent of each other.&lt;br /&gt;&lt;br /&gt;What is Razor View Engine?&lt;br /&gt;&lt;br /&gt;Razor
 is the first major update to render HTML in MVC 3. Razor was designed 
specifically as a view engine syntax. It has one main focus: 
code-focused templating for HTML generation. Here&#39;s how that same markup
 would be generated using Razor:&lt;/span&gt;&lt;span style=&quot;background: yellow; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@model &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;MvcMusicStore&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;.Models.Genre&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: yellow; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@{&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;ViewBag.Title = &quot;Browse Albums&quot;;&lt;/span&gt;&lt;span style=&quot;background: yellow;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;div&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; class&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;=&quot;genre&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;h3&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;em&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: yellow; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Model.Name&amp;lt;/em&amp;gt; Albums&amp;lt;/h3&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;ul&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; id&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;=&quot;album-list&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: yellow; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;foreach&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; (var album in Model.Albums)&lt;br /&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;li&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; href=&quot;&lt;span style=&quot;background: yellow;&quot;&gt;@&lt;/span&gt;Url.Action(&quot;Details&quot;, new { id = album.AlbumId&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; })&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;img&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; alt=&quot;&lt;span style=&quot;background: yellow;&quot;&gt;@&lt;/span&gt;album.Title&quot; src=&quot;&lt;span style=&quot;background: yellow;&quot;&gt;@&lt;/span&gt;album.AlbumArtUrl&quot; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;span&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: yellow; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;album.Title&amp;lt;/span&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;li&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;ul&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;div&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;The
 Razor syntax is easier to type, and easier to read. Razor doesn&#39;t have 
the XML-like heavy syntax of the Web Forms view engine.&lt;br /&gt;&lt;br /&gt;What is Unobtrusive JavaScript?&lt;br /&gt;Unobtrusive
 JavaScript is a general term that conveys a general philosophy, similar
 to the term REST (Representational State Transfer). The high-level 
description is that unobtrusive JavaScript doesn&#39;t intermix JavaScript 
code in your page markup. For example, rather than hooking in via event 
attributes like onclick and onsubmit, the unobtrusive JavaScript 
attaches to elements by their ID or class, often based on the presence 
of other attributes (such as HTML5 data-attributes).&lt;br /&gt;&lt;br /&gt;It&#39;s got 
semantic meaning and all of it; the tag structure, element attributes 
and so on should have a precise meaning. Strewing JavaScript gunk across
 the page to facilitate interaction (I&#39;m looking at you, -doPostBack!) 
harms the content of the document.&lt;br /&gt;&lt;br /&gt;What is JSON Binding?&lt;br /&gt;&lt;br /&gt;MVC
 3 included JavaScript Object Notation (JSON) binding support via the 
new JsonValueProviderFactory, enabling the action methods to accept and 
model-bind data in JSON format. This is especially useful in advanced 
Ajax scenarios like client templates and data binding that need to post 
data back to the server.&lt;br /&gt;&lt;br /&gt;What is Dependency Resolution?&lt;br /&gt;MVC
 3 introduced a new concept called a dependency resolver, that greatly 
simplified the use of dependency injection in your applications. This 
made it easier to decouple application components, making them more 
configurable and easier to test.&lt;br /&gt;&lt;br /&gt;Support was added for the following scenarios:&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Controllers (registering and injecting controller factories, injecting controllers)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Views (registering and injecting view engines, injecting dependencies into view pages)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Action filters (locating and injecting filters)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Model binders (registering and injecting)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Model validation providers (registering and injecting)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Model metadata providers (registering and injecting)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Value providers (registering and injecting)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;What are Display Modes in MVC 4?&lt;br /&gt;Display
 modes use a convention-based approach to allow selecting various views 
based on the browser making the request. The default view engine first 
looks for views with names ending with &quot;.Mobile.cshtml&quot; when the 
browser&#39;s user agent indicates a known mobile device. For example, if we
 have a generic view titled &quot;Index.cshtml&quot; and a mobile view titled 
&quot;Index.Mobile.cshtml&quot; then MVC 4 will automatically use the mobile view 
when viewed in a mobile browser.&lt;br /&gt;&lt;br /&gt;Additionally, we can register 
your own custom device modes that will be based on your own custom 
criteria, all in just one code statement. For example, to register a 
WinPhone device mode that would serve views ending with 
&quot;.WinPhone.cshtml&quot; to Windows Phone devices, you&#39;d use the following 
code in the Application_Start method of your Global.asax:&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;DisplayModeProvider&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;.Instance.Modes.Insert(0, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DefaultDisplayMode(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;WinPhone&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;)&lt;br /&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;ContextCondition&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; = (context =&amp;gt; context.GetOverriddenUserAgent().IndexOf&lt;br /&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&quot;Windows Phone OS&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;StringComparison&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;.OrdinalIgnoreCase&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;) &amp;gt;= 0)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;What is AuthConfig.cs in MVC 4?&lt;br /&gt;&lt;br /&gt;&quot;AuthConfig.cs&quot; configures security settings, including sites for OAuth login.&lt;br /&gt;&lt;br /&gt;What is BundleConfig.cs in MVC 4?&lt;br /&gt;&lt;br /&gt;&quot;BundleConfig.cs&quot;
 in MVC4 registers bundles used by the bundling and minification system.
 Several bundles are added by default, including jQuery, jQueryUI, 
jQuery validation, Modernizr, and default CSS references.&lt;br /&gt;&lt;br /&gt;What is FilterConfig.cs in MVC 4?&lt;br /&gt;&lt;br /&gt;This
 is used to register global MVC filters. The only filter registered by 
default is the HandleErrorAttribute, but this is a great place to put 
other filter registrations.&lt;br /&gt;&lt;br /&gt;What is RouteConfig.cs in MVC 4?&lt;br /&gt;&lt;br /&gt;&quot;RouteConfig.cs&quot; holds the granddaddy of the MVC config statements and Route configuration. &lt;br /&gt;&lt;br /&gt;What is WebApiConfig.cs in MVC 4?&lt;br /&gt;&lt;br /&gt;Used to register Web API routes, as well as set any additional Web API configuration settings.&lt;br /&gt;&lt;br /&gt;What&#39;s new for adding a controller in a MVC 4 application?&lt;br /&gt;&lt;br /&gt;Previously
 (in MVC 3 and MVC 2), the Visual Studio Add Controller menu item only 
displayed when we right-clicked on the Controllers folder. However, the 
use of the Controllers folder was purely for organization. (MVC will 
recognize any class that implements the IController interface as a 
Controller, regardless of its location in your application.) The MVC 4 
Visual Studio tooling has been modified to display the Add Controller 
menu item for any folder in your MVC project. This allows us to organize
 controllers however you would like, perhaps separating them into 
logical groups or separating MVC and Web API controllers.&lt;br /&gt;&lt;br /&gt;What are the software requirements of an ASP.NET MVC 4 application?&lt;br /&gt;&lt;br /&gt;MVC 4 runs on the following Windows client operating systems:&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Windows XP&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Windows Vista&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Windows 7&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Windows 8&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;It runs on the following server operating systems:&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Windows Server 2003&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Windows Server 2008&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Windows Server 2008 R2&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;MVC
 4 development tooling is included with Visual Studio 2012 and can be 
installed on Visual Studio 2010 SP1/Visual Web Developer 2010 Express 
SP1.&lt;br /&gt;&lt;br /&gt;What are the various types of Application Templates used to create an MVC application?&lt;br /&gt;&lt;br /&gt;The various templates are as follows:&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;The Internet Application template: This contains the beginnings of an MVC web application, enough that you can run the application immediately after creating it&lt;br /&gt;and
 see a few pages. This template also includes some basic account 
management functions that run against the ASP.NET Membership.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;The Intranet Application template:
 The Intranet Application template was added as part of the ASP.NET MVC 3
 Tools Update. It is similar to the Internet Application template, but 
the account management functions run against Windows accounts rather 
than the ASP.NET Membership system.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;The Basic template:
 This template is pretty minimal. It still has the basic folders, CSS, 
and MVC application infrastructure in place, but no more. Running an 
application created using the Empty template just gives you an error 
message.&lt;br /&gt;&lt;br /&gt;Why use Basic template? The Basic template is intended 
for experienced MVC developers who want to set up and configure things 
exactly how they want them.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;The Empty template:
 The Basic Template was previously called the Empty Template, but 
developers complained that it wasn&#39;t quite empty enough. With MVC 4, the
 previous Empty&lt;br /&gt;Template was renamed Basic, and the new Empty Template is about as empty as possible.&lt;br /&gt;&lt;br /&gt;It has the assemblies and basic folder structure in place, but that&#39;s about it.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;The Mobile Application template: The
 Mobile Application template is preconfigured with jQuery Mobile to 
jump-start creating a mobile only website. It includes mobile visual 
themes, a touch-optimized UI, and support for Ajax navigation.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;The Web API template: The ASP.NET Web API is a framework for creating HTTP services.&lt;br /&gt;&lt;br /&gt;The
 Web API template is similar to the Internet Application template but is
 streamlined for Web API development. For instance, there is no user 
account management functionality, since Web API account management is 
often significantly different from standard MVC account management. Web 
API functionality is also available in the other MVC project templates, 
and even in non-MVC project types.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;What are the default Top-level directories created when adding a MVC 4 application?&lt;br /&gt;The default Top-level directories are:&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;/Controllers: For Controller classes that handle URL requests&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;/Models: For classes that represent and manipulate data and business objects&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;/Views: For UI template files that are responsible for rendering output like HTML&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;/Scripts: For JavaScript library files and scripts (.js)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;/Images: For images used in your site&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;/Content: For CSS and other site content, other than scripts and images&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;/Filters: For code filters&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;/App_Data: &amp;nbsp;To store data files you want to read/write&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;/App_Start: For configuration code of features like Routing, Bundling, Web API.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;What is namespace of ASP.NET MVC?&lt;br /&gt;&lt;br /&gt;ASP.NET MVC namespaces as well as classes are located in assembly System.Web.Mvc.&lt;br /&gt;&lt;br /&gt;Note: Some of the content has been taken from various books/articles.&lt;br /&gt;&lt;br /&gt;What is System.Web.Mvc namespace?&lt;br /&gt;This
 namespace contains classes and interfaces that support the MVC pattern 
for ASP.NET Web applications. This namespace includes classes that 
represent controllers, controller&lt;br /&gt;factories, action results, views, partial views, and model binders.&lt;br /&gt;&lt;br /&gt;What is System.Web.Mvc.Ajax namespace?&lt;br /&gt;&lt;br /&gt;The
 System.Web.Mvc.Ajax namespace contains classes that support Ajax 
scripting in an ASP.NET MVC application. The namespace includes support 
for Ajax scripts and Ajax option settings as well.&lt;br /&gt;&lt;br /&gt;What is System.Web.Mvc.Async namespace?&lt;br /&gt;&lt;br /&gt;The
 System.Web.Mvc.Async namespace contains classes and interfaces that 
support asynchronous actions in an ASP.NET MVC application.&lt;br /&gt;&lt;br /&gt;What is System.Web.Mvc.Html namespace?&lt;br /&gt;&lt;br /&gt;The
 System.Web.Mvc.Html namespace contains classes that help render HTML 
controls in an MVC application. This namespace includes classes that 
support forms, input controls, links, partial views, and validation.&lt;br /&gt;&lt;br /&gt;What is ViewData, ViewBag and TempData?&lt;br /&gt;MVC
 provides ViewData, ViewBag and TempData for passing data from the 
controller, view and in subsequent requests as well. ViewData and 
ViewBag are similar to some extent but TempData performs additional 
roles.&lt;br /&gt;&lt;br /&gt;What are the roles and similarities between ViewData and ViewBag?&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Maintains data when moving from controller to view.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Passes data from the controller to the respective view.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Their
 value becomes null when any redirection occurs, because their role is 
to provide a way to communicate between controllers and views. It&#39;s a 
communication mechanism within the server call.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;What are the differences between ViewData and ViewBag (taken from a blog)?&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;ViewData is a dictionary of objects derived from the ViewDataDictionary class and accessible using strings as keys.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;ViewBag is a dynamic property that takes advantage of the new dynamic features in C# 4.0.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;ViewData requires typecasting for complex data types and checks for null values to avoid error.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;ViewBag doesn&#39;t require typecasting for complex data types.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;NOTE: Although
 there might not be a technical advantage to choosing one format over 
the other, there are some critical differences to be aware of between 
the two syntaxes.&lt;br /&gt;One obvious difference is that ViewBag works only 
when the key being accessed is a valid C# identifier. For example, if 
you place a value in ViewData[&quot;KeyWith Spaces&quot;] then you can&#39;t access 
that value using ViewBag because the code won&#39;t compile.&lt;br /&gt;&lt;br /&gt;Another 
key issue to be aware of is that dynamic values cannot be passed in as 
parameters to extension methods. The C# compiler must know the real type
 of every parameter at compile time in order for it to choose the 
correct extension method.&lt;br /&gt;&lt;br /&gt;If any parameter is dynamic then 
compilation will fail. For example, this code will always fail: 
@Html.TextBox(&quot;name&quot;, ViewBag.Name). To work around this, either use 
ViewData[&quot;Name&quot;] or cast the value to a specifi c type: (string) 
ViewBag.Name.&lt;br /&gt;&lt;br /&gt;What is TempData?&lt;br /&gt;TempData 
is a dictionary derived from the TempDataDictionary class and stored in a
 short-lived session. It is a string key and object value.&lt;br /&gt;&lt;br /&gt;It 
maintains the information for the duration of an HTTP Request. This 
means only from one page to another. It helps to maintain data when we 
move from one controller to another controller or from one action to 
another action. In other words, when we redirect Tempdata, it helps to 
maintain the data between those redirects. It internally uses session 
variables. Temp data used during the current and subsequent request only
 means it is used when we are sure that the next request will be 
redirecting to the next view. It requires typecasting for complex data 
types and checks for null values to avoid errors. Generally it is used 
to store only one-time messages, like error messages and validation 
messages.&lt;br /&gt;&lt;br /&gt;How can you define a dynamic property using viewbag in ASP.NET MVC?&lt;br /&gt;&lt;br /&gt;Assign a key name with the syntax &quot;ViewBag.[Key]=[ Value]&quot; and value using the equal to operator.&lt;br /&gt;&lt;br /&gt;For example, you need to assign a list of students to the dynamic Students property of ViewBag as in the following:&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;List&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt; students = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;List&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;();&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;countries.Add(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;Akhil&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;countries.Add(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;Ekta&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;);&lt;br /&gt;ViewBag.Students = students;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;//Students is a dynamic property associated with ViewBag.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;Note: Some of the content has been taken from various books/articles.&lt;br /&gt;&lt;br /&gt;What is ViewModel (taken from stackoverflow)?&lt;br /&gt;&lt;br /&gt;Accepted A view model represents data that you want to have displayed on your view/page.&lt;br /&gt;&lt;br /&gt;Let&#39;s say that you have an Employee class that represents your employee domain model and it contains the following 4 properties:&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Employee&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; : IEntity&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Id { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;get&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;set&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; } &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;// Employee&#39;s unique identifier&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; FirstName { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;get&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;set&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; } &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;// Employee&#39;s first name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; LastName { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;get&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;set&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; } &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;// Employee&#39;s last name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;DateTime&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; DateCreated { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;get&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;set&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; } &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;// Date when employee was created&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;View
 models differ from domain models in that view models only contain the 
data (represented by properties) that you want to use on your view. For 
example, let&#39;s say that you want to add a new employee record, your view
 model might look like this:&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;CreateEmployeeViewModel&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; FirstName { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;get&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;set&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; LastName { &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;get&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;set&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;; }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;As
 you can see it only contains 2 of the properties of the employee domain
 model. Why is this you may ask? Id might not be set from the view and 
it might be auto-generated by the Employee table. And DateCreated might 
also be set in the Stored Procedure or in the service layer of your 
application. So Id and DateCreated is not needed in the view model.&lt;br /&gt;&lt;br /&gt;When
 loading the view/page, the create action method in your employee 
controller will create an instance of this view model, populate any 
fields if required, and then pass this view model to the view:&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;EmployeeController&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; : Controller&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;private&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;readonly&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; IEmployeeService employeeService;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; EmployeeController(IEmployeeService employeeService)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;this&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;.employeeService = employeeService;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; ActionResult Create()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;CreateEmployeeViewModel&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; viewModel = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;CreateEmployeeViewModel&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; View(viewModel);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; ActionResult Create(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;CreateEmployeeViewModel&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; viewModel)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;// Do what ever needs to be done before adding the employee to the database&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;Your view might look like this (assuming you are using ASP.NET MVC3 and razor):&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;model MyProject.Web.ViewModels.ProductCreateViewModel&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;table&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;First Name:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Html.TextBoxFor(x =&amp;gt; x.FirstName, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; { maxlength = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&quot;50&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;, size = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&quot;50&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; })&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Html.ValidationMessageFor(x =&amp;gt; x.FirstName)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Last Name:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Html.TextBoxFor(x =&amp;gt; x.LastName, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; { maxlength = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&quot;50&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;, size = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&quot;50&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; })&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Html.ValidationMessageFor(x =&amp;gt; x.LastName)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;td&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;tr&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;table&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;Validation would thus be done only on FirstName and LastName. Using Fluent Validation you might have validation like this:&lt;/span&gt;&lt;br /&gt;
 &lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;CreateEmployeeViewModelValidator&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; : AbstractValidator&amp;lt;CreateEmployeeViewModel&amp;gt;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; CreateEmployeeViewModelValidator()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RuleFor(x =&amp;gt; x.FirstName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .NotEmpty()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .WithMessage(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;First&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt; name required&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Length(1, 50)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .WithMessage(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;First&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt; name must not be greater than 50 characters&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RuleFor(x =&amp;gt; x.LastName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .NotEmpty()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .WithMessage(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;Last&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt; name required&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Length(1, 50)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .WithMessage(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;Last&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt; name must not be greater than 50 characters&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;The
 key thing to remember is that the view model only represents the data 
that you want to use. You can imagine all the unnecessary code and 
validation if you have a domain model with 30 properties and you only 
want to update a single value. Given this scenario you would only have 
this one value/property in the view model and not the entire domain 
object.&lt;br /&gt;&lt;br /&gt;How do you check for AJAX requests with C# in MVC.NET?&lt;br /&gt;&lt;br /&gt;The
 solution is independed of the MVC.NET framework and is global across 
server side technologies. Most modern AJAX applications utilize 
XmlHTTPRequest to send async requests to the server. Such requests will 
have a distinct request header:&lt;br /&gt;&lt;br /&gt;X-Requested-With = XMLHTTPREQUEST&lt;br /&gt;&lt;img alt=&quot;image2.gif&quot; border=&quot;0&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/1492b1/mvc-3-interview-questions-and-answers/Images/image2.gif&quot; height=&quot;199&quot; width=&quot;650&quot; /&gt;&lt;br /&gt;&lt;br /&gt;MVC.NET
 provides helper functions to check for ajax requests that internally 
inspects the &quot;X-Requested-With&quot; request header to set the &quot;IsAjax&quot; flag.&lt;br /&gt;&lt;br /&gt;What are Scaffold templates?&lt;br /&gt;&lt;br /&gt;These
 templates use the Visual Studio T4 templating system to generate a view
 based on the model type selected. Scaffolding in ASP.NET MVC can 
generate the boilerplate code we need to create, read, update, and 
delete (CRUD) functionality in an application. The scaffolding templates
 can examine the type definition for it then generate a controller and 
the controller&#39;s associated views. The scaffolding knows how to name 
controllers, how to name views, what code needs to go to each component,
 and where to place all these pieces in the project for the application 
to work.&lt;br /&gt;&lt;br /&gt;What are the types of Scaffolding Templates?&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Empty: Creates an empty view. Only the model type is specified using the model syntax.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Create:&amp;nbsp; Creates a view with a form for creating new instances of the model.&lt;br /&gt;Generates a label and input field for each property of the model type.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Delete: &amp;nbsp;Creates a view with a form for deleting existing instances of the model.&lt;br /&gt;Displays a label and the current value for each property of the model.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Details:&amp;nbsp; Creates a view that displays a label and the value for each property of the model type.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;Edit: &amp;nbsp;Creates a view with a form for editing existing instances of the model.&lt;br /&gt;Generates a label and input field for each property of the model type.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;List:&amp;nbsp;
 Creates a view with a table of model instances. Generates a column for 
each property of the model type. Make sure to pass an 
IEnumerable&amp;lt;YourModelType&amp;gt; to this view from your action method.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;The view also contains links to actions for performing the create/edit/delete operations.&lt;br /&gt;&lt;br /&gt;Show an example of the difference in syntax in Razor and WebForm Views&lt;/span&gt;&lt;br /&gt;
 &lt;/span&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;Razor &lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;span&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;model.Message&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;span&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;Web Forms&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;span&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;%: model.Message %&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;span&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;Code expressions in Razor are always HTML encoded. This Web Forms syntax also automatically HTML encodes the value.&lt;br /&gt;&lt;br /&gt;What are Code Blocks in Views?&lt;br /&gt;&lt;br /&gt;Unlike
 code expressions that are evaluated and sent to the response, blocks of
 code are simply sections of code that are executed. They are useful for
 declaring variables that we may need to use later.&lt;br /&gt;&lt;br /&gt;Razor &lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@{&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; x = 123;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; y = Ëbecause.Ë;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;Web Forms &lt;br /&gt;&amp;lt;%&lt;br /&gt;int x = 123;&lt;br /&gt;string y = &quot;because.&quot;;&lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;What is the &quot;HelperPage.IsAjax&quot; Property?&lt;br /&gt;The HelperPage.IsAjax property gets a value that indicates whether Ajax is being used during the request of the Web page.&lt;br /&gt;&lt;br /&gt;Namespace: System.Web.WebPages&lt;br /&gt;Assembly: System.Web.WebPages.dll&lt;br /&gt;&lt;br /&gt;However, the same can be done by checking request headers directly:&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Request[&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white; line-height: 115%;&quot;&gt;&quot;X&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white; line-height: 115%;&quot;&gt;-Requested-With&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;] == &quot;XmlHttpRequest&quot;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Segoe UI&amp;quot;; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;Explain combining text and markup in Views using an example&lt;br /&gt;&lt;br /&gt;This example shows what intermixing text and markup looks like using Razor as compared to Web Forms:&lt;br /&gt;&lt;br /&gt;Razor &lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;foreach&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;var&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; item &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;in&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; items) {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;span&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Item &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;item.Name.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;span&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;Web Forms &lt;br /&gt;&amp;lt;% foreach (var item in items) { %&amp;gt;&lt;br /&gt;&amp;lt;span&amp;gt;Item &amp;lt;%: item.Name %&amp;gt;.&amp;lt;/span&amp;gt;&lt;br /&gt;&amp;lt;% } %&amp;gt;&lt;br /&gt;&lt;br /&gt;Explain Repository Pattern in ASP.NET MVC&lt;br /&gt;In
 simple terms, a repository basically works as a mediator between our 
business logic layer and our data access layer of the application. 
Sometimes it would be troublesome to expose the data access mechanism 
directly to the business logic layer, it may result in redundant code 
for accessing data for similar entities or it may result in code that is
 hard to test or understand. To overcome these kinds of issues, and to 
write interface driven and test driven code to access data, we use the 
Repository Pattern. The repository makes queries to the data source for 
the data then maps the data from the data source to a business 
entity/domain object and finally persists the changes in the business 
entity to the data source. According to MSDN, a repository separates the
 business logic from the interactions with the underlying data source or
 Web Service. The separation between the data and business tiers has the
 following three benefits:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;It centralizes the data logic or Web service access logic.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;It provides a substitution point for the unit tests.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;It provides a flexible architecture that can be adapted as the overall design of the application evolves.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;In
 a Repository we write our entire business logic of CRUD operations 
using Entity Framework classes that will not only result in meaningful 
test driven code but will also reduce our controller code of accessing 
data.&lt;br /&gt;&lt;br /&gt;How can you call a JavaScript function/method on the change of a Dropdown List in MVC?&lt;br /&gt;Create a JavaScript method:&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;script&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;=&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;function&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; selectedIndexChanged() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;script&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;Invoke the method:&lt;br /&gt;&lt;br /&gt;&amp;lt;%:Html.DropDownListFor(x =&amp;gt; x.SelectedProduct,&lt;br /&gt;new SelectList(Model.Users, &quot;Value&quot;, &quot;Text&quot;),&lt;br /&gt;&quot;Please Select a User&quot;, new { id = &quot;ddlUsers&quot;,&lt;br /&gt;onchange=&quot;selectedIndexChanged()&quot; })%&amp;gt;&lt;br /&gt;&lt;br /&gt;Explain Routing in MVC&lt;br /&gt;A
 route is a URL pattern that is mapped to a handler. The handler can be a
 physical file, such as an .aspx file in a Web Forms application. A 
Routing module is responsible for mapping incoming browser requests to 
specific MVC controller actions.&lt;br /&gt;&lt;br /&gt;Routing within the ASP.NET MVC framework serves the following two main purposes:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;It
 matches incoming requests that would not otherwise match a file on the 
file system and maps the requests to a controller action.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; font-weight: normal;&quot;&gt;It constructs outgoing URLs that correspond to controller actions.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;How is a route table created in ASP.NET MVC?&lt;br /&gt;When
 an MVC application first starts, the Application_Start() method in 
global.asax is called. This method calls the RegisterRoutes() method. 
The RegisterRoutes() method creates the route table for the MVC 
application.&lt;br /&gt;&lt;br /&gt;What are Layouts in ASP.NET MVC Razor?&lt;br /&gt;Layouts
 in Razor help maintain a consistent look and feel across multiple views
 within our application. Compared to Web Forms Web Forms, layouts serve 
the same purpose as master pages, but offer both a simpler syntax and 
greater flexibility.&lt;br /&gt;&lt;br /&gt;We can use a layout to define a common 
template for your site (or just part of it). This template contains one 
or more placeholders that the other views in your application provide 
content for. In some ways, it&#39;s like an abstract base class for your 
views. For example declared at the top of view as in the following:&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@{&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Layout = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&quot;~/Views/Shared/SiteLayout.cshtml&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;What is ViewStart?&lt;br /&gt;For group of views that all use the same layout, this can get a bit redundant and harder to maintain.&lt;br /&gt;&lt;br /&gt;The
 &quot;_ViewStart.cshtml&quot; page can be used to remove this redundancy. The 
code within this file is executed before the code in any view placed in 
the same directory. This file is also recursively applied to any view 
within a subdirectory.&lt;br /&gt;&lt;br /&gt;When we create a default ASP.NET MVC 
project, we find there is already a &quot;_ViewStart .cshtml&quot; file in the 
Views directory. It specifies a default layout as in the following:&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@{&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Layout = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&quot;~/Views/Shared/_Layout.cshtml&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;Because
 this code runs before any view, a view can override the Layout property
 and choose a different one. If a set of views shares common settings 
then the &quot;_ViewStart.cshtml&quot; file is a useful place to consolidate these
 common view settings. If any view needs to override any of the common 
settings then the view can set those values to another value.&lt;br /&gt;&lt;br /&gt;Note: Some of the content has been taken from various books/articles.&lt;br /&gt;&lt;br /&gt;What are HTML Helpers?&lt;br /&gt;&lt;br /&gt;HTML
 helpers are methods we can invoke on the Html property of a view. We 
also have access to URL helpers (via the URL property) and AJAX helpers 
(via the Ajax property). All&lt;br /&gt;these helpers have the same goal, to make views easy to author. The URL helper is also available from within the controller.&lt;br /&gt;&lt;br /&gt;Most
 of the helpers, particularly the HTML helpers, output HTML markup. For 
example, the BeginForm helper is a helper we can use to build a robust 
form tag for our search&lt;br /&gt;form, but without using lines and lines of code:&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;using&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; (Html.BeginForm(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;Search&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&quot;Home&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;, FormMethod.Get)) {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;input&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;=&quot;text&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;=&quot;q&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;/&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;input&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;type&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;=&quot;submit&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;value&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;=&quot;Search&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;What is Html.ValidationSummary?The
 ValidationSummary helper displays an unordered list of all validation 
errors in the ModelState dictionary. The Boolean parameter you are using
 (with a value of true) is telling the helper to exclude property-level 
errors. In other words, you are telling the summary to display only the 
errors in ModelState associated with the model itself, and exclude any 
errors associated with a specific model property. We will be displaying 
property-level errors separately. Assume you have the following code 
somewhere in the controller action rendering the edit view:&lt;br /&gt;&lt;br /&gt;ModelState.AddModelError(&quot;&quot;, &quot;This is all wrong!&quot;);&lt;br /&gt;ModelState.AddModelError(&quot;Title&quot;, &quot;What a terrible name!&quot;);&lt;br /&gt;&lt;br /&gt;The
 first error is a model-level error, because you didn&#39;t provide a key 
(or provided an empty key) to associate the error with a specific 
property. The second error you associated with the Title property, so in
 your view it will not display in the validation summary area (unless 
you remove the parameter to the helper method, or change the value to 
false). In this scenario, the helper renders the following HTML:&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;div&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;=&quot;validation-summary-errors&quot;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;ul&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;li&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;This is all wrong!&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;li&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;ul&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;div&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;Other overloads of the ValidationSummary helper enable you to provide header text and set specific HTML attributes.&lt;br /&gt;&lt;br /&gt;NOTE: By
 convention, the ValidationSummary helper renders the CSS class 
validation-summary-errors along with any specific CSS classes you 
provide. The default MVC project template includes some styling to 
display these items in red, that you can change in &quot;styles.css&quot;.&lt;br /&gt;&lt;br /&gt;What are Validation Annotations?&lt;br /&gt;Data
 annotations are attributes you can find in the 
&quot;System.ComponentModel.DataAnnotations&quot; namespace. These attributes 
provide server-side validation, and the framework also supports 
client-side validation when you use one of the attributes on a model 
property. You can use four attributes in the DataAnnotations namespace 
to cover the common validation scenarios, Required, String Length, 
Regular Expression and Range.&lt;br /&gt;&lt;br /&gt;What is Html.Partial?&lt;br /&gt;The
 Partial helper renders a partial view into a string. Typically, a 
partial view contains reusable markup you want to render from inside 
multiple different views. Partial has four overloads:&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Partial(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; partialViewName);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Partial(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; partialViewName, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; model);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Partial(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; partialViewName, ViewDataDictionary viewData);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; Partial(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; partialViewName, &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;object&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; model,&lt;br /&gt;ViewDataDictionary viewData);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;What is Html.RenderPartial?&lt;br /&gt;&lt;br /&gt;The
 RenderPartial helper is similar to Partial, but RenderPartial writes 
directly to the response output stream instead of returning a string. 
For this reason, you must place RenderPartial inside a code block 
instead of a code expression. To illustrate, the following two lines of 
code render the same output to the output stream:&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;@{&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Html.RenderPartial(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;AlbumDisplay&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt; &quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;); &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;br /&gt;@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Html.Partial(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt;&quot;AlbumDisplay&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;background: white;&quot;&gt; &quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;If they are same then which one to use?&lt;br /&gt;&lt;br /&gt;In
 general, you should prefer Partial to RenderPartial because Partial is 
more convenient (you don&#39;t need to wrap the call in a code block with 
curly braces). However, RenderPartial may result in better performance 
because it writes directly to the response stream, although it would 
require a lot of use (either high site traffic or repeated calls in a 
loop) before the difference would be noticeable.&lt;br /&gt;&lt;br /&gt;How do you return a partial view from controller?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0pt;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: &amp;quot;Segoe UI&amp;quot;;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; PartialView(options); &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background: white; font-family: Segoe UI;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;//options could be Model or View name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;What are various ways of returning a View?&lt;br /&gt;&lt;br /&gt;There
 are various ways for returning/rendering a view in MVC Razor. For 
example &quot;return View()&quot;, &quot;return RedirectToAction()&quot;, &quot;return 
Redirect()&quot; and &quot;return RedirectToRoute()&quot;.&lt;br /&gt;&lt;br /&gt;Conclusion&lt;br /&gt;I
 hope we covered many of questions to brush-up. Since MVC is very vast 
now, I know we have missed a lot stuff too. The content in the question 
and answer form is also taken from few renowned books like Professional 
ASP.NET MVC4 from Wrox and a few of the content is taken from my &lt;a href=&quot;http://www.c-sharpcorner.com/UploadFile/1492b1/introduction-to-mvc-architecture-and-separation-of-concerns/&quot;&gt;MVC articles&lt;/a&gt; posted earlier. My future articles will provide interview questions for EntityFramework too.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/h2&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
MVC means ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
MVC stands for Model View Controller.
&lt;br /&gt;
It divides an application into 3 component roles which is based on a framework methodology.
&lt;br /&gt;
These component roles are discussed briefly as follows:
&lt;br /&gt;
&lt;br /&gt;
i) Models : These component roles are used to maintain the state which is persisted inside the Database.
&lt;br /&gt;
&lt;br /&gt;
Example: we might have a Product class that is used to represent order data from the Products table inside SQL.
&lt;br /&gt;
&lt;br /&gt;
ii) Views : These component roles are used to display the user 
interface of the application, where this UI is created off of the model 
data.
&lt;br /&gt;
&lt;br /&gt;
Example: we might create an Product “Edit” view that surfaces 
textboxes, dropdowns and checkboxes based on the current state of a 
Product object.
&lt;br /&gt;
&lt;br /&gt;
iii) Controllers : These component roles are used for various 
purposes like handling end user interaction, manipulating the model, and
 ultimately choosing a view to render to display UI.
&lt;br /&gt;
&lt;br /&gt;
Note:
&lt;br /&gt;
&lt;br /&gt;
In a MVC application, the views are used only for displaying the 
information whereas the controllers are used for handling and responding
 to user input and interaction.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Which assembly is used to define the MVC framework and Why ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
The MVC framework is defined through System.Web.Mvc assembly. 
&lt;br /&gt;
This is because this is the only assembly which contains classes and
 interfaces that support the ASP.NET Model View Controller (MVC) 
framework for creating Web applications.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How can we plug an ASP.NET MVC into an existing ASP.NET application ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
We can combine ASP.NET MVC into an existing ASP.NET application by following the below procedure:
&lt;br /&gt;
&lt;br /&gt;
First of all, you have to add  a reference to the following three assemblies to your existing ASP.NET application:
&lt;br /&gt;
&lt;br /&gt;
i) System.Web.Routing
&lt;br /&gt;
ii) System.Web.Abstractions
&lt;br /&gt;
iii) System.Web.Mvc
&lt;br /&gt;
&lt;br /&gt;
The ASP.NET MVC folder should be created after adding these assembly references.
&lt;br /&gt;
Add the folder Controllers, Views, and Views | Shared to your existing ASP.NET application.
&lt;br /&gt;
And then you have to do the necessary changes in web.config file.
&lt;br /&gt;
For this you can refer to the below link:
&lt;br /&gt;
&lt;br /&gt;
http://www.packtpub.com/article/mixing-aspnet-webforms-and-aspnet-mvc&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What are the advantages of using asp.net mvc ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
The main advantages of using asp.net mvc are as follows:
&lt;br /&gt;
&lt;br /&gt;
i) One of the main advantage is that it will be easier to manage the
 complexity as the application is divided into model,view and 
controller.
&lt;br /&gt;
ii) It gives us the full control over the behavior of an application as it does not use view state or server-based forms.
&lt;br /&gt;
iii) It provides better support for test-driven development (TDD).
&lt;br /&gt;
iv) You can design the application with a rich routing 
infrastructure as it uses a Front Controller pattern that processes Web 
application requests through a single controller.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Explain about Razor View Engine ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
This Razor View engine is a part of new rendering framework for ASP.NET web pages.
&lt;br /&gt;
ASP.NET rendering engine uses opening and closing brackets to denote
 code (&amp;lt;% %&amp;gt;), whereas Razor allows a cleaner, implied syntax for 
determining where code blocks start and end.
&lt;br /&gt;
&lt;br /&gt;
Example:
&lt;br /&gt;
&lt;br /&gt;
In the classic renderer in ASP.NET: 
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;ul&amp;gt;

&amp;lt;% foreach (var userTicket in Model)

  { %&amp;gt;

    &amp;lt;li&amp;gt;&amp;lt;%: userTicket.Value %&amp;gt;&amp;lt;/li&amp;gt;

&amp;lt;%  } %&amp;gt;

&amp;lt;/ul&amp;gt; 
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
By using Razor: 
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;ul&amp;gt;

@foreach (var userTicket in Model)

{

  &amp;lt;li&amp;gt;@userTicket.Value&amp;lt;/li&amp;gt;

}

&amp;lt;/ul&amp;gt;&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Does the unit testing of an MVC application is possible without running controllers in an ASP.NET process ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
In an MVC application, all the features are based on interface. So, it is easy to unit test a MVC application.
&lt;br /&gt;
And it is to note that, in MVC application there is no need of running the controllers for unit testing.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Which namespace is used for ASP.NET MVC ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
System.Web.Mvc
 namespace contains all the interfaces and classes which supports 
ASP.NET MVC framework for creating web applications.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;adBorder&quot;&gt;
&lt;div data-format=&quot;728x90&quot; data-publisher=&quot;lqm.dotnetfunda.site&quot; data-tags=&quot;Mobile%2c+Android%2c+iPhone%2c+HTML+5%2c+CSS%2c+Web%2c+Javascript%2c+Agile%2c+SQL%2c+Virtualization%2c+Cloud%2c+Hosting%2c+%27Visual+Studio%27%2c+ASP.NET%2c+%27Windows+Phone%27+%2cSharePoint%2c+WPF%2c+Imaging%2c+XML%2c+Silverlight%2c+Testing%2c+Configuration%2c+RIA%2c+TFS%2c+%27Entity+Framework%27%2c+MVVM%2c+jQuery%2c+Prism%2c+MVC%2c+AJAX%2c+%27ASP.NET+MVC%27%2c+%27dependency+injection%27%2c+TDD%2c+DI&quot; data-type=&quot;ad&quot; data-zone=&quot;ron&quot;&gt;
&lt;iframe allowtransparency=&quot;false&quot; frameborder=&quot;0&quot; height=&quot;90&quot; id=&quot;dmad4&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; style=&quot;z-index: 10;&quot; width=&quot;728&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Can we share a view across multiple controllers ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Yes, It is possible to share a view across multiple controllers by putting a view into the shared folder.
&lt;br /&gt;
By doing like this, you can automatically make the view available across multiple controllers.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is the use of a controller in an MVC applicatio ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
A controller will decide what to do and what to display in the view. It works as follows:
&lt;br /&gt;
&lt;br /&gt;
i) A request will be received by the controller
&lt;br /&gt;
ii) Basing on the request parameters, it will decide the requested activities
&lt;br /&gt;
iii) Basing on the request parameters, it will delegates the tasks to be performed
&lt;br /&gt;
iv) Then it will delegate the next view to be shown&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Mention some of the return types of a controller action method ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
An action method is used to return an instance of any class which is derived from ActionResult class.
&lt;br /&gt;
Some of the return types of a controller action method are:
&lt;br /&gt;
i) ViewResult : It is used to return a webpage from an action method
&lt;br /&gt;
ii) PartialViewResult : It is used to send a section of a view to be rendered inside another view.
&lt;br /&gt;
iii) JavaScriptResult : It is used to return JavaScript code which will be executed in the user’s browser.
&lt;br /&gt;
iv) RedirectResult : Based on a URL, It is used to redirect to another controller and action method.
&lt;br /&gt;
v) ContentResult : It is an HTTP content type may be of text/plain. 
It is used to return a custom content type as a result of the action 
method.
&lt;br /&gt;
vi) JsonResult : It is used to return a message which is formatted as JSON.
&lt;br /&gt;
vii) FileResult : It is used to send binary output as the response.
&lt;br /&gt;
viii) EmptyResult : It returns nothing as the result.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Explain about &#39;page lifecycle&#39; of ASP.NET MVC ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
The page lifecycle of an ASP.NET MVC page is explained as follows:
&lt;br /&gt;
&lt;br /&gt;
i) App Initialisation
&lt;br /&gt;
In this stage, the aplication starts up by running Global.asax’s Application_Start() method.
&lt;br /&gt;
In this method, you can add Route objects to the static RouteTable.Routes collection.
&lt;br /&gt;
If you’re implementing a custom IControllerFactory, you can set this
 as the active controller factory by assigning it to the 
System.Web.Mvc.ControllerFactory.Instance property.
&lt;br /&gt;
&lt;br /&gt;
ii) Routing
&lt;br /&gt;
Routing is a stand-alone component that matches incoming requests to IHttpHandlers by URL pattern. 
&lt;br /&gt;
MvcHandler is, itself, an IHttpHandler, which acts as a kind of proxy to other IHttpHandlers configured in the Routes table.
&lt;br /&gt;
&lt;br /&gt;
iii) Instantiate and Execute Controller
&lt;br /&gt;
At this stage, the active IControllerFactory supplies an IController instance.
&lt;br /&gt;
&lt;br /&gt;
iv) Locate and invoke controller action
&lt;br /&gt;
At this stage, the controller invokes its relevant action method, which after further processing, calls RenderView().
&lt;br /&gt;
&lt;br /&gt;
v) Instantiate and render view
&lt;br /&gt;
At this stage, the IViewFactory supplies an IView, which pushes response data to the IHttpResponse object.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Explain about NonActionAttribute ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
It is already known that all the public methods of a controller class are basically treated as action methods.
&lt;br /&gt;
If you dont want this default behaviour, then you can change the 
public method with NonActionAttribute. Then, the default behaviour 
changes.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Explain about the formation of Router Table in ASP.NET MVC ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
The Router Table is formed by following the below procedure:
&lt;br /&gt;
&lt;br /&gt;
In the begining stage, when the ASP.NET application starts, the method known as Application_Start() method is called.
&lt;br /&gt;
The Application_Start() will then calls RegisterRoutes() method.
&lt;br /&gt;
This RegisterRoutes() method will create the Router table.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
In an MVC application, what are the segments of the default route ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
There are 3 segments of the default route in an MVC application.They are:
&lt;br /&gt;
&lt;br /&gt;
The 1st segment is the Controller Name.
&lt;br /&gt;
Example: search
&lt;br /&gt;
&lt;br /&gt;
The 2nd segment is the Action Method Name.
&lt;br /&gt;
Example: label
&lt;br /&gt;
&lt;br /&gt;
The 3rd segment is the Parameter passed to the Action method.
&lt;br /&gt;
Example: Parameter Id - MVC&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What are the settings to be done for the Routing to work properly in an MVC application ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
The settings must be done in 2 places for the routing to work properly.They are:
&lt;br /&gt;
&lt;br /&gt;
i) Web.Config File : In the web.config file, the ASP.NET routing has to be enabled.
&lt;br /&gt;
ii) Global.asax File : The Route table is created in the application Start event handler, of the Global.asax file.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How to avoid XSS Vulnerabilities in ASP.NET MVC ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
To
 avoid xss vulnerabilities, you have to use the syntax as &#39;&amp;lt;%: %&amp;gt;&#39;
 in ASP.NET MVC instead of using the syntax as &#39;&amp;lt;%=   %&amp;gt;&#39; in .net 
framework 4.0.
&lt;br /&gt;
This is because it does the HTML encoding.
&lt;br /&gt;
&lt;br /&gt;
Example:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;input type=&quot;text&quot; value=&quot;&amp;lt;%: value%&amp;gt;&quot; /&amp;gt;&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Explain the advantages of using routing in ASP.NET MVC ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Without
 using Routing in an ASP.NET MVC application, the incoming browser 
request should be mapped to a physical file.The thing is that if the 
file is not there, then you will get a page not found error.
&lt;br /&gt;
By using Routing, it will make use of URLs where there is no need of mapping to specific files in a web site.
&lt;br /&gt;
This is because, for the URL, there is no need to map to a file, you
 can use URLs that are descriptive of the user&#39;s action and therefore 
are more easily understood by users.&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What are the things that are required to specify a route ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
There are 3 things that are required to specify a route.
&lt;br /&gt;
&lt;br /&gt;
i) URL Pattern : You can pass the variable data to the request 
handler without using a query string. This is done by including 
placeholders in a URL pattern.
&lt;br /&gt;
ii) Handler : This handler can be a physical file of 2 types such as a .aspx file or a controller class.
&lt;br /&gt;
iii) Name for the Route : This name is an optional thing.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;contentPanel&quot;&gt;
&lt;div class=&quot;pageHeadingTop&quot; style=&quot;display: table; width: 100%;&quot;&gt;
&lt;div style=&quot;display: table-row;&quot;&gt;
&lt;div style=&quot;display: table-cell; vertical-align: bottom; width: 345px;&quot;&gt;
&lt;div class=&quot;moreMenu&quot; id=&quot;divCatSecMenu&quot; style=&quot;min-width: 120px;&quot;&gt;
&lt;div style=&quot;white-space: nowrap;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;display: table-cell; text-align: right; width: auto;&quot;&gt;
&lt;a href=&quot;http://feeds2.feedburner.com/DotnetfundaInterviewQuestions&quot; title=&quot;Subscribe to Interview Questions RSS Feed&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.feedburner.com/fb/images/pub/feed-icon16x16.png&quot; style=&quot;border: 0; vertical-align: middle;&quot; /&gt; &lt;img alt=&quot;&quot; src=&quot;http://feeds2.feedburner.com/~fc/DotnetfundaInterviewQuestions?bg=EB7F30&amp;amp;fg=000000&amp;amp;anim=0&quot; style=&quot;border: 0; margin-right: 3px; vertical-align: middle;&quot; width=&quot;88&quot; /&gt;&lt;/a&gt;
            
            &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sectionHeading&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;sectionContent&quot;&gt;
&lt;div class=&quot;sectionText&quot;&gt;
&lt;div class=&quot;table&quot;&gt;
&lt;div class=&quot;tr0&quot;&gt;
&lt;div class=&quot;td0&quot; style=&quot;text-align: right;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;spacer&quot;&gt;
&lt;span class=&quot;errorMessage&quot; id=&quot;CPContent_lblError&quot;&gt;&lt;/span&gt;
    &lt;br /&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Is the route {controller}{action}/{id} a valid route definition or not and why ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
{controller}{action}/{id} is not a valid route definition.
&lt;br /&gt;
The reason is that, it has no literal value or delimiter between the placeholders.
&lt;br /&gt;
If there is no literal, the routing cannot determine where to 
seperate the value for the controller placceholder from the value for 
the action placeholder.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Explain about default route, {resource}.axd/{*pathInfo} ...&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
With
 the help of this default route {resource}.axd/{*pathInfo}, you can 
prevent requests for the web resources files such as WebResource.axd or 
ScriptResource.axd from being passed to a controller.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Explain the difference between adding routes, to a web application and to an mvc application ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
We
 use MapPageRoute() method of a RouteCollection class for adding routes 
to a webforms application, whereas MapRoute() method is used to add 
routes to an MVC application.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Is there any way to handle variable number of segments in a route definition ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
You can handle variable number of segments in a route definition by using a route with a catch-all parameter.
&lt;br /&gt;
Example:
&lt;br /&gt;
&lt;br /&gt;
controller/{action}/{*parametervalues}
&lt;br /&gt;
&lt;br /&gt;
Here * reffers to catch-all parameter.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How do you add constraints to a route ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
There are 2 ways for adding constraints to a route. They are:
&lt;br /&gt;
i) By using Regular Expressions and
&lt;br /&gt;
ii) By using an object which implements IRouteConstraint interface.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Explain with examples for scenarios when routing is not applied ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Below are the 2 scenarios where routing is not applied.
&lt;br /&gt;
&lt;br /&gt;
i) A Physical File is Found that Matches the URL Pattern - This 
default behaviour can be overriden by setting the RouteExistingFiles 
property of the RouteCollection object to true.
&lt;br /&gt;
ii) Routing Is Explicitly Disabled for a URL Pattern - By using the 
RouteCollection.Ignore() method, you can prevent routing from handling 
certain requests.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Explain the usage of action filters in an MVC application ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Action
 filter in an mvc application is used to perform some additional 
processing, such as providing extra data to the action method, 
inspecting the return value, or canceling execution of the action 
method.
&lt;br /&gt;
Action filter is an attribute that implements the abstract FilterAttribute class.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
In an MVC application, which filter executes first and which is the last ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
As
 there are different types of filters in an MVC application, the 
Authorization filter is the one which executes first and Exeption 
filters executes in the end.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Difference between Viewbag and Viewdata in ASP.NET MVC ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Both are used to pass the data from controllers to views.
&lt;br /&gt;
The difference between Viewbag and Viewdata in ASP.NET MVC is explained below:
&lt;br /&gt;
&lt;br /&gt;
View Data:
&lt;br /&gt;
In this, objects are accessible using strings as keys.
&lt;br /&gt;
&lt;br /&gt;
Example:
&lt;br /&gt;
&lt;br /&gt;
In the Controller:
&lt;br /&gt;
public ActionResult Index()
&lt;br /&gt;
{
&lt;br /&gt;
var softwareDevelopers = new List&amp;lt;string&amp;gt;
&lt;br /&gt;
{
&lt;br /&gt;
&quot;Brendan Enrick&quot;,
&lt;br /&gt;
&quot;Kevin Kuebler&quot;,
&lt;br /&gt;
&quot;Todd Ropog&quot;
&lt;br /&gt;
};    
&lt;br /&gt;
ViewData[&quot;softwareDevelopers&quot;] = softwareDevelopers;
&lt;br /&gt;
return View();
&lt;br /&gt;
}
&lt;br /&gt;
&lt;br /&gt;
In the View:
&lt;br /&gt;
&amp;lt;ul&amp;gt;
&lt;br /&gt;
@foreach (var developer in (List&amp;lt;string&amp;gt;)ViewData[&quot;softwareDevelopers&quot;])
&lt;br /&gt;
{
&lt;br /&gt;
&amp;lt;li&amp;gt;
&lt;br /&gt;
@developer
&lt;br /&gt;
&amp;lt;/li&amp;gt;
&lt;br /&gt;
}
&lt;br /&gt;
&amp;lt;/ul&amp;gt;
&lt;br /&gt;
&lt;br /&gt;
An important note is that when we go to use out object on the view 
that we have to cast it since the ViewData is storing everything as 
object.
&lt;br /&gt;
&lt;br /&gt;
View Bag:
&lt;br /&gt;
It will allow the objectto dynamically have the properties add to it.
&lt;br /&gt;
&lt;br /&gt;
Example:
&lt;br /&gt;
&lt;br /&gt;
In the Controller:
&lt;br /&gt;
public ActionResult Index()
&lt;br /&gt;
{
&lt;br /&gt;
var softwareDevelopers = new List&amp;lt;string&amp;gt;
&lt;br /&gt;
{
&lt;br /&gt;
&quot;Brendan Enrick&quot;,
&lt;br /&gt;
&quot;Kevin Kuebler&quot;,
&lt;br /&gt;
&quot;Todd Ropog&quot;
&lt;br /&gt;
};
&lt;br /&gt;
ViewBag.softwareDevelopers = softwareDevelopers;
&lt;br /&gt;
return View();
&lt;br /&gt;
}
&lt;br /&gt;
&lt;br /&gt;
In the View:
&lt;br /&gt;
&amp;lt;ul&amp;gt;
&lt;br /&gt;
@foreach (var developer in ViewBag.softwareDevelopers)
&lt;br /&gt;
{
&lt;br /&gt;
&amp;lt;li&amp;gt;
&lt;br /&gt;
@developer
&lt;br /&gt;
&amp;lt;/li&amp;gt;
&lt;br /&gt;
}
&lt;br /&gt;
&amp;lt;/ul&amp;gt;
&lt;br /&gt;
&lt;br /&gt;
An important point to note is that there is no need to cast our 
object when using the ViewBag. This is because the dynamic we used lets 
us know the type.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;adBorder&quot;&gt;
&lt;div data-format=&quot;728x90&quot; data-publisher=&quot;lqm.dotnetfunda.site&quot; data-tags=&quot;Mobile%2c+Android%2c+iPhone%2c+HTML+5%2c+CSS%2c+Web%2c+Javascript%2c+Agile%2c+SQL%2c+Virtualization%2c+Cloud%2c+Hosting%2c+%27Visual+Studio%27%2c+ASP.NET%2c+%27Windows+Phone%27+%2cSharePoint%2c+WPF%2c+Imaging%2c+XML%2c+Silverlight%2c+Testing%2c+Configuration%2c+RIA%2c+TFS%2c+%27Entity+Framework%27%2c+MVVM%2c+jQuery%2c+Prism%2c+MVC%2c+AJAX%2c+%27ASP.NET+MVC%27%2c+%27dependency+injection%27%2c+TDD%2c+DI&quot; data-type=&quot;ad&quot; data-zone=&quot;ron&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What are the file extensions for razor views ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
There are two types of file extensions for razor views.
&lt;br /&gt;
They are:
&lt;br /&gt;
&lt;br /&gt;
i) .cshtml : This file extension is used, when the programming language is a C#.
&lt;br /&gt;
ii) .vbhtml : This file extension is used, when the programming language is a VB.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How can you specify comments using razor syntax ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
In razor syntax, we use the below shown symbols for specifying comments.
&lt;br /&gt;
&lt;br /&gt;
i) For indicating the begining of a comment, we use @* syntax.
&lt;br /&gt;
ii) For indicating the end of a comment, we use *@ syntax.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Explain the usage of validation helpers in ASP.NET MVC ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
In ASP.NET MVC, validation helpers are used to show the validation error messages in a view.
&lt;br /&gt;
The Html.ValidationMessage() and Html.ValidationSummary() helpers 
are used in the automatically generated Edit and Create views by the 
ASP.NET MVC.
&lt;br /&gt;
To create a view, the following steps are to be followed:
&lt;br /&gt;
&lt;br /&gt;
i) In the product controller,right click on the Create() action and then select the option Add View.
&lt;br /&gt;
ii) Now check the checkbox labeled in the Add View dialog and create a strongly-typed view.
&lt;br /&gt;
iii) Select the product class from the View data class dropdownlist.
&lt;br /&gt;
iv) Now, select Create from the view content dropdownlist.
&lt;br /&gt;
v) Finally, click on the Add button.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Is it possible to create a MVC Unit Test application in Visual Studio Standard ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
No, It is not possible to create a MVC Unit Test application in Visual Studio Standard.
&lt;br /&gt;
It is also not possible to create in Visual Studio Express.
&lt;br /&gt;
It is possible to create only in Visual Studio Professional and Visual Studio Enterprise Versions.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is Glimpse ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
It
 is an Open Source platform for gathers and presents detailed diagnostic
 information about the execution of your web application.It tells you 
exactly what&#39;s going on with each request.
&lt;br /&gt;
&lt;br /&gt;
We used in a similar manner to client side diagnostics and debugging tools like FireBug or Chrome Developer Tools.
&lt;br /&gt;
&lt;br /&gt;
It is used to reveal what is happening within your ASP.NET MVC and WebForms sites.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What are the HTML attributes that have to specify in @Html.BeginForm()?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span class=&quot;fadeTextS&quot;&gt;NOTE: This is objective type question, Please click question title for correct answer.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is the difference between Session and TempData in MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span class=&quot;fadeTextS&quot;&gt;NOTE: This is objective type question, Please click question title for correct answer.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How to enable JQuery intellisense support in MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
By
 default, visual studio doesn&#39;t provide Jquery intellisense support, but
 it can be achieved by adding vsdoc.js file to razor view.
&lt;br /&gt;
&lt;br /&gt;
@if(false)
&lt;br /&gt;
{
&lt;br /&gt;
&amp;lt;script src=&quot;~/script/jquery-1.7.1-vsdoc.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;
&lt;br /&gt;
}
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;u&gt;No&lt;/u&gt; te &lt;/u&gt; : If statement prevents the rendering of script
 tag into the Html source code and it used only by visual studio for 
Jquery intellisense support.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Difference between Asp.Net MVC and Webforms?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
1. Asp.net Webform follows an event-driven development model whereas Asp.net Mvc follow Model, View, Controller design pattern.
&lt;br /&gt;
&lt;br /&gt;
2. Asp.net Webform has server controls whereas Asp.net Mvc has Html helpers for creating UI of application.
&lt;br /&gt;
&lt;br /&gt;
3.Asp.net Webforms has state management techniques whereas Asp.net Mvc doesn&#39;t have automatic state management techniques.
&lt;br /&gt;
&lt;br /&gt;
4. Asp.net Webform has file- based Urls means file name exists in Url whereas  Asp.net Mvc has route-based Url.
&lt;br /&gt;
&lt;br /&gt;
5. In Asp.net webform, webforms(Aspx) are tightly 
coupled to code-behind (Aspx.cs) whereas in Asp.net Mvc, Views and logic
 are kept separately.
&lt;br /&gt;
&lt;br /&gt;
6. Asp.net Webform has Master page for consistent look and feel whereas in Asp.net Mvc layout is for this.
&lt;br /&gt;
&lt;br /&gt;
7. Asp.net Webform has User Controls for code re-usability whereas in Asp.net Mvc partial view is for this.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is partial view in Asp.Net Mvc?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
A
 partial view is like as user control in Asp.Net web form. Partial views
 are reusable views like as Header and Footer. It has .csHtml extension.
&lt;br /&gt;
Partial and RenderPartial  Html method renders partial view in Mvc razor.
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;@Html.Partial(&quot;_Comments&quot;)&amp;lt;/div&amp;gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;@ { Html.RenderPartial(&quot;_Comments&quot;) } &amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is strongly typed view in MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Strongly
 type view is used for rendering specific type of model object. By 
specifying the type of data we get intellisense for that model class. 
View inherits from Viewpage whereas strongly typed view inherits from 
Viewpage&amp;lt;T&amp;gt; where T is type of the model.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is significance of &#39;using&#39; in MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
@using(Html.Beginform())
&lt;br /&gt;
{
&lt;br /&gt;
Content Here.....
&lt;br /&gt;
}
&lt;br /&gt;
It ensures that an object is disposed when it goes out of scope.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How to add stylesheet in view in Asp.Net Mvc?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Add stylesheet :
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;link rel=&quot;StyleSheet&quot; href=&quot;@Href(~Content/Site.css&quot;)&quot; type=&quot;text/css&quot;/&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is MvcSiteMapProvider ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
It
 is a tool that provides flexible menus, breadcrumb trails, and SEO 
features for the .NET MVC framework, similar to the ASP.NET 
SiteMapProvider model.
&lt;br /&gt;
&lt;br /&gt;
You can download it as free through NuGet package for .NET MVC 2.0/3.0/4.0&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How to call an action Method on the click of a link?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span class=&quot;fadeTextS&quot;&gt;NOTE: This is objective type question, Please click question title for correct answer.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is right way to define the routes.MapRoute() method in MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span class=&quot;fadeTextS&quot;&gt;NOTE: This is objective type question, Please click question title for correct answer.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is cross site request forgery (CSRF) in web application?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Cross
 Site Request Forgery (CSRF) is a type of attack on the web application 
or on the website where a malicious user can insert or update data on 
behalf of the logged in user of the application by giving him a link 
that is not of the victim website but attackers own website.
&lt;br /&gt;
&lt;br /&gt;
In this type of attack the victim website user doesn&#39;t know that by 
clicking on malicious user link he is helping him to update malicious 
data into his website.
&lt;br /&gt;
&lt;br /&gt;
This generally happen by posting data on the victim website by a 
hidden form and submitting in using JavaScript or jQuery automatically.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How to avoid Cross Site Request Forgery (CSRF) in ASP.NET MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
To avoid Cross Site Request Forgery (CSRF) in ASP.NET MVC, you need to do two things.
&lt;br /&gt;
&lt;br /&gt;
1. Add [ValidateAntiForgeryTocker] attribute in the Controller Action method which is executing when the form data is being submitted.
&lt;br /&gt;
&lt;br /&gt;
2. Add @Html.AntiForgeryTocker() element in the HTML form.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What different types of Scaffold templates are there in ASP.NET MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
There
 are 6 different types of Scaffold templates in ASP.NET MVC that is used
 to create a view automatically based on the Model selected.
&lt;br /&gt;
&lt;br /&gt;
Empty: 
&lt;br /&gt;
It creates an empty view and only model type is specified in the View page using @model
&lt;br /&gt;
&lt;br /&gt;
Create: 
&lt;br /&gt;
It creates a view with a form that helps to create a new record for 
the model. It automatically generates a label and input field for each 
property in the Model.
&lt;br /&gt;
&lt;br /&gt;
Delete :  
&lt;br /&gt;
It creates a view with the list of records from the Model collection along with Delete link to delete records.
&lt;br /&gt;
&lt;br /&gt;
Details: 
&lt;br /&gt;
It creates a view that displays a lable and the value of each property of the Model.
&lt;br /&gt;
&lt;br /&gt;
Edit 
&lt;br /&gt;
It creates a view with a form for editing existing model data. It 
also generates a form with label and field for each property of the 
Model.
&lt;br /&gt;
&lt;br /&gt;
List: 
&lt;br /&gt;
It creates a view with html table that lists the model from the 
Model collection. It generates html table column for each property of 
the model. In general, it accepts IEnumerable&amp;lt;ModelType&amp;gt; and 
iterate through each item of the Enumerable collection. It automatically
 renders edit, delete links for each record of the Model collection in a
 column and Create link on the page that target to Create action.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is the use of ViewStart in ASP.NET MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
In
 the default template of ASP.NET MVC, we get _ViewStart.cshtml page that
 is used to almost similar to MasterPage in ASP.NET Web Form or like a 
layout template.
&lt;br /&gt;
&lt;br /&gt;
The code of ViewStart executes before the actual view code executes.
 By default, _ViewStart template is applied to all view files of this or
 any sub directory under this directory.
&lt;br /&gt;
&lt;br /&gt;
The _ViewStart.cshtml file contains following code.
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;@{

Layout = &quot;~/Views/Shared/_Layout.cshtml&quot;;

}&lt;/pre&gt;
&lt;br /&gt;
As this code runs before any view code so we have flexibility to specify a different Layout for a particular view.
&lt;br /&gt;
&lt;br /&gt;
Because this code runs before any view, a view can override the Layout property and choose a different
&lt;br /&gt;
one.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;adBorder&quot;&gt;
&lt;div data-format=&quot;728x90&quot; data-publisher=&quot;lqm.dotnetfunda.site&quot; data-tags=&quot;Mobile%2c+Android%2c+iPhone%2c+HTML+5%2c+CSS%2c+Web%2c+Javascript%2c+Agile%2c+SQL%2c+Virtualization%2c+Cloud%2c+Hosting%2c+%27Visual+Studio%27%2c+ASP.NET%2c+%27Windows+Phone%27+%2cSharePoint%2c+WPF%2c+Imaging%2c+XML%2c+Silverlight%2c+Testing%2c+Configuration%2c+RIA%2c+TFS%2c+%27Entity+Framework%27%2c+MVVM%2c+jQuery%2c+Prism%2c+MVC%2c+AJAX%2c+%27ASP.NET+MVC%27%2c+%27dependency+injection%27%2c+TDD%2c+DI&quot; data-type=&quot;ad&quot; data-zone=&quot;ron&quot;&gt;
&lt;iframe allowtransparency=&quot;false&quot; frameborder=&quot;0&quot; height=&quot;90&quot; id=&quot;dmad4&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; style=&quot;z-index: 10;&quot; width=&quot;728&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How to write dashed attributes of html (5) element using ASP.NET MVC Helper methods?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
To
 write dashed attribute of HTML element using ASP.NET MVC Helper 
methods, we replace &quot;-&quot; with &quot;_&quot; in the anonymous type parameter. eg.
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;@using (Html.BeginForm(&quot;Create&quot;, &quot;Home&quot;, FormMethod.Post,

new { data_validatable=true }))
&lt;/pre&gt;
&lt;br /&gt;
returns below output
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;form action=&quot;/Home/Create&quot; method=&quot;Post&quot; data-validatable=&quot;true&quot; &amp;gt;&lt;/pre&gt;
&lt;br /&gt;
Notice, the data-validate attribute of the form element.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is the use of Html.ValidationSummary helper method in ASP.NET MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
The
 Html.ValidationSummary helper method is used to display all validation 
errors in the ModelState dictionary, either model property level or 
errors associated with ModelState.
&lt;br /&gt;
&lt;br /&gt;
Model Property level errors  are errors that are set as an attributes of the property of the Model. eg
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;[Required]

[StringLength(100, ErrorMessage=&quot;The Title must not be more than 100 characters long.&quot;)]

public string Title { get; set; }&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
In the above code, the Title field is a mandatory field and can only accept 100 characters.
&lt;br /&gt;
&lt;br /&gt;
The ModelState level errors  are errors that are set by developer in the Controller by using below code snippet.
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;ModelState.AddModelError(&quot;&quot;, &quot;There is an error!&quot;);
&lt;/pre&gt;
&lt;br /&gt;
In this case, the error will be displayed in place of Validation summary like this
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&amp;lt;div class=&quot;validation-summary-errors&quot;&amp;gt;

&amp;lt;ul&amp;gt;

&amp;lt;li&amp;gt;There is an error!&amp;lt;/li&amp;gt;

&amp;lt;/ul&amp;gt;

&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What should be the attribute for a Model property that corresponds to the Identity column of the database?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
The
 attribute in the Model field for the Identity column of the database 
should be 
DatabaseGenerated(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity)
 like below
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;[Key]

[DatabaseGenerated(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Identity)] 

[Required]

public int CategoryId { get; set; }&lt;/pre&gt;
&lt;br /&gt;
Thanks&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
In case we are returning anonymous type from Controller to the views, what should be the @model in the View?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span class=&quot;fadeTextS&quot;&gt;NOTE: This is objective type question, Please click question title for correct answer.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
MVC is a framework pattern that splits an application logic into three different roles: Model, View and Controller.
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Model:&lt;/u&gt;   Business entity on which overall 
application operates.MVC does not specifically mention the Data access 
layer as it is encapsulated by the model.
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;View:&lt;/u&gt;   User interface that renders the model into a form of interaction.
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Controller: &lt;/u&gt;  Handles the request from the view and updates the model resulting in a change in model&#39;s state.
&lt;br /&gt;
&lt;br /&gt;
These are the three important classes(model, view and controller) required for MVC architecture.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What does Separation of concerns means?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
The process of breaking a computer program into various features that overlap in functionality implies Separation of concerns.
&lt;br /&gt;
MVC separates the content from presentation and data-processing from content.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is ViewStart in MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
For group of views that all use the same layout, this can get a bit redundant and harder to maintain.
&lt;br /&gt;
The _ViewStart.cshtml page can be used to remove this redundancy. The code within this file
&lt;br /&gt;
is executed before the code in any view placed in the same 
directory. This fi le is also recursively applied to any view within a 
subdirectory.
&lt;br /&gt;
When we create a default ASP.NET MVC project, we find there is already a _ViewStart
&lt;br /&gt;
.cshtml fi le in the Views directory. It specifi es a default layout:
&lt;br /&gt;
@{
&lt;br /&gt;
Layout = &quot;~/Views/Shared/_Layout.cshtml&quot;;
&lt;br /&gt;
}
&lt;br /&gt;
Because this code runs before any view, a view can override the 
Layout property and choose a different one. If a set of views shares 
common settings, the _ViewStart.cshtml file is a useful place to 
consolidate these common view settings. If any view needs to override 
any of the common settings, the view can set those values to another 
value.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How will the data gets passed between controller and views?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
The
 controller gets the first hit and loads the model. Most of the time we 
would like to pass the model to the view for displaying data and so we 
use session variables, viewstate and so on. But the problem with using 
sessions or view state object is the scope. ASP.NET sessions have 
session scope and the view state have page scope. In MVC, we would like 
the data to be maintained  when the hit comes to the controller and 
reaches the view and after that the scope of the data should expire.
&lt;br /&gt;
&lt;br /&gt;
That’s where the new session management technique has been introduced in the ASP.NET MVC framework, i.e., ViewData.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How to save data entered from front-end into a pdf file?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
[HttpPost]
&lt;br /&gt;
public ActionResult SaveResumeAsPdf(FormCollection fc)
&lt;br /&gt;
{
&lt;br /&gt;
if (Session[&quot;UserName&quot;] != null)
&lt;br /&gt;
{
&lt;br /&gt;
BaseFont font = BaseFont.CreateFont(BaseFont.COURIER, BaseFont.CP1250, false);
&lt;br /&gt;
PdfContentByte _pcb;
&lt;br /&gt;
Document document = new Document();
&lt;br /&gt;
try
&lt;br /&gt;
{
&lt;br /&gt;
PdfWriter writer = 
PdfWriter.GetInstance(document, new 
FileStream(Server.MapPath(&quot;~/Resumes/&quot; + Session[&quot;UserName&quot;] + &quot;.pdf&quot;), 
FileMode.Create));
&lt;br /&gt;
document.Open();
&lt;br /&gt;
_pcb = writer.DirectContent;
&lt;br /&gt;
_pcb.BeginText();
&lt;br /&gt;
_pcb.SetFontAndSize(font, 14);
&lt;br /&gt;
int count = 30;
&lt;br /&gt;
foreach (string item in fc.AllKeys)
&lt;br /&gt;
{
&lt;br /&gt;
_pcb.ShowTextAligned(PdfContentByte.ALIGN_LEFT, item, 50, 780 - count, 0);
&lt;br /&gt;
_pcb.ShowTextAligned(PdfContentByte.ALIGN_LEFT, fc[item], 250, 780 - count, 0);
&lt;br /&gt;
count = count + 30;
&lt;br /&gt;
}
&lt;br /&gt;
_pcb.EndText();
&lt;br /&gt;
writer.Flush();
&lt;br /&gt;
}
&lt;br /&gt;
finally
&lt;br /&gt;
{
&lt;br /&gt;
document.Close();
&lt;br /&gt;
}
&lt;br /&gt;
}
&lt;br /&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How to use two models in a single class?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Whenever you want to use two models in a single view, then add the models to the view in the following way,
&lt;br /&gt;
&lt;br /&gt;
@using MvcSampleCFA_02032014.Models;
&lt;br /&gt;
@model Tuple&amp;lt;PersonCFA, AddressCFA&amp;gt;
&lt;br /&gt;
&lt;br /&gt;
Now, you can access all the properties present in the two models.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Why do we use Repositories?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Repositories
 are minly used in MVC. It does not mean creating the database by itself
 or storing the data anywhere. It is just an approach in MVC. As we have
 n-tier architecture in asp.net, similarly repositories are a kind of 
architecture in MVC where we can create a repository class and write all
 the business logic in this class. We can just call this method from 
controller and there is no need to write any kind of business logic 
which makes our controller simple.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
Which of the following statement is true with respect to MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span class=&quot;fadeTextS&quot;&gt;NOTE: This is objective type question, Please click question title for correct answer.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is the output for the expression,
string[] colors = {&quot;green&quot;, &quot;brown&quot;, &quot;red&quot;, &quot;blue&quot;};
colors.Max(c =&amp;gt; c.length);&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span class=&quot;fadeTextS&quot;&gt;NOTE: This is objective type question, Please click question title for correct answer.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
How can we use css files in mvc application?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Normally, I would put most of general layout related css into content/style.css
&lt;br /&gt;
&lt;br /&gt;
If you use theme, then put it into content/theme/{themename}/style.css
&lt;br /&gt;
If you create custom html control, i would try to create another css file for control and put it under content/control.css
&lt;br /&gt;
In most of time, jquery is used in the asp.net MVC, so it make sense to put it&#39;s css in Script/jquery/{pluginName}/xxx.css
&lt;br /&gt;
There could be more, but that&#39;s what&#39;s in my head now.
&lt;br /&gt;
&lt;br /&gt;
Splitting the css into multiple files is a good thing from a 
maintenace point of view. It makes it easier to work with and apply 
changes. However, multiple files can have an impact on application 
performance as the browser has to download each file individually. You 
can haev the best of both worlds though.
&lt;br /&gt;
&lt;br /&gt;
The technique that is recommended is to bundle all your html files 
for deployment so that it is served as 1 single file. The nice thing 
about this approach is that it lets you develop with multiple files, 
giving you ease of use. But get on the fly css file combination so that 
your browser only has to download one file.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
What is used for Code-Reusability in Asp.Net Mvc ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
Business Layer in Asp.Net Mvc is also known as ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
Display Layer in Asp.Net Mvc is also known as ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
Input Control in Asp.Net Mvc is also known as ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net Mvc, the property that provides access to the route data structure for current request is ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
Who introduced first MVC to the world ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC &#39;ActionResults&#39;, which Result is used to return a string literally ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC &#39;ActionResults&#39;, which Result is used to return the contents of a file ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC &#39;ActionResults&#39;, which Result is used to return a script to execute ?&lt;/span&gt;&lt;/h2&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC &#39;ActionResults&#39;, which Result is used to return the data in JSON format ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC &#39;ActionResults&#39;, which Result is used to Redirect the client to a new Url ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC &#39;ActionResults&#39;, which Result is used to return an HTTP 403 status ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC &#39;ActionResults&#39;, which Result is used to Redirect client to another action or another controller&#39;s action ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC &#39;ActionResults&#39;, the Result responsible for the View Engine&#39;s response ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC &#39;ActionResults&#39;, the Result used to get no response ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Action Filter used to cache the output of a controller is ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;fadeTextS&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span class=&quot;fadeTextS&quot; style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Html helper used to create a &#39;form&#39; tag is ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;span class=&quot;fadeTextS&quot; style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span class=&quot;fadeTextS&quot; style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Html helper used to render the Checkbox in Razor is ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;span class=&quot;fadeTextS&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span class=&quot;fadeTextS&quot; style=&quot;font-weight: normal;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;
In Asp.Net MVC, the Html helper used to render the RadioButton control in Razor is ?&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;span class=&quot;fadeTextS&quot;&gt;
&lt;/span&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span class=&quot;fadeTextS&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Html helper used to render a DropDown list in Razor is ?&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;span class=&quot;fadeTextS&quot;&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Html helper used to create the &#39;password&#39; type input is ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Html helper used to create an input with &#39;hidden&#39; type is ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Html helper used to render a simple Textbox in Razor view is ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Html helper used to render a large text space in Razor view is ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, Html helper used for creating a Listbox in Razor view is ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Html helper used to reuse the partial view&#39;s code in Razor is ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Html helper that allows to setup a sub request inside of the primary Mvc request is ?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In
 Asp.Net MVC, the Entity framework approach that can import the database
 and generate all the classes you need to query and update the database ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In
 Asp.Net MVC, the Entity Framework approach used to draw a conceptual 
model for your application and the genere in your database schema ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Entity framework approach to write the c# classes and use those class definitions to create the database ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Html helper used for creating a label in Razor view is ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
In Asp.Net MVC, the Attribute used to prevent the Cross-Site Request Forgery is ?&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-size: x-small; font-weight: normal;&quot;&gt;
What is the difference between Url.RouteUrl and Url.HttpRouteUrl?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Url.RouteUrl
  is used to generate a fully qualified URL for specified route values 
by using a route name configured in App_Start/RouteConfig.cs file.
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;@Url.RouteUrl(&quot;MyCustomRoute&quot;, new { action = &quot;New&quot;, id = 12, Name = &quot;Sheo&quot; })&lt;/pre&gt;
gives output as /CustomController/New/12?Name=Sheo
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Url.HttpRouteUrl is also used to generate fully qualified URL for 
the specified route values but for Web API Routes. Internally this 
method add an &quot;httproute&quot; entry to routeValues. GetVirtualPath method of
 the Web Api route classes return null unless we include &quot;httproute&quot; in 
the values.
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;@Url.HttpRouteUrl(&quot;MyCustomRoute&quot;, new { action = &quot;New&quot;, id = 12, Name = &quot;Sheo&quot; })&amp;lt;/p&amp;gt;&lt;/pre&gt;
gives output as /CustomController/New/12?Name=Sheo&amp;amp;httproute=True.
&lt;br /&gt;
&lt;br /&gt;
Notice httproute query-string at the end.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
In MVC is mandatory to be Map route  {controller}/{action}/{id} In This format only..??&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
Its not mandatory to be URL string  must be in controller/action/params  format.
&lt;br /&gt;
&lt;br /&gt;
If User defined in his RouteConfig file like {controller}/{action}/{id} Query string will be controller/action/id.
&lt;br /&gt;
&lt;br /&gt;
if user defined in his RouteConfig file like {action}/{controller}/{id} Query string will be 
&lt;br /&gt;
Action/controlleer/id.&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;responseHeading spacer&quot;&gt;
&lt;h2 class=&quot;interview&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;
What is the difference between Html.EditorFor and Html.TextBoxFor in ASP.NET MVC?&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span class=&quot;paragraphTitle&quot;&gt;Html.EditorFor&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;@Html.EditorFor(model =&amp;gt; model.LastName)&lt;/pre&gt;
&lt;br /&gt;
This HTML helper method is very dynamic in nature. Based on which type of data is passed to this method, the output changes. 
&lt;br /&gt;
&lt;br /&gt;
For example, 
&lt;br /&gt;
1. if model property type is of string type, it renders a textbox  
&lt;br /&gt;
2. if the property type is boolean type it renders a checkbox.
&lt;br /&gt;
3. if the property type is of integer type, it render input type=&quot;number&quot; textbox.
&lt;br /&gt;
&lt;br /&gt;
In order to control the output of the Html.EditorFor we can use EditorTemplates for different data types.
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;paragraphTitle&quot;&gt;Html.TextBoxFor&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;@Html.TextBoxFor(model =&amp;gt; model.LastName)&lt;/pre&gt;
&lt;br /&gt;
This HTML helper method only renders a TextBox as output irrespective of whatever data type the model property is of.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/8557147816463041116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/mvc-interview-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/8557147816463041116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/8557147816463041116'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/mvc-interview-questions.html' title='MVC Interview Questions '/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-5727760777872145772</id><published>2014-07-14T00:19:00.001-07:00</published><updated>2014-07-14T00:19:27.391-07:00</updated><title type='text'>Explain about ViewData VS ViewBag Vs TempData in MVC</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;b&gt;Introduction &lt;br /&gt; &lt;/b&gt;&lt;br /&gt;
ViewData and ViewBag are used for the same purpose to transfer data from 
controller to view. Both life lies only in current request. ViewData is nothing 
but dictionary of object and it is accessible by string as key. ViewData is 
property of controller that exposes an instance of the ViewDataDictionary class. 
ViewBag is very similar to ViewData. ViewBag is a dynamic property (dynamic 
keyword which is introduced in .net framework 4.0). ViewBag is able to set and 
get value dynamically and able to add any number of additional fields without 
converts it to strongly typed. ViewBag is just a wrapper around the ViewData.&lt;br /&gt;
&lt;br /&gt; &lt;b&gt;ViewData Example&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;//Controller Code&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ActionResult&lt;/span&gt; Index()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt; 
Student = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Student.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Jignesh&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Student.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Tejas&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Student.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Rakesh&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ViewData[&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Student&quot;&lt;/span&gt;] = 
Student;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; View();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;//page code&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ul&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; 
student &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; ViewData[&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Student&quot;&lt;/span&gt;]
&lt;span style=&quot;color: blue;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/span&gt;&lt;span style=&quot;background: yellow;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;
%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;li&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;background: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt; 
student&lt;span style=&quot;background: yellow;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;li&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt; } &lt;/span&gt; &lt;span style=&quot;background: yellow;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ul&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;ViewBag Example&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Calibri,sans-serif; font-size: 11.0pt; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;//Controller Code&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ActionResult&lt;/span&gt; Index()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt; 
Student = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Student.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Jignesh&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Student.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Tejas&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Student.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Rakesh&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ViewBag.Student = Student;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; View();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;//page code&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ul&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; 
student &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; ViewBag.Student)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/span&gt;&lt;span style=&quot;background: yellow;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;
%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;li&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;background: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt; 
student&lt;span style=&quot;background: yellow;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;li&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt; } &lt;/span&gt; &lt;span style=&quot;background: yellow;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ul&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
TempData is a dictionary which is derived from TempDataDictionary class. 
TempData is stored data just like live session for short time. TempData Keep 
data for the time of HTTP Request it mean that it hold data between two 
consecutive requests. TempData help us to transfer data between controllers or 
between actions. TempData internally use Session variables. Note that TempData 
is only work during the current and subsequent request. It is generally used to 
store one time message. With the help of TempData.Keep() method we can keep 
value in TempData object after request completion.&lt;br /&gt;
&lt;br /&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;TempData Example&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;//Controller Code&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ActionResult&lt;/span&gt; Index()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt; 
Student = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Student.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Jignesh&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Student.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Tejas&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Student.Add(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Rakesh&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TempData[&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Student&quot;&lt;/span&gt;] = 
Student;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; View();&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;//page code &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ul&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; 
student &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; TempData[&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Student&quot;&lt;/span&gt;]
&lt;span style=&quot;color: blue;&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;List&lt;/span&gt;&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/span&gt;&lt;span style=&quot;background: yellow;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;
%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;li&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;background: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt; 
student&lt;span style=&quot;background: yellow;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;li&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;background: yellow;&quot;&gt;&amp;lt;%&lt;/span&gt; } &lt;/span&gt; &lt;span style=&quot;background: yellow;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-autospace: none;&quot;&gt;
 &lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;ul&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;br /&gt; &lt;b&gt;ViewData VS ViewBag VS TempData&lt;/b&gt;&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;table bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; cellspacing=&quot;1&quot; style=&quot;border-collapse: collapse; width: 80%px;&quot;&gt; &lt;tbody&gt;
&lt;tr bgcolor=&quot;#e36c0a&quot;&gt; &lt;td bgcolor=&quot;#0270bf&quot; height=&quot;33&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;color: white; font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span&gt;ViewData&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td bgcolor=&quot;#0270bf&quot; height=&quot;33&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;color: white; font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span&gt;ViewBag&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td bgcolor=&quot;#0270bf&quot; height=&quot;33&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;color: white; font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span&gt;TempData&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style=&quot;height: 15.0pt;&quot;&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: 1.0pt solid windowtext; border-right: 1.0pt solid windowtext; border-top: medium none; height: 15.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 176.0pt;&quot; valign=&quot;top&quot; width=&quot;235&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;It is 
Key-Value Dictionary collection &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 15.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 162.4pt;&quot; valign=&quot;top&quot; width=&quot;217&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;It is a type 
object&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 15.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 168.6pt;&quot; valign=&quot;top&quot; width=&quot;225&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;It is 
Key-Value Dictionary collection &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style=&quot;height: 30.0pt;&quot;&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: 1.0pt solid windowtext; border-right: 1.0pt solid windowtext; border-top: medium none; height: 30.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 176.0pt;&quot; valign=&quot;top&quot; width=&quot;235&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;ViewData is 
a dictionary object and it is property of ControllerBase class&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 30.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 162.4pt;&quot; valign=&quot;top&quot; width=&quot;217&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;ViewBag is 
Dynamic property of ControllerBase class.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 30.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 168.6pt;&quot; valign=&quot;top&quot; width=&quot;225&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;TempData is 
a dictionary object and it is property of controllerBase class.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style=&quot;height: 15.0pt;&quot;&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: 1.0pt solid windowtext; border-right: 1.0pt solid windowtext; border-top: medium none; height: 15.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 176.0pt;&quot; valign=&quot;top&quot; width=&quot;235&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;ViewData is 
Faster than ViewBag&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 15.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 162.4pt;&quot; valign=&quot;top&quot; width=&quot;217&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;ViewBag is 
slower than ViewData&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 15.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 168.6pt;&quot; valign=&quot;top&quot; width=&quot;225&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;NA&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style=&quot;height: 30.0pt;&quot;&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: 1.0pt solid windowtext; border-right: 1.0pt solid windowtext; border-top: medium none; height: 30.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 176.0pt;&quot; valign=&quot;top&quot; width=&quot;235&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;ViewData is 
introduced in MVC 1.0 and available in MVC 1.0 and above&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 30.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 162.4pt;&quot; valign=&quot;top&quot; width=&quot;217&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;ViewBag is 
introduced in MVC 3.0 and available in MVC 3.0 and above&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 30.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 168.6pt;&quot; valign=&quot;top&quot; width=&quot;225&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;TempData is 
also introduced in MVC1.0 and available in MVC 1.0 and above.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style=&quot;height: 30.0pt;&quot;&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: 1.0pt solid windowtext; border-right: 1.0pt solid windowtext; border-top: medium none; height: 30.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 176.0pt;&quot; valign=&quot;top&quot; width=&quot;235&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;ViewData&amp;nbsp; is 
also work with .net framework 3.5 and above&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 30.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 162.4pt;&quot; valign=&quot;top&quot; width=&quot;217&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;ViewBag&amp;nbsp; is 
only&amp;nbsp; work with .net framework 4.0 and above&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 30.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 168.6pt;&quot; valign=&quot;top&quot; width=&quot;225&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;TempData&amp;nbsp; is 
also work with .net framework 3.5 and above&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style=&quot;height: 45.0pt;&quot;&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: 1.0pt solid windowtext; border-right: 1.0pt solid windowtext; border-top: medium none; height: 45.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 176.0pt;&quot; valign=&quot;top&quot; width=&quot;235&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Type 
Conversion code is required while enumerating &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 45.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 162.4pt;&quot; valign=&quot;top&quot; width=&quot;217&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;In depth, 
ViewBag is used dynamic, so there is no need to type conversion while 
enumerating.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 45.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 168.6pt;&quot; valign=&quot;top&quot; width=&quot;225&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Type 
Conversion code is required while enumerating&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style=&quot;height: 45.0pt;&quot;&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: 1.0pt solid windowtext; border-right: 1.0pt solid windowtext; border-top: medium none; height: 45.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 176.0pt;&quot; valign=&quot;top&quot; width=&quot;235&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;It value 
become null if redirection is occurred.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 45.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 162.4pt;&quot; valign=&quot;top&quot; width=&quot;217&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Same as 
ViewData&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 45.0pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 168.6pt;&quot; valign=&quot;top&quot; width=&quot;225&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;TempData is 
used to pass data between two consecutive requests. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;tr style=&quot;height: 28.75pt;&quot;&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: 1.0pt solid windowtext; border-right: 1.0pt solid windowtext; border-top: medium none; height: 28.75pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 176.0pt;&quot; valign=&quot;top&quot; width=&quot;235&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;It lies only 
during the current request.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 28.75pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 162.4pt;&quot; valign=&quot;top&quot; width=&quot;217&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Same as 
ViewData&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;td style=&quot;border-bottom: 1.0pt solid windowtext; border-left: medium none; border-right: 1.0pt solid windowtext; border-top: medium none; height: 28.75pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 168.6pt;&quot; valign=&quot;top&quot; width=&quot;225&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small;&quot;&gt;TempData is only work during the 
current and subsequent request&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span id=&quot;ctl00_ContentMain_BlogDetailControl1_LabelBlogDetail&quot;&gt;                                                          &lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Segoe UI; line-height: normal; margin-bottom: .0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
 &lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt; &lt;b&gt;Conclusion&lt;br /&gt; &lt;/b&gt;&lt;br /&gt;
We have three options ViewData, ViewBag and TeampData for passing data from 
controller to view and in next request. ViewData and ViewBag are almost similar 
and it helps us to transfer the data from controller to view whereas TempData is 
also work during the current and subsequent request. &lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/5727760777872145772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/explain-about-viewdata-vs-viewbag-vs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/5727760777872145772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/5727760777872145772'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/07/explain-about-viewdata-vs-viewbag-vs.html' title='Explain about ViewData VS ViewBag Vs TempData in MVC'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-1368398166927403843</id><published>2014-06-25T02:40:00.001-07:00</published><updated>2014-06-25T02:40:16.797-07:00</updated><title type='text'>Explain about MVC Breafly </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;
&lt;span style=&quot;font-size: 30px;&quot;&gt;Disclaimer&lt;/span&gt;&lt;span style=&quot;font-size: 30px;&quot;&gt; &lt;/span&gt;&lt;/h2&gt;
Reading these MVC interview questions does not mean you will go and 
clear MVC interviews. The purpose of this article is to quickly brush up
 your MVC knowledge before you go for MVC interviews. This article does 
not teach MVC, it’s a last minute revision sheet before going for MVC 
interviews.&lt;br /&gt;


If you want to learn MVC from scratch, start by reading Learn MVC ( Model view controller) step by step 7 days or you can also start with my step by step MVC (Model View Controller) video series from YouTube.&lt;br /&gt;


&lt;h2&gt;
Need help to improve this article&lt;/h2&gt;
I have tried my level best to cover what questions i have faced in 
MVC interviews. But i feel the below questions are not enough and in 
real MVC interview&#39;s much more is asked. If you can share your question 
in the comment below. I would love to incorporate them in this article 
so that others are benefited.&lt;br /&gt;
If your question is great and i like it i will ship you a free copy of my .NET interview question book only in India ( sorry i am not so rich for outside countries).&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_is_MVC(Model_view_controller)&quot;&gt;&lt;/a&gt;What is MVC (Model View Controller)?&lt;/h2&gt;
MVC is an architectural pattern which separates the representation 
and user interaction. It’s divided into three broader sections, Model, 
View, and Controller. Below is how each one of them handles the task.&lt;br /&gt;


&lt;ul&gt;
&lt;li&gt;The View is responsible for the look and feel.&lt;/li&gt;
&lt;li&gt;Model represents the real world object and provides data to the View.&lt;/li&gt;
&lt;li&gt;The Controller is responsible for taking the end user request and loading the appropriate Model and View.&lt;/li&gt;
&lt;/ul&gt;
&lt;img height=&quot;180&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/1.jpg&quot; width=&quot;207&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: MVC (Model view controller)&lt;/div&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Explain_MVC_application_life_cycle&quot;&gt;Explain MVC application life cycle?&lt;/a&gt;&lt;/h2&gt;
There are six broader events which occur in MVC application life cycle below diagrams summarize it.&lt;br /&gt;


&lt;img src=&quot;http://www.codeproject.com/KB/aspnet/556995/MVCLifeCycle.jpg&quot; /&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.dotnetinterviewquestions.in/article_explain-mvc-application-life-cycle_210.html&quot; target=&quot;_blank&quot;&gt;&lt;/a&gt;&lt;br /&gt;


Any web application has two main execution steps first understanding 
the request and depending on the type of the request sending out 
appropriate response. MVC application life cycle is not different it has
 two main phases first creating the request object and second sending 
our response to the browser.&lt;br /&gt;


&lt;strong&gt;Creating the request object: -&lt;/strong&gt;The request object creation has four major steps. Below is the detail explanation of the same.&lt;br /&gt;


&lt;strong&gt;Step 1 Fill route: -&lt;/strong&gt; MVC requests are mapped to 
route tables which in turn specify which controller and action to be 
invoked. So if the request is the first request the first thing is to 
fill the route table with routes collection. This filling of route table
 happens in the global.asax file.&lt;br /&gt;


&lt;strong&gt;Step 2 Fetch route: -&lt;/strong&gt; Depending on the URL sent 
“UrlRoutingModule” searches the route table to create “RouteData” object
 which has the details of which controller and action to invoke.&lt;br /&gt;


&lt;strong&gt;Step 3 Request context created: -&lt;/strong&gt; The “RouteData” object is used to create the “RequestContext” object.&lt;br /&gt;


&lt;strong&gt;Step 4 Controller instance created: -&lt;/strong&gt; This request 
object is sent to “MvcHandler” instance to create the controller class 
instance. Once the controller class object is created it calls the 
“Execute” method of the controller class.&lt;br /&gt;


&lt;strong&gt;Creating Response object: -&lt;/strong&gt; This phase has two steps executing the action and finally sending the response as a result to the view.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Is_MVC_suitable_for_both_windows_and_web_application&quot;&gt;&lt;/a&gt;Is MVC suitable for both Windows and Web applications?&lt;/h2&gt;
The MVC architecture is suited for a web application than Windows. 
For Window applications, MVP, i.e., “Model View Presenter” is more 
applicable. If you are using WPF and Silverlight, MVVM is more suitable 
due to bindings.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What are the benefits of using MVC&quot;&gt;&lt;/a&gt;What are the benefits of using MVC?&lt;/h2&gt;
There are two big benefits of MVC:&lt;br /&gt;


&lt;ul&gt;
&lt;li&gt;Separation of concerns is achieved as we are moving the code-behind
 to a separate class file. By moving the binding code to a separate 
class file we can reuse the code to a great extent.&lt;/li&gt;
&lt;li&gt;Automated UI testing is possible because now the behind code (UI 
interaction code) has moved to a simple .NET class. This gives us 
opportunity to write unit tests and automate manual testing.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Is_MVC_different_from_a_3_layered_architecture&quot;&gt;&lt;/a&gt;Is MVC different from a three layered architecture?&lt;/h2&gt;
MVC is an evolution of a three layered traditional architecture. Many
 components of the three layered architecture are part of MVC. So below 
is how the mapping goes:&lt;br /&gt;


&lt;table class=&quot;ArticleTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
   &lt;td&gt;&lt;strong&gt;Functionality&lt;/strong&gt;&lt;/td&gt;
   &lt;td&gt;&lt;strong&gt;Three layered / tiered architecture&lt;/strong&gt;&lt;/td&gt;
   &lt;td width=&quot;245&quot;&gt;&lt;strong&gt;Model view controller architecture&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;Look and Feel&lt;/td&gt;
   &lt;td&gt;User interface&lt;/td&gt;
   &lt;td width=&quot;245&quot;&gt;View&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;UI logic&lt;/td&gt;
   &lt;td&gt;User interface&lt;/td&gt;
   &lt;td width=&quot;245&quot;&gt;Controller&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;Business logic /validations&lt;/td&gt;
   &lt;td&gt;Middle layer&lt;/td&gt;
   &lt;td width=&quot;245&quot;&gt;Model&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;Request is first sent to&lt;/td&gt;
   &lt;td&gt;User interface&lt;/td&gt;
   &lt;td width=&quot;245&quot;&gt;Controller&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;Accessing data&lt;/td&gt;
   &lt;td&gt;Data access layer&lt;/td&gt;
   &lt;td width=&quot;245&quot;&gt;Data Access Layer&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;img height=&quot;380&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/2.jpg&quot; width=&quot;624&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: Three layered architecture&lt;/div&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_is_the_latest_version_of_MVC&quot;&gt;&lt;/a&gt;What is the latest version of MVC?&lt;/h2&gt;
When this note was written, four versions were released of MVC: MVC 1 , MVC 2, MVC 3, and MVC 4. So the latest is MVC 4.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_is_the_difference_between_each_version_of_MVC&quot;&gt;&lt;/a&gt;What is the difference between each version of MVC?&lt;/h2&gt;
Below is a detailed table of differences. But during an interview 
it’s difficult to talk about all of them due to time limitation. So I 
have highlighted the important differences that you can run through 
before the interviewer.&lt;br /&gt;


&lt;table class=&quot;ArticleTable&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
   &lt;td width=&quot;309&quot;&gt;&lt;strong&gt;MVC 2&lt;/strong&gt;&lt;/td&gt;
   &lt;td width=&quot;281&quot;&gt;&lt;strong&gt;MVC 3&lt;/strong&gt;&lt;/td&gt;
   &lt;td&gt;&lt;strong&gt;MVC 4&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td valign=&quot;top&quot; width=&quot;309&quot;&gt;
   &lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Client-side validation&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Templated Helpers Areas&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Asynchronous Controllers&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Html.ValidationSummary&lt;/code&gt; Helper Method&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DefaultValueAttribute&lt;/code&gt; in Action-Method&lt;/li&gt;
&lt;li&gt;Parameters binding&lt;/li&gt;
&lt;li&gt;Binary data with Model Binders&lt;/li&gt;
&lt;li&gt;DataAnnotations Attributes&lt;/li&gt;
&lt;li&gt;Model-Validator Providers&lt;/li&gt;
&lt;li&gt;New &lt;code&gt;RequireHttpsAttribute&lt;/code&gt; Action Filter&lt;/li&gt;
&lt;li&gt;Templated Helpers&lt;/li&gt;
&lt;li&gt;Display Model-Level Errors&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
   &lt;td valign=&quot;top&quot; width=&quot;281&quot;&gt;
   &lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Razor&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Readymade project templates&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HTML 5 enabled templates&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Support for Multiple View Engines, JavaScript, and AJAX&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Model Validation Improvements&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
   &lt;td valign=&quot;top&quot; width=&quot;281&quot;&gt;
   &lt;ul&gt;
&lt;li&gt;&lt;strong&gt;ASP.NET Web API&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Refreshed and modernized default project templates. New mobile project template.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Many new features to support mobile apps &lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Enhanced support for asynchronous methods&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_are_HTML_helpers_in_MVC&quot;&gt;What are HTML helpers in MVC?&lt;/a&gt;&lt;/h2&gt;
HTML helpers help you to render HTML controls in the view. For 
instance if you want to display a HTML textbox on the view , below is 
the HTML helper code.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain0&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre0&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;= Html.TextBox(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;LastName&quot;&lt;/span&gt;) &lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
For checkbox below is the HTML helper code. In this way we have HTML helper methods for every HTML control that exists.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain1&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre1&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;= Html.CheckBox(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Married&quot;&lt;/span&gt;) &lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_is_the_difference_between_HTMLTextBox_vs_HTML.TextBoxFor&quot;&gt;What is the difference between “HTML.TextBox” vs “HTML.TextBoxFor”?&lt;/a&gt;&lt;/h2&gt;
Both of them provide the same HTML output, “HTML.TextBoxFor” is 
strongly typed while “HTML.TextBox” isn’t. Below is a simple HTML code 
which just creates a simple textbox with “CustomerCode” as name.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain2&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre2&quot; style=&quot;margin-top: 0px;&quot;&gt;Html.TextBox(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;CustomerCode&quot;&lt;/span&gt;)&lt;/pre&gt;
Below is “Html.TextBoxFor” code which creates HTML textbox using the property name ‘CustomerCode” from object “m”.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain3&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre3&quot; style=&quot;margin-top: 0px;&quot;&gt;Html.TextBoxFor(m =&amp;gt; m.CustomerCode)&lt;/pre&gt;
In the same way we have for other HTML controls like for checkbox we have “Html.CheckBox” and “Html.CheckBoxFor”.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_are_routing_in_MVC&quot;&gt;What is routing in MVC?&lt;/a&gt;&lt;/h2&gt;
Routing helps you to define a URL structure and map the URL with the controller.&lt;br /&gt;


For instance let’s say we want that when a user types “&lt;em&gt;http://localhost/View/ViewCustomer/&lt;/em&gt;”, it goes to the “Customer” Controller and invokes the &lt;code&gt;DisplayCustomer&lt;/code&gt; action. This is defined by adding an entry in to the &lt;code&gt;routes&lt;/code&gt; collection using the &lt;code&gt;maproute&lt;/code&gt; function. Below is the underlined code which shows how the URL structure and mapping with controller and action is defined.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain4&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre4&quot; style=&quot;margin-top: 0px;&quot;&gt;routes.MapRoute(
               &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;View&quot;&lt;/span&gt;, &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Route name
&lt;/span&gt;               &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;View/ViewCustomer/{id}&quot;&lt;/span&gt;, &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; URL with parameters
&lt;/span&gt;               &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; { controller = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Customer&quot;&lt;/span&gt;, action = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;DisplayCustomer&quot;&lt;/span&gt;, 
id = UrlParameter.Optional }); &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Parameter defaults   &lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Where_is_the_route_mapping_code_written&quot;&gt;&lt;/a&gt;Where is the route mapping code written?&lt;/h2&gt;
The route mapping code is written in the “&lt;em&gt;global.asax&lt;/em&gt;” file.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Can_we_map_multiple_URL’s_to_the_same_action&quot;&gt;&lt;/a&gt;Can we map multiple URL’s to the same action?&lt;/h2&gt;
Yes, you can, you just need to make two entries with different key names and specify the same controller and action.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How_can_we_navigate_from_one_view_to_other_view_using_hyperlink&quot;&gt;&lt;/a&gt;How can we navigate from one view to another using a hyperlink?&lt;/h2&gt;
By using the &lt;code&gt;ActionLink&lt;/code&gt; method as shown in the below 
code. The below code will create a simple URL which helps to navigate to
 the “Home” controller and invoke the &lt;code&gt;GotoHome&lt;/code&gt; action.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain5&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre5&quot; lang=&quot;aspnet&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;= Html.ActionLink(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Home&quot;&lt;/span&gt;,&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Gotohome&quot;&lt;/span&gt;) &lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;  &lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How_can_we_restrict_MVC_actions_to_be_invoked_only_by_GET_or_POST&quot;&gt;&lt;/a&gt;How can we restrict MVC actions to be invoked only by GET or POST?&lt;/h2&gt;
We can decorate the MVC action with the &lt;code&gt;HttpGet&lt;/code&gt; or &lt;code&gt;HttpPost&lt;/code&gt; attribute to restrict the type of HTTP calls. For instance you can see in the below code snippet the &lt;code&gt;DisplayCustomer&lt;/code&gt; action can only be invoked by &lt;code&gt;HttpGet&lt;/code&gt;. If we try to make HTTP POST on &lt;code&gt;DisplayCustomer&lt;/code&gt;, it will throw an error.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain6&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre6&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;[HttpGet]
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ViewResult DisplayCustomer(&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; id)
{
    Customer objCustomer = Customers[id];
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;DisplayCustomer&quot;&lt;/span&gt;,objCustomer);
} &lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How_can_we_maintain_session_in_MVC&quot;&gt;&lt;/a&gt;How can we maintain sessions in MVC?&lt;/h2&gt;
Sessions can be maintained in MVC by three ways: tempdata, viewdata, and viewbag.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_is_the_difference_between_tempdata_,viewdataandviewbag&quot;&gt;&lt;/a&gt;What is the difference between tempdata, viewdata, and viewbag?&lt;/h2&gt;
&lt;img height=&quot;333&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/3.jpg&quot; width=&quot;446&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: Difference between tempdata, viewdata, and viewbag&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Temp data&lt;/strong&gt; - Helps to maintain data when you move 
from one controller to another controller or from one action to another 
action. In other words when you redirect, tempdata helps to maintain 
data between those redirects. It internally uses session variables.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;View data&lt;/strong&gt; - Helps to maintain data when you move from controller to view.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;View Bag&lt;/strong&gt; - It’s a dynamic wrapper around view data. When you use &lt;code&gt;Viewbag&lt;/code&gt; type, casting is not required. It uses the &lt;code&gt;dynamic&lt;/code&gt; keyword internally.&lt;/li&gt;
&lt;/ul&gt;
&lt;img height=&quot;267&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/4.jpg&quot; width=&quot;195&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: dynamic keyword&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Session variables -&lt;/strong&gt; By using session variables we can maintain data from any entity to any entity.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hidden fields and HTML controls -&lt;/strong&gt; Helps to 
maintain data from UI to controller only. So you can send data from HTML
 controls or hidden fields to the controller using POST or GET HTTP 
methods.&lt;/li&gt;
&lt;/ul&gt;
Below is a summary table which shows the different mechanisms for persistence.&lt;br /&gt;


&lt;table class=&quot;ArticleTable&quot;&gt;
 &lt;thead&gt;
&lt;tr&gt;
   &lt;td width=&quot;164&quot;&gt;&lt;strong&gt;Maintains data between&lt;/strong&gt;&lt;/td&gt;
   &lt;td width=&quot;128&quot;&gt;&lt;strong&gt;ViewData/ViewBag&lt;/strong&gt;&lt;/td&gt;
   &lt;td width=&quot;91&quot;&gt;&lt;strong&gt;TempData&lt;/strong&gt;&lt;/td&gt;
   &lt;td&gt;&lt;strong&gt;Hidden fields&lt;/strong&gt;&lt;/td&gt;
   &lt;td width=&quot;66&quot;&gt;&lt;strong&gt;Session&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
 &lt;tbody&gt;
&lt;tr&gt;
   &lt;td width=&quot;164&quot;&gt;&lt;strong&gt;Controller to Controller&lt;/strong&gt;&lt;/td&gt;
   &lt;td width=&quot;128&quot;&gt;No&lt;/td&gt;
   &lt;td width=&quot;91&quot;&gt;Yes&lt;/td&gt;
   &lt;td&gt;No&lt;/td&gt;
   &lt;td width=&quot;66&quot;&gt;Yes&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td width=&quot;164&quot;&gt;&lt;strong&gt;Controller to View&lt;/strong&gt;&lt;/td&gt;
   &lt;td width=&quot;128&quot;&gt;Yes&lt;/td&gt;
   &lt;td width=&quot;91&quot;&gt;No&lt;/td&gt;
   &lt;td&gt;No&lt;/td&gt;
   &lt;td width=&quot;66&quot;&gt;Yes&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td width=&quot;164&quot;&gt;&lt;strong&gt;View to Controller&lt;/strong&gt;&lt;/td&gt;
   &lt;td width=&quot;128&quot;&gt;No&lt;/td&gt;
   &lt;td width=&quot;91&quot;&gt;No&lt;/td&gt;
   &lt;td&gt;Yes&lt;/td&gt;
   &lt;td width=&quot;66&quot;&gt;Yes&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_are_partial_views_in_MVC&quot;&gt;&lt;/a&gt;What are partial views in MVC?&lt;/h2&gt;
Partial view is a reusable view (like a user control) which can be 
embedded inside other view. For example let’s say all your pages of your
 site have a standard structure with left menu, header, and footer as 
shown in the image below.&lt;br /&gt;


&lt;img height=&quot;235&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/5.jpg&quot; width=&quot;247&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: Partial views in MVC&lt;/div&gt;
For every page you would like to reuse the left menu, header, and 
footer controls. So you can go and create partial views for each of 
these items and then you call that partial view in the main view.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How_did_you_create_partial_view_and_consume_the_same&quot;&gt;&lt;/a&gt;How did you create a partial view and consume it?&lt;/h2&gt;
When you add a view to your project you need to check the “Create partial view” check box.&lt;br /&gt;


&lt;img height=&quot;372&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/6.jpg&quot; width=&quot;384&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: Create partial view&lt;/div&gt;
Once the partial view is created you can then call the partial view in the main view using the &lt;code&gt;Html.RenderPartial&lt;/code&gt; method as shown in the below code snippet:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain7&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre7&quot; lang=&quot;xml&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt; Html.RenderPartial(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;MyView&quot;&lt;/span&gt;); &lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How_can_we_do_validations_in_MVC&quot;&gt;&lt;/a&gt;How can we do validations in MVC?&lt;/h2&gt;
One of the easiest ways of doing validation in MVC is by using data 
annotations. Data annotations are nothing but attributes which can be 
applied on model properties. For example, in the below code snippet we 
have a simple &lt;code&gt;Customer&lt;/code&gt; class with a property &lt;code&gt;customercode&lt;/code&gt;.&lt;br /&gt;


This &lt;code&gt;CustomerCode&lt;/code&gt; property is tagged with a &lt;code&gt;Required&lt;/code&gt; data annotation attribute. In other words if this model is not provided customer code, it will not accept it.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain8&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre8&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; Customer
{
    [Required(ErrorMessage=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Customer code is required&quot;&lt;/span&gt;)]
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; CustomerCode
    {
        &lt;span class=&quot;code-keyword&quot;&gt;set&lt;/span&gt;;
        &lt;span class=&quot;code-keyword&quot;&gt;get&lt;/span&gt;;
    } 
}  &lt;/pre&gt;
In order to display the validation error message we need to use the &lt;code&gt;ValidateMessageFor&lt;/code&gt; method which belongs to the &lt;code&gt;Html&lt;/code&gt; helper class.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain9&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre9&quot; lang=&quot;aspnet&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;using&lt;/span&gt; (Html.BeginForm(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;PostCustomer&quot;&lt;/span&gt;, &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Home&quot;&lt;/span&gt;, FormMethod.Post))
{ &lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;=Html.TextBoxFor(m =&amp;gt; m.CustomerCode)&lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;=Html.ValidationMessageFor(m =&amp;gt; m.CustomerCode)&lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;submit&quot;&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;Submit customer data&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;}&lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt; &lt;/pre&gt;
Later in the controller we can check if the model is proper or not by using the &lt;code&gt;ModelState.IsValid&lt;/code&gt; property and accordingly we can take actions.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain10&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre10&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult PostCustomer(Customer obj)
{
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (ModelState.IsValid)
    {
        obj.Save();
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Thanks&quot;&lt;/span&gt;);
    }
    &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Customer&quot;&lt;/span&gt;);
    }
}&lt;/pre&gt;
Below is a simple view of how the error message is displayed on the view.&lt;br /&gt;


&lt;img height=&quot;141&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/7.jpg&quot; width=&quot;415&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: Validations in MVC&lt;/div&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Can_we_display_all_errors_in_one_go&quot;&gt;&lt;/a&gt;Can we display all errors in one go?&lt;/h2&gt;
Yes, we can; use the &lt;code&gt;ValidationSummary&lt;/code&gt; method from the &lt;code&gt;Html&lt;/code&gt; helper class.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain11&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre11&quot; lang=&quot;aspnet&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;= Html.ValidationSummary() &lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;   &lt;/pre&gt;
What are the other data annotation attributes for validation in MVC?&lt;br /&gt;


If you want to check string length, you can use &lt;code&gt;StringLength&lt;/code&gt;.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain12&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre12&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;[StringLength(&lt;span class=&quot;code-digit&quot;&gt;160&lt;/span&gt;)]
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; FirstName { &lt;span class=&quot;code-keyword&quot;&gt;get&lt;/span&gt;; &lt;span class=&quot;code-keyword&quot;&gt;set&lt;/span&gt;; }&lt;/pre&gt;
In case you want to use a regular expression, you can use the &lt;code&gt;RegularExpression&lt;/code&gt; attribute.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain13&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre13&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;[RegularExpression(&lt;span class=&quot;code-string&quot;&gt;@&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}&quot;&lt;/span&gt;)]&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; Email { &lt;span class=&quot;code-keyword&quot;&gt;get&lt;/span&gt;; &lt;span class=&quot;code-keyword&quot;&gt;set&lt;/span&gt;; }&lt;/pre&gt;
If you want to check whether the numbers are in range, you can use the &lt;code&gt;Range&lt;/code&gt; attribute.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain14&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre14&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;[Range(&lt;span class=&quot;code-digit&quot;&gt;10&lt;/span&gt;,&lt;span class=&quot;code-digit&quot;&gt;25&lt;/span&gt;)]&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; Age { &lt;span class=&quot;code-keyword&quot;&gt;get&lt;/span&gt;; &lt;span class=&quot;code-keyword&quot;&gt;set&lt;/span&gt;; }&lt;/pre&gt;
Sometimes you would like to compare the value of one field with another field, we can use the &lt;code&gt;Compare&lt;/code&gt; attribute.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain15&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre15&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; Password { &lt;span class=&quot;code-keyword&quot;&gt;get&lt;/span&gt;; &lt;span class=&quot;code-keyword&quot;&gt;set&lt;/span&gt;; }[Compare(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Password&quot;&lt;/span&gt;)]&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; ConfirmPass { &lt;span class=&quot;code-keyword&quot;&gt;get&lt;/span&gt;; &lt;span class=&quot;code-keyword&quot;&gt;set&lt;/span&gt;; }&lt;/pre&gt;
In case you want to get a particular error message , you can use the &lt;code&gt;Errors&lt;/code&gt; collection.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain16&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre16&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; ErrMessage = ModelState[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Email&quot;&lt;/span&gt;].Errors[&lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;].ErrorMessage;&lt;/pre&gt;
If you have created the model object yourself you can explicitly call &lt;code&gt;TryUpdateModel&lt;/code&gt; in your controller to check if the object is valid or not.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain17&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre17&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;TryUpdateModel(NewCustomer);&lt;/pre&gt;
In case you want add errors in the controller you can use the &lt;code&gt;AddModelError&lt;/code&gt; function.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain18&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre18&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;ModelState.AddModelError(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;FirstName&quot;&lt;/span&gt;, &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;This is my server-side error.&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How_can_we_enable_data_annotation_validation_on_client_side&quot;&gt;&lt;/a&gt;How can we enable data annotation validation on client side?&lt;/h2&gt;
It’s a two-step process: first reference the necessary jQuery files.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain19&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre19&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&amp;lt;script src=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;&amp;lt;%= Url.Content(&quot;&lt;/span&gt;~/Scripts/jquery-1.&lt;span class=&quot;code-digit&quot;&gt;5&lt;/span&gt;.&lt;span class=&quot;code-digit&quot;&gt;1&lt;/span&gt;.js&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;) %&amp;gt;&quot;&lt;/span&gt; type=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;text/javascript&quot;&lt;/span&gt;&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;%= Url.Content(&quot;&lt;/span&gt;&lt;span class=&quot;code-attribute&quot;&gt;~&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-attribute&quot;&gt;Scripts&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-attribute&quot;&gt;jquery.validate.js&quot;)&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt; type=&quot;&lt;/span&gt;text/javascript&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&quot;&lt;/span&gt;&amp;lt;%= Url.Content(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;~/Scripts/jquery.validate.unobtrusive.js&quot;&lt;/span&gt;) &lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt; &lt;/pre&gt;
The second step is to call the &lt;code&gt;EnableClientValidation&lt;/code&gt; method.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain20&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre20&quot; lang=&quot;aspnet&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt; Html.EnableClientValidation(); &lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_is_razor_in_MVC&quot;&gt;&lt;/a&gt;What is Razor in MVC?&lt;/h2&gt;
It’s a light weight view engine. Till MVC we had only one view type, i.e., ASPX. Razor was introduced in MVC 3.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Why_razor_when_we_already_had_ASPX&quot;&gt;&lt;/a&gt;Why Razor when we already have ASPX?&lt;/h2&gt;
Razor is clean, lightweight, and syntaxes are easy as compared to 
ASPX. For example, in ASPX to display simple time, we need to write:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain21&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre21&quot; lang=&quot;aspx&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;=DateTime.Now&lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt; &lt;/pre&gt;
In Razor, it’s just one line of code:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain22&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre22&quot; lang=&quot;aspx&quot; style=&quot;margin-top: 0px;&quot;&gt;@DateTime.Now&lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;So_which_is_a_better_fit_Razor_or_ASPX&quot;&gt;&lt;/a&gt;So which is a better fit, Razor or ASPX?&lt;/h2&gt;
As per Microsoft, Razor is more preferred because it’s light weight and has simple syntaxes.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How_can_you_do_authentication_and_authorization_in_MVC&quot;&gt;&lt;/a&gt;How can you do authentication and authorization in MVC?&lt;/h2&gt;
You can use Windows or Forms authentication for MVC.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How_to_implement_windows_authentication_for_MVC&quot;&gt;&lt;/a&gt;How to implement Windows authentication for MVC?&lt;/h2&gt;
For Windows authentication you need to modify the &lt;em&gt;web.config&lt;/em&gt; file and set the authentication mode to Windows.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain23&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre23&quot; lang=&quot;xml&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;authentication&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;Windows&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;authorization&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;deny&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;?&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;authorization&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
Then in the controller or on the action, you can use the &lt;code&gt;Authorize&lt;/code&gt;
 attribute which specifies which users have access to these controllers 
and actions. Below is the code snippet for that. Now only the users 
specified in the controller and action can access it.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain24&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre24&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;[Authorize(Users= &lt;span class=&quot;code-string&quot;&gt;@&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;WIN-3LI600MWLQN\Administrator&quot;&lt;/span&gt;)]
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; StartController : Controller
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;
&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; GET: /Start/
&lt;/span&gt;    [Authorize(Users = &lt;span class=&quot;code-string&quot;&gt;@&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;WIN-3LI600MWLQN\Administrator&quot;&lt;/span&gt;)]
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult Index()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;MyView&quot;&lt;/span&gt;);
    }
} &lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How_do_you_implement_forms_authentication_in_MVC&quot;&gt;&lt;/a&gt;How do you implement Forms authentication in MVC?&lt;/h2&gt;
Forms authentication is implemented the same way as in ASP.NET. The first step is to set the authentication mode equal to &lt;code&gt;Forms&lt;/code&gt;. The &lt;code&gt;loginUrl&lt;/code&gt; points to a controller here rather than a page.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain25&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre25&quot; lang=&quot;xml&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;authentication&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;Forms&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;forms&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;loginUrl&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;~/Home/Login&quot;&lt;/span&gt;  &lt;span class=&quot;code-attribute&quot;&gt;timeout&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;2880&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;authentication&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
We also need to create a controller where we will check if the user 
is proper or not. If the user is proper we will set the cookie value.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain26&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre26&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult Login()
{
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ((Request.Form[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;txtUserName&quot;&lt;/span&gt;] == &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Shiv&quot;&lt;/span&gt;) &amp;amp;&amp;amp; 
          (Request.Form[&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;txtPassword&quot;&lt;/span&gt;] == &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Shiv@123&quot;&lt;/span&gt;))
    {
        FormsAuthentication.SetAuthCookie(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Shiv&quot;&lt;/span&gt;,&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;);
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;About&quot;&lt;/span&gt;);
    }
    &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Index&quot;&lt;/span&gt;);
    }
} &lt;/pre&gt;
All the other actions need to be attributed with the &lt;code&gt;Authorize&lt;/code&gt;
 attribute so that any unauthorized user making a call to these 
controllers will be redirected to the controller (in this case the 
controller is “Login”) which will do the authentication.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain27&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre27&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;[Authorize]
PublicActionResult Default()
{
&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View();
}
[Authorize]
publicActionResult About()
{
&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View();
} &lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How_to_implement_Ajax_in_MVC&quot;&gt;&lt;/a&gt;How to implement AJAX in MVC?&lt;/h2&gt;
You can implement AJAX in two ways in MVC:&lt;br /&gt;


&lt;ul&gt;
&lt;li&gt;AJAX libraries&lt;/li&gt;
&lt;li&gt;jQuery&lt;/li&gt;
&lt;/ul&gt;
Below is a simple sample of how to implement AJAX by using the “AJAX”
 helper library. In the below code you can see we have a simple form 
which is created by using the &lt;code&gt;Ajax.BeginForm&lt;/code&gt; syntax. This form calls a controller action called &lt;code&gt;getCustomer&lt;/code&gt;. So now the submit action click will be an asynchronous AJAX call.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain28&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre28&quot; lang=&quot;jscript&quot; style=&quot;margin-top: 0px;&quot;&gt;&amp;lt;script language=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;javascript&quot;&lt;/span&gt;&amp;gt;
&lt;span class=&quot;code-keyword&quot;&gt;function&lt;/span&gt; OnSuccess(data1) 
{
&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Do something here
&lt;/span&gt;}
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;
        var AjaxOpt = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; AjaxOptions{OnSuccess=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;OnSuccess&quot;&lt;/span&gt;};        
    %&amp;gt;
&amp;lt;% &lt;span class=&quot;code-keyword&quot;&gt;using&lt;/span&gt; (Ajax.BeginForm(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;getCustomer&quot;&lt;/span&gt;,&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;MyAjax&quot;&lt;/span&gt;,AjaxOpt)) { %&amp;gt;
&amp;lt;input id=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;txtCustomerCode&quot;&lt;/span&gt; type=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;text&quot;&lt;/span&gt; /&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;input id=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;txtCustomerName&quot;&lt;/span&gt; type=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;text&quot;&lt;/span&gt; /&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;input id=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Submit2&quot;&lt;/span&gt; type=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;submit&quot;&lt;/span&gt; value=&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;submit&quot;&lt;/span&gt;/&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;%} %&amp;gt; &lt;/pre&gt;
In case you want to make AJAX calls on hyperlink clicks, you can use the &lt;code&gt;Ajax.ActionLink&lt;/code&gt; function as shown in the below code.&lt;br /&gt;


&lt;img height=&quot;193&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/8.jpg&quot; width=&quot;304&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: Implement AJAX in MVC&lt;/div&gt;
So if you want to create an AJAX asynchronous hyperlink by name &lt;code&gt;GetDate&lt;/code&gt; which calls the &lt;code&gt;GetDate&lt;/code&gt; function in the controller, below is the code for that. Once the controller responds, this data is displayed in the HTML &lt;code&gt;DIV&lt;/code&gt; tag named &lt;code&gt;DateDiv&lt;/code&gt;.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain29&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre29&quot; lang=&quot;xml&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;span&lt;/span&gt; &lt;span class=&quot;code-attribute&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;DateDiv&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;: 
Ajax.ActionLink(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Get Date&quot;&lt;/span&gt;,&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;GetDate&quot;&lt;/span&gt;,
&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; AjaxOptions {UpdateTargetId = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;DateDiv&quot;&lt;/span&gt; })
&lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt; &lt;/pre&gt;
Below is the controller code. You can see how the &lt;code&gt;GetDate&lt;/code&gt; function has a pause of 10 seconds.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain30&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre30&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; Default1Controller : Controller
{
   &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; GetDate()
   {
       Thread.Sleep(&lt;span class=&quot;code-digit&quot;&gt;10000&lt;/span&gt;);
       &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; DateTime.Now.ToString();
   }
}&lt;/pre&gt;
The second way of making an AJAX call in MVC is by using jQuery. In 
the below code you can see we are making an AJAX POST call to a URL &lt;em&gt;/MyAjax/getCustomer&lt;/em&gt;. This is done by using &lt;code&gt;$.post&lt;/code&gt;. All this logic is put into a function called &lt;code&gt;GetData&lt;/code&gt; and you can make a call to the &lt;code&gt;GetData&lt;/code&gt; function on a button or a hyperlink click event as you want.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain31&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre31&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;function GetData() 
{
    &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; url = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;/MyAjax/getCustomer&quot;&lt;/span&gt;;
    $.post(url, function (data) 
    {
        $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#txtCustomerCode&quot;&lt;/span&gt;).val(data.CustomerCode);
        $(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;#txtCustomerName&quot;&lt;/span&gt;).val(data.CustomerName);
    }
    )
} &lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_kind_of_events_can_be_tracked_in_AJAX&quot;&gt;&lt;/a&gt;What kind of events can be tracked in AJAX?&lt;/h2&gt;
&lt;img height=&quot;147&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/9.jpg&quot; width=&quot;464&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: Tracked in AJAX&lt;/div&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_is_the_difference_between_“ActionResult”_and_“ViewResult”&quot;&gt;&lt;/a&gt;What is the difference between ActionResult and ViewResult?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ActionResult&lt;/code&gt; is an abstract class while &lt;code&gt;ViewResult&lt;/code&gt; derives from the &lt;code&gt;ActionResult&lt;/code&gt; class. &lt;code&gt;ActionResult&lt;/code&gt; has several derived classes like &lt;code&gt;ViewResult&lt;/code&gt;, &lt;code&gt;JsonResult&lt;/code&gt;, &lt;code&gt;FileStreamResult&lt;/code&gt;, and so on.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ActionResult&lt;/code&gt; can be used to exploit polymorphism and dynamism. So if you are returning different types of views dynamically, &lt;code&gt;ActionResult&lt;/code&gt; is the best thing. For example in the below code snippet, you can see we have a simple action called &lt;code&gt;DynamicView&lt;/code&gt;. Depending on the flag (&lt;code&gt;IsHtmlView&lt;/code&gt;) it will either return a &lt;code&gt;ViewResult&lt;/code&gt; or &lt;code&gt;JsonResult&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain32&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre32&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult DynamicView()
{
   &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (IsHtmlView)
     &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(); &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; returns simple ViewResult
&lt;/span&gt;   &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
     &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Json(); &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; returns JsonResult view
&lt;/span&gt;} &lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_are_the_different_types_of_results_in_MVC&quot;&gt;&lt;/a&gt;What are the different types of results in MVC?&lt;/h2&gt;
&lt;strong&gt;Note&lt;/strong&gt;: It’s difficult to remember all the 12 types. But some important ones you can remember for the interview are &lt;code&gt;ActionResult&lt;/code&gt;, &lt;code&gt;ViewResult&lt;/code&gt;, and &lt;code&gt;JsonResult&lt;/code&gt;. Below is a detailed list for your interest:&lt;br /&gt;


There 12 kinds of results in MVC, at the top is the &lt;code&gt;ActionResult&lt;/code&gt; class which is a base class that can have 11 subtypes as listed below:&lt;br /&gt;


&lt;ol&gt;
&lt;li&gt;&lt;code&gt;ViewResult&lt;/code&gt; - Renders a specified view to the response stream&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PartialViewResult&lt;/code&gt; - Renders a specified partial view to the response stream&lt;/li&gt;
&lt;li&gt;&lt;code&gt;EmptyResult&lt;/code&gt; - An empty response is returned&lt;/li&gt;
&lt;li&gt;&lt;code&gt;RedirectResult&lt;/code&gt; - Performs an HTTP redirection to a specified URL&lt;/li&gt;
&lt;li&gt;&lt;code&gt;RedirectToRouteResult&lt;/code&gt; - Performs an HTTP redirection to a URL that is determined by the routing engine, based on given route data&lt;/li&gt;
&lt;li&gt;&lt;code&gt;JsonResult&lt;/code&gt; - Serializes a given &lt;code&gt;ViewData&lt;/code&gt; object to JSON format&lt;/li&gt;
&lt;li&gt;&lt;code&gt;JavaScriptResult&lt;/code&gt; - Returns a piece of JavaScript code that can be executed on the client&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ContentResult&lt;/code&gt; - Writes content to the response stream without requiring a view&lt;/li&gt;
&lt;li&gt;&lt;code&gt;FileContentResult&lt;/code&gt; - Returns a file to the client&lt;/li&gt;
&lt;li&gt;&lt;code&gt;FileStreamResult&lt;/code&gt; - Returns a file to the client, which is provided by a &lt;code&gt;Stream&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;FilePathResult&lt;/code&gt; - Returns a file to the client&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_are_“ActionFilters”in_MVC&quot;&gt;&lt;/a&gt;What are ActionFilters in MVC?&lt;/h2&gt;
ActionFilters help you to perform logic while an MVC action is executing or after an MVC action has executed.&lt;br /&gt;


&lt;img height=&quot;232&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/10.jpg&quot; width=&quot;280&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: ActionFilters in MVC&lt;/div&gt;
Action filters are useful in the following scenarios:&lt;br /&gt;


&lt;ol&gt;
&lt;li&gt;Implement post-processing logic before the action happens.&lt;/li&gt;
&lt;li&gt;Cancel a current execution.&lt;/li&gt;
&lt;li&gt;Inspect the returned value.&lt;/li&gt;
&lt;li&gt;Provide extra data to the action.&lt;/li&gt;
&lt;/ol&gt;
You can create action filters by two ways:&lt;br /&gt;


&lt;ul&gt;
&lt;li&gt;Inline action filter.&lt;/li&gt;
&lt;li&gt;Creating an &lt;code&gt;ActionFilter&lt;/code&gt; attribute.&lt;/li&gt;
&lt;/ul&gt;
To create an inline action attribute we need to implement the &lt;code&gt;IActionFilter&lt;/code&gt; interface. The &lt;code&gt;IActionFilter&lt;/code&gt; interface has two methods: &lt;code&gt;OnActionExecuted&lt;/code&gt; and &lt;code&gt;OnActionExecuting&lt;/code&gt;. We can implement pre-processing logic or cancellation logic in these methods.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain33&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre33&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; Default1Controller : Controller , IActionFilter
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult Index(Customer obj)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(obj);
    }
    &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; IActionFilter.OnActionExecuted(ActionExecutedContext filterContext)
    {
        Trace.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Action Executed&quot;&lt;/span&gt;);
    }
    &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; IActionFilter.OnActionExecuting(ActionExecutingContext filterContext)
    {
        Trace.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Action is executing&quot;&lt;/span&gt;);
    }
} &lt;/pre&gt;
The problem with the inline action attribute is that it cannot be 
reused across controllers. So we can convert the inline action filter to
 an action filter attribute. To create an action filter attribute we 
need to inherit from &lt;code&gt;ActionFilterAttribute&lt;/code&gt; and implement the &lt;code&gt;IActionFilter&lt;/code&gt; interface as shown in the below code.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain34&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre34&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; MyActionAttribute : ActionFilterAttribute , IActionFilter
{
    &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; IActionFilter.OnActionExecuted(ActionExecutedContext filterContext)
    {
        Trace.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Action Executed&quot;&lt;/span&gt;);
    }
    &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; IActionFilter.OnActionExecuting(ActionExecutingContext filterContext)
    {
      Trace.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Action executing&quot;&lt;/span&gt;);
    }
} &lt;/pre&gt;
Later we can decorate the controllers on which we want the action 
attribute to execute. You can see in the below code I have decorated the
 &lt;code&gt; Default1Controller&lt;/code&gt; with the &lt;code&gt;MyActionAttribute&lt;/code&gt; class which was created in the previous code.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain35&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre35&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;[MyActionAttribute]
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; Default1Controller : Controller 
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult Index(Customer obj)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(obj);
    }
}&lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Can_we_create_our_custom_view_engine_using_MVC&quot;&gt;&lt;/a&gt;Can we create our custom view engine using MVC?&lt;/h2&gt;
Yes, we can create our own custom view engine in MVC. To create our own custom view engine we need to follow three steps:&lt;br /&gt;


Let’ say we want to create a custom view engine where in the user can
 type a command like “&amp;lt;DateTime&amp;gt;” and it should display the 
current date and time.&lt;br /&gt;


&lt;strong&gt;Step 1&lt;/strong&gt;: We need to create a class which implements the &lt;code&gt;IView&lt;/code&gt; interface. In this class we should write the logic of how the view will be rendered in the &lt;code&gt;render&lt;/code&gt; function. Below is a simple code snippet for that.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain36&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre36&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; MyCustomView : IView
{
    &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; _FolderPath; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Define where  our views are stored
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; FolderPath
    {
        &lt;span class=&quot;code-keyword&quot;&gt;get&lt;/span&gt; { &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; _FolderPath; }
        &lt;span class=&quot;code-keyword&quot;&gt;set&lt;/span&gt; { _FolderPath = value; }
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Render(ViewContext viewContext, System.IO.TextWriter writer)
    {
       &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Parsing logic &amp;lt;dateTime&amp;gt;
&lt;/span&gt;        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; read the view file
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; strFileData = File.ReadAllText(_FolderPath);
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; we need to and replace &amp;lt;datetime&amp;gt; datetime.now value
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; strFinal = strFileData.Replace(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;&amp;lt;DateTime&amp;gt;&quot;&lt;/span&gt;, DateTime.Now.ToString());
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; this replaced data has to sent for display
&lt;/span&gt;        writer.Write(strFinal); 
    }
} &lt;/pre&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: We need to create a class which inherits from &lt;code&gt;VirtualPathProviderViewEngine&lt;/code&gt;
 and in this class we need to provide the folder path and the extension 
of the view name. For instance, for Razor the extension is “cshtml”; for
 aspx, the view extension is “.aspx”, so in the same way for our custom 
view, we need to provide an extension. Below is how the code looks like.
 You can see the &lt;code&gt;ViewLocationFormats&lt;/code&gt; is set to the &lt;em&gt;Views&lt;/em&gt; folder and the extension is “&lt;em&gt;.myview&lt;/em&gt;”.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain37&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre37&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; MyViewEngineProvider : VirtualPathProviderViewEngine
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; We will create the object of Mycustome view
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; MyViewEngineProvider() &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; constructor
&lt;/span&gt;    {
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Define the location of the View file
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.ViewLocationFormats = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;[] { &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;~/Views/{1}/{0}.myview&quot;&lt;/span&gt;, 
          &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;~/Views/Shared/{0}.myview&quot;&lt;/span&gt; }; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;location and extension of our views
&lt;/span&gt;    }
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;override&lt;/span&gt; IView CreateView(
      ControllerContext controllerContext, &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; viewPath, &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; masterPath)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; physicalpath = controllerContext.HttpContext.Server.MapPath(viewPath);
        MyCustomView obj = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; MyCustomView(); &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Custom view engine class
&lt;/span&gt;        obj.FolderPath = physicalpath; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; set the path where the views will be stored
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; obj; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; returned this view paresing
&lt;/span&gt;        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; logic so that it can be registered in the view engine collection
&lt;/span&gt;    }
    &lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;override&lt;/span&gt; IView CreatePartialView(ControllerContext controllerContext, &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; partialPath)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; physicalpath = controllerContext.HttpContext.Server.MapPath(partialPath);
        MyCustomView obj = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; MyCustomView(); &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Custom view engine class
&lt;/span&gt;        obj.FolderPath = physicalpath; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; set the path where the views will be stored
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; obj;
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; returned this view paresing logic
&lt;/span&gt;        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; so that it can be registered in the view engine collection
&lt;/span&gt;    }
} &lt;/pre&gt;
&lt;strong&gt;Step 3&lt;/strong&gt;: We need to register the view in the custom view collection. The best place to register the custom view engine in the &lt;code&gt;ViewEngines&lt;/code&gt; collection is the &lt;em&gt;global.asax&lt;/em&gt; file. Below is the code snippet for that.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain38&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;span id=&quot;precollapse38&quot; style=&quot;cursor: pointer; margin-bottom: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre38&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Application_Start()
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Step3 :-  register this object in the view engine collection
&lt;/span&gt;    ViewEngines.Engines.Add(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; MyViewEngineProvider());
    &amp;amp;hellip;..
} &lt;/pre&gt;
Below is a simple output of the custom view written using the commands defined at the top.&lt;br /&gt;


&lt;img height=&quot;84&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/11.jpg&quot; width=&quot;440&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: Custom view engine using MVC&lt;/div&gt;
If you invoke this view, you should see the following output:&lt;br /&gt;


&lt;img height=&quot;92&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/12.jpg&quot; width=&quot;412&quot; /&gt;&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;How_to_send_result_back_in_JSON_format_in_MVC&quot;&gt;&lt;/a&gt;How to send result back in JSON format in MVC&lt;/h2&gt;
In MVC, we have the &lt;code&gt;JsonResult&lt;/code&gt; class by which we can return back data in JSON format. Below is a simple sample code which returns back a &lt;code&gt;Customer&lt;/code&gt; object in JSON format using &lt;code&gt;JsonResult&lt;/code&gt;.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain39&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre39&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; JsonResult getCustomer()
{
    Customer obj = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Customer();
    obj.CustomerCode = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;1001&quot;&lt;/span&gt;;
    obj.CustomerName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Shiv&quot;&lt;/span&gt;;
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; Json(obj,JsonRequestBehavior.AllowGet);
}&lt;/pre&gt;
Below is the JSON output of the above code if you invoke the action via the browser.&lt;br /&gt;


&lt;img height=&quot;92&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/13.jpg&quot; width=&quot;552&quot; /&gt;&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_is_“WebAPI”&quot;&gt;&lt;/a&gt;What is WebAPI?&lt;/h2&gt;
HTTP is the most used protocol. For the past many years, browser was 
the most preferred client by which we consumed data exposed over HTTP. 
But as years passed by, client variety started spreading out. We had 
demand to consume data on HTTP from clients like mobile, JavaScript, 
Windows applications, etc.&lt;br /&gt;


For satisfying the broad range of clients REST was the proposed approach. You can read more about REST from the WCF chapter.&lt;br /&gt;


WebAPI is the technology by which you can expose data over HTTP following REST principles.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;But_WCF_SOAP_also_does_the_same_thing,_so_how_does_“WebAPI”_differ&quot;&gt;&lt;/a&gt;But WCF SOAP also does the same thing, so how does WebAPI differ?&lt;/h2&gt;
&lt;table class=&quot;ArticleTable&quot;&gt;
 &lt;thead&gt;
&lt;tr&gt;
   &lt;td&gt;&amp;nbsp;&lt;/td&gt;
   &lt;td&gt;&lt;strong&gt;SOAP&lt;/strong&gt;&lt;/td&gt;
   &lt;td width=&quot;366&quot;&gt;&lt;strong&gt;WEB API&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
 &lt;tbody&gt;
&lt;tr&gt;
   &lt;td&gt;&lt;strong&gt;Size&lt;/strong&gt;&lt;/td&gt;
   &lt;td&gt;Heavy weight because of complicated WSDL structure.&lt;/td&gt;
   &lt;td width=&quot;366&quot;&gt;Light weight, only the necessary information is transferred.&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;&lt;strong&gt;Protocol&lt;/strong&gt;&lt;/td&gt;
   &lt;td&gt;Independent of protocols.&lt;/td&gt;
   &lt;td width=&quot;366&quot;&gt;Only for HTTP protocol&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;&lt;strong&gt;Formats&lt;/strong&gt;&lt;/td&gt;
   &lt;td&gt;To parse SOAP message, the client needs to understand WSDL 
format. Writing custom code for parsing WSDL is a heavy duty task. If 
your client is smart enough to create proxy objects like how we have in 
.NET (add reference) then SOAP is easier to consume and call.&lt;/td&gt;
   &lt;td width=&quot;366&quot;&gt;Output of WebAPI are simple string messages, JSON, simple XML format, etc. So writing parsing logic for that is very easy.&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;&lt;strong&gt;Principles&lt;/strong&gt;&lt;/td&gt;
   &lt;td&gt;SOAP follows WS-* specification.&lt;/td&gt;
   &lt;td width=&quot;366&quot;&gt;WebAPI follows REST principles. (Please refer to REST in WCF chapter.)&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;With_WCF_also_you_can_implement_REST,So_why_WebAPI&quot;&gt;&lt;/a&gt;With WCF you can implement REST, so why WebAPI?&lt;/h2&gt;
WCF was brought into implement SOA, the intention was never to 
implement REST. WebAPI is built from scratch and the only goal is to 
create HTTP services using REST. Due to the one point focus for creating
 REST service, WebAPI is more preferred.&lt;br /&gt;


&lt;h3&gt;
&lt;strong&gt;How to implement WebAPI in MVC&lt;/strong&gt;&lt;/h3&gt;
Below are the steps to implement WebAPI:&lt;br /&gt;


&lt;strong&gt;Step 1&lt;/strong&gt;: Create the project using the WebAPI template.&lt;br /&gt;


&lt;img height=&quot;232&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/14.jpg&quot; width=&quot;260&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: Implement WebAPI in MVC&lt;/div&gt;
&lt;strong&gt;Step 2&lt;/strong&gt;: Once you have created the project you will notice that the controller now inherits from &lt;code&gt;ApiController&lt;/code&gt; and you can now implement POST, GET, PUT, and DELETE methods of the HTTP protocol.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain40&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;span id=&quot;precollapse40&quot; style=&quot;cursor: pointer; margin-bottom: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre40&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; ValuesController : ApiController
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; GET api/values
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; IEnumerable&amp;lt;&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;&amp;gt; Get()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;[] { &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;value1&quot;&lt;/span&gt;, &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;value2&quot;&lt;/span&gt; };
    }
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; GET api/values/5
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; Get(&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; id)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;value&quot;&lt;/span&gt;;
    }
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; POST api/values
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Post([FromBody]&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; value)
    {
    }
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; PUT api/values/5
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Put(&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; id, [FromBody]&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; value)
    {
    }
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; DELETE api/values/5
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Delete(&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; id)
    {
    }
} &lt;/pre&gt;
&lt;strong&gt;Step 3&lt;/strong&gt;: If you make an HTTP GET call you should get the below results:&lt;br /&gt;


&lt;img height=&quot;233&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/15.jpg&quot; width=&quot;381&quot; /&gt;&lt;br /&gt;


&lt;div class=&quot;Caption&quot;&gt;
Figure: HTTP&lt;/div&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HowcanwedetectthataMVCcontrolleriscalledbyPOSTorGET&quot;&gt;&lt;/a&gt;How can we detect that an MVC controller is called by POST or GET?&lt;/h2&gt;
To detect if the call on the controller is a POST action or a GET action we can use the &lt;code&gt;Request.HttpMethod&lt;/code&gt; property as shown in the below code snippet.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain41&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre41&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; ActionResult SomeAction()
{
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (Request.HttpMethod == &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;POST&quot;&lt;/span&gt;)
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;SomePage&quot;&lt;/span&gt;);
    }
    &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
    {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; View(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;SomeOtherPage&quot;&lt;/span&gt;);
    }
}&lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;WhatisBundlingandminificationinMVC&quot;&gt;What is bundling and minification in MVC?&lt;/a&gt;&lt;/h2&gt;
Bundling and minification helps us improve request load times of a page thus increasing performance.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Howdoesbundlingincreaseperformance&quot;&gt;How does bundling increase performance?&lt;/a&gt;&lt;/h2&gt;
Web projects always need CSS and script files. Bundling helps us 
combine multiple JavaScript and CSS files in to a single entity thus 
minimizing multiple requests in to a single request.&lt;br /&gt;


For example consider the below web request to a page . This page consumes two JavaScript files &lt;em&gt;Javascript1.js&lt;/em&gt; and &lt;em&gt;Javascript2.js&lt;/em&gt;. So when this is page is requested it makes three request calls:&lt;br /&gt;


&lt;ul&gt;
&lt;li&gt;One for the Index page.&lt;/li&gt;
&lt;li&gt;Two requests for the other two JavaScript files: &lt;em&gt;Javascript1.js&lt;/em&gt; and &lt;em&gt;Javascript2.js&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;
The below scenario can become worse if we have a lot of JavaScript 
files resulting in multiple requests, thus decreasing performance. If we
 can somehow combine all the JS files into a single bundle and request 
them as a single unit that would result in increased performance (see 
the next figure which has a single request).&lt;br /&gt;


&lt;img height=&quot;180&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/image1.png&quot; width=&quot;572&quot; /&gt;&lt;br /&gt;


&lt;img height=&quot;172&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/image2.png&quot; width=&quot;532&quot; /&gt;&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;SohowdoweimplementbundlinginMVC&quot;&gt;So how do we implement bundling in MVC?&lt;/a&gt;&lt;/h2&gt;
Open &lt;em&gt;BundleConfig.cs&lt;/em&gt; from the &lt;em&gt;App_Start&lt;/em&gt; folder.&lt;br /&gt;


&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;img height=&quot;172&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/image3.png&quot; width=&quot;187&quot; /&gt;&lt;/div&gt;
In &lt;em&gt;BundleConfig.cs&lt;/em&gt;, add the JS files you want bundle into a 
single entity in to the bundles collection. In the below code we are 
combining all the javascript JS files which exist in the &lt;em&gt;Scripts&lt;/em&gt; folder as a single unit in to the bundle collection.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain42&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre42&quot; style=&quot;margin-top: 0px;&quot;&gt;bundles.Add(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ScriptBundle(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;~/Scripts/MyScripts&quot;&lt;/span&gt;).Include(
&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;~/Scripts/*.js&quot;&lt;/span&gt;)); &lt;/pre&gt;
Below is how your &lt;em&gt;BundleConfig.cs&lt;/em&gt; file will look like:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain43&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre43&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;  &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; BundleConfig
{
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; RegisterBundles(BundleCollection bundles)
    {
        bundles.Add(&lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ScriptBundle(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;~/Scripts/MyScripts&quot;&lt;/span&gt;).Include(
           &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;~/Scripts/*.js&quot;&lt;/span&gt;));
        BundleTable.EnableOptimizations = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;
    }
}
&lt;/pre&gt;
Once you have combined your scripts into one single unit we then to 
include all the JS files into the view using the below code. The below 
code needs to be put in the ASPX or Razor view.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain44&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre44&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;= Scripts.Render(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;~/Scripts/MyScripts&quot;&lt;/span&gt;)  &lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
If you now see your page requests you would see that script request is combined into one request.&lt;br /&gt;


&lt;img height=&quot;172&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/image4.png&quot; width=&quot;532&quot; /&gt;&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Howcanyoutestbundlingindebugmode&quot;&gt;How can you test bundling in debug mode?&lt;/a&gt;&lt;/h2&gt;
If you are in a debug mode you need to set &lt;code&gt;EnableOptimizations&lt;/code&gt; to true in the &lt;em&gt;bundleconfig.cs&lt;/em&gt; file or else you will not see the bundling effect in the page requests.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain45&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre45&quot; style=&quot;margin-top: 0px;&quot;&gt;BundleTable.EnableOptimizations = &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Explainminificationandhowtoimplementthesame&quot;&gt;Explain minification and how to implement it&lt;/a&gt;&lt;/h2&gt;
Minification reduces the size of script and CSS files by removing 
blank spaces , comments etc. For example below is a simple javascript 
code with comments.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain46&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre46&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; This is test
&lt;/span&gt;var x = &lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;;
x = x + &lt;span class=&quot;code-digit&quot;&gt;1&lt;/span&gt;;
x = x * &lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;;
&lt;/pre&gt;
After implementing minification the JavaScript code looks like below.
 You can see how whitespaces and comments are removed to minimize file 
size, thus increasing performance.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain47&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre47&quot; style=&quot;margin-top: 0px;&quot;&gt;var x=0;x=x+1;x=x*&lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;;&lt;/pre&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Howtoimplementminification&quot;&gt;How do we implement minification?&lt;/a&gt;&lt;/h2&gt;
When you implement bundling, minification is implemented by itself. 
In other words the steps to implement bundling and minification are the 
same.&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;ExplainAreasinMVC&quot;&gt;Explain Areas in MVC?&lt;/a&gt;&lt;/h2&gt;
Areas help you to group functionalities in to independent modules 
thus making your project more organized. For example in the below MVC 
project we have four controller classes and as time passes by if more 
controller classes are added it will be difficult to manage. In bigger 
projects you will end up with 100’s of controller classes making life 
hell for maintenance.&lt;br /&gt;


&lt;img height=&quot;165&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/MVCArea1.jpg&quot; width=&quot;380&quot; /&gt;&lt;br /&gt;


If we can group controller classes in to logical section like 
“Invoicing” and “Accounting” that would make life easier and that’s what
 “Area” are meant to.&lt;br /&gt;


&lt;img height=&quot;195&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/MVCArea2.png&quot; width=&quot;372&quot; /&gt;&lt;br /&gt;


You can add an area by right clicking on the MVC solution and clicking on “Area” menu as shown in the below figure.&lt;br /&gt;


&lt;img height=&quot;224&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/MVCArea3.png&quot; width=&quot;626&quot; /&gt;&lt;br /&gt;


In the below image we have two “Areas” created “Account” and 
“Invoicing” and in that I have put the respective controllers. You can 
see how the project is looking more organized as compared to the 
previous state.&lt;br /&gt;


&lt;img height=&quot;413&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/MVCArea4.png&quot; width=&quot;395&quot; /&gt;&lt;br /&gt;


&lt;h2&gt;
&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Explain_the_concept_of_View_Model_in_MVC&quot;&gt;Explain the concept of View Model in MVC?&lt;/a&gt;&lt;/h2&gt;
A view model is a simple class which represents data to be displayed on the view.&lt;br /&gt;


For example below is a simple customermodel object with “CustomerName” and “Amount” property.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain48&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;img height=&quot;9&quot; id=&quot;preimg48&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; style=&quot;cursor: pointer;&quot; width=&quot;9&quot; /&gt;&lt;span id=&quot;precollapse48&quot; style=&quot;cursor: pointer; margin-bottom: 0px;&quot;&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;Copy Code&lt;/div&gt;
&lt;pre id=&quot;pre48&quot; style=&quot;margin-top: 0px;&quot;&gt;CustomerViewModel obj = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; CustomerViewModel();
obj.Customer.CustomerName = &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Shiv&quot;&lt;/span&gt;;
obj.Customer.Amount = &lt;span class=&quot;code-digit&quot;&gt;1000&lt;/span&gt;;
&lt;/pre&gt;
But when this “Customer” model object is displayed on the MVC view it
 looks something as shown in the below figure. It has “CustomerName” , 
“Amount” plus “&lt;strong&gt;Customer Buying Level&lt;/strong&gt;” fields on the 
view / screen. “Customer buying Level” is a color indicationwhich 
indicates how aggressive the customer is buying.&lt;br /&gt;


“Customer buying level” color depends on the value of the “Amount 
property. If the amount is greater than 2000 then color is red , if 
amount is greater than 1500 then color is orange or else the color is 
yellow.&lt;br /&gt;


&lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;In other words “Customer buying level” is an extra property which is calculated on the basis of amount.&lt;/span&gt;&lt;br /&gt;


&lt;div align=&quot;center&quot;&gt;
&lt;img height=&quot;106&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/10_image.png&quot; width=&quot;435&quot; /&gt;&lt;/div&gt;
So the Customer viewmodel class has three properties &lt;br /&gt;


&lt;ul&gt;
&lt;li&gt;“TxtCustomerName” textbox takes data from “CustomerName” property as it is.&lt;/li&gt;
&lt;li&gt;“TxtAmount” textbox takes data from “Amount” property of model as it is.&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;“CustomerBuyingLevelColor” displays color value depending on the “Amount “ value.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;table border=&quot;1&quot; style=&quot;width: 374px;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
   &lt;td&gt;&lt;strong&gt;Customer Model&lt;/strong&gt;&lt;/td&gt;
   &lt;td&gt;&lt;strong&gt;Customer ViewModel&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;CustomerName&lt;/td&gt;
   &lt;td&gt;TxtCustomerName&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;Amount&lt;/td&gt;
   &lt;td&gt;TxtAmount&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
   &lt;td&gt;&amp;nbsp;&lt;/td&gt;
   &lt;td&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;CustomerBuyingLevelColor&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;What_kind_of_logic_view_model_class_will_have&quot;&gt;What kind of logic view model class will have?&lt;/a&gt;&lt;/h2&gt;
As the name says view model this class has the gel code or connection code which connects the view and the model.&lt;br /&gt;


So the view model class can have following kind of logics:-&lt;br /&gt;


&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;&lt;strong&gt;Color transformation logic: - &lt;/strong&gt;For
 example you have a “Grade” property in model and you would like your UI
 to display “red” color for high level grade, “yellow” color for low 
level grade and “green” color of ok grade.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;&lt;strong&gt;Data format transformation logic :-&lt;/strong&gt;Your
 model has a property “Status” with “Married” and “Unmarried” value. In 
the UI you would like to display it as a checkbox which is checked if 
“married” and unchecked if “unmarried”.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;&lt;strong&gt;Aggregation logic: -&lt;/strong&gt;You
 have two differentCustomer and Address model classes and you have view 
which displays both “Customer” and “Address” data on one go.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;&lt;strong&gt;Structure downsizing: - &lt;/strong&gt;You
 have “Customer” model with “customerCode” and “CustomerName” and you 
want to display just “CustomerName”. So you can create a wrapper around 
model and expose the necessary properties.&lt;/span&gt;
 How can we use two ( multiple) models with a single view?
 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt; &lt;/span&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;Let us first 
try to understand what the interviewer is asking. When we bind a model 
with a view we use the model dropdown as shown in the below figure. In 
the below figure we can only select one model. &lt;/span&gt;&lt;br /&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt; &lt;/span&gt;

 &lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;&lt;img height=&quot;330&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/Display.png&quot; width=&quot;297&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt; &lt;/span&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;But what if we want to bind “Customer” as well as “Order” class to the view.&lt;/span&gt;&lt;br /&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt; &lt;/span&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;For that we 
need to create a view model which aggregates both the classes as shown 
in the below code. And then bind that view model with the view.&lt;/span&gt;&lt;br /&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt; &lt;/span&gt;

 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain49&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;img height=&quot;9&quot; id=&quot;preimg49&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; style=&quot;cursor: pointer;&quot; width=&quot;9&quot; /&gt;&lt;span id=&quot;precollapse49&quot; style=&quot;cursor: pointer; margin-bottom: 0px;&quot;&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;Copy Code&lt;/div&gt;
&lt;pre id=&quot;pre49&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; CustOrderVM
{
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt;  Customer cust = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Customer();
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; Order Ord = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; Order();
}
&lt;/pre&gt;
&lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt; &lt;/span&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;In the view we can refer both the model using the view model as shown in the below code.&lt;/span&gt;&lt;br /&gt;


 &lt;div class=&quot;pre-action-link&quot; id=&quot;premain50&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;img height=&quot;9&quot; id=&quot;preimg50&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; style=&quot;cursor: pointer;&quot; width=&quot;9&quot; /&gt;&lt;span id=&quot;precollapse50&quot; style=&quot;cursor: pointer; margin-bottom: 0px;&quot;&gt; Collapse&lt;/span&gt;&lt;span&gt; | &lt;/span&gt;Copy Code&lt;/div&gt;
&lt;pre id=&quot;pre50&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;= model.cust.Name &lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-pagedirective&quot;&gt;&amp;lt;%&lt;/span&gt;= model.Ord.Number &lt;span class=&quot;code-pagedirective&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt; &lt;/span&gt;

 &lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Explain_the_need_of_display_mode_in_MVC&quot;&gt;Explain the need of display mode in MVC?&lt;/a&gt;&lt;/h2&gt;
&lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt; &lt;/span&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;Display mode 
displays views depending on the device the user has logged in with. So 
we can create different views for different devices anddisplay mode will
 handle the rest. &lt;/span&gt;&lt;br /&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt; &lt;/span&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;For example we can create a view “Home.aspx” which will render for the desktop computers and &lt;a href=&quot;http://www.codeproject.com/Articles/556995/Home.Mobile.aspx&quot;&gt;Home.Mobile.aspx&lt;/a&gt;
 for mobile devices. Now when an end user sends a request to the MVC 
application, display mode checks the “user agent” headers and renders 
the appropriate view to the device accordingly.&lt;/span&gt;&lt;br /&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt; &lt;/span&gt;

 &lt;span style=&quot;color: #111111; font-size: 14px;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/DisplayMode.jpg&quot; /&gt;&lt;/span&gt;&lt;br /&gt;


&lt;h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;ExplainMVCmodelbinders&quot;&gt;Explain MVC model binders?&lt;/a&gt;&lt;/h2&gt;
Model binder maps HTML form elements to the model. It acts like a
 bridge between HTML UI and MVC model. Many times HTML UI names are 
different than the model property names. So in the binder we can write 
the mapping logic between the UI and the model.&lt;br /&gt;

    &lt;div align=&quot;center&quot;&gt;
    &lt;img border=&quot;0&quot; height=&quot;214&quot; src=&quot;http://www.codeproject.com/KB/aspnet/556995/form.png&quot; width=&quot;457&quot; /&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/1368398166927403843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/06/explain-about-mvc-breafly.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/1368398166927403843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/1368398166927403843'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/06/explain-about-mvc-breafly.html' title='Explain about MVC Breafly '/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-6817002256593441397</id><published>2014-06-24T03:21:00.003-07:00</published><updated>2014-06-24T03:32:19.250-07:00</updated><title type='text'>Real Time Scenario Based Interview Questions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Hai Friends,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto; font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;As we know that getting more experience and then going for the interview requires more knowledge and if we see, it requires more practical knowledge.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;So in the continuation, I am trying to post few questions of OOPS which are scenario based and will be helpful when you are going for the interviews with 3+ years experience. These questions will definitely make you to think something more which you were thinking before about the answer of a particular question. With the hope that these questions and answers will be helpful to you, I am posting them and will try to update and include more in the future.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;These questions are scenario based questions in .Net technologies which will help to prepare for the interviews. Few questions are related to OOP’s concepts, and then few on Garbage Collector and memory related. So you can prepare them accordingly. These questions will be useful for those who are having the 3+ years experience and looking out for the opportunities in good companies.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Verdana; text-indent: -0.25in;&quot;&gt;1.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana; text-indent: -0.25in;&quot;&gt;How the Encapsulation is different from Abstraction? I think both are used to hide the unnecessary details? Then how they are different?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana; line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;Ans.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;Yes, Both Encapsulation and&amp;nbsp;Abstraction&amp;nbsp;do the same thing but with few differences.&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;Encapsulation mainly encapsulates the object and so hides the details as well as it binds the data.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;So Encapsulation = Hiding&amp;nbsp;+ Binding the data&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;&lt;b&gt;How it hides the data? Real-time Example?&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;Take the example of n-Tier application where we have an additional layer called Business Objects. This layer&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana;&quot;&gt;contains all the entities with their properties. Take an entity name: Employee. This Employee will have the&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;name &quot;EmployeeBO.cs&quot; and contains the public properties like EmpId, EmpName, Sal ets&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;&lt;b&gt;EmployeeBO.cs&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi387roOO7DzUGiXaVr7gOH6i8fJRG82T-1tsVCaJ6umIF4q0ucLiFwTX7O37w7YqqsBvSpg3lDbjAlx6KqGCrXeZpHr7m8fa-RS1Ftrm5YKivTLTsyGKgDRy4XPVk_-2Fme6WxdztpqvhZ/s1600/test.JPG&quot; style=&quot;background-color: #fff2cc; color: #b5653b; margin-left: 1em; margin-right: 1em; text-decoration: none;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi387roOO7DzUGiXaVr7gOH6i8fJRG82T-1tsVCaJ6umIF4q0ucLiFwTX7O37w7YqqsBvSpg3lDbjAlx6KqGCrXeZpHr7m8fa-RS1Ftrm5YKivTLTsyGKgDRy4XPVk_-2Fme6WxdztpqvhZ/s1600/test.JPG&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px; position: relative;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana; line-height: 10.5pt; text-align: justify; text-indent: -13.8pt;&quot;&gt;So this is the presentation of one property in the Business object class. Now wherever we want this attribute,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-align: justify; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;We just need to create the object of this class and set/get the value of EmpId as:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-align: justify; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: green; font-family: Consolas;&quot;&gt;// set the EmpId&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-align: justify; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas;&quot;&gt;EmployeeBo&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Consolas;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Consolas;&quot;&gt;objEmployeeBO =&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Consolas;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #2b91af; font-family: Consolas;&quot;&gt;EmployeeBO&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Consolas;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-align: justify; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Consolas;&quot;&gt;objEmployeeBO.EmpId = 101;&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Consolas;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: green; font-family: Consolas;&quot;&gt;// get the EmpId&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Consolas;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Consolas;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Consolas;&quot;&gt;empId = objEmployeeBO.EmpID;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;Now the question is where its setting or getting the value?&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;EmpId is the public property in the EmployeeBO class and contain no value. Only _empId contains the value&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Arial;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;which is private and so it is not accessible.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;So binding of the data happens to the EmpId through _empID and hiding happends through _empId which is&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;private. The Data is accessed through the Public property while the actual data is in private variable. So&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;binding&amp;nbsp;+ hiding using Encapsulation.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;Abstraction is to ignore the unnecessary details and get the required details. So it also hides &amp;nbsp;the unnecessary&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;b style=&quot;color: #4e2800; font-family: Verdana; line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;details. How?&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Abstract&amp;nbsp;class is the special type of class which can contain the abstract and concrete&amp;nbsp;members. If we define&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;The member (Method/Property) as abstract, it must be overrides to the child class. We are not bothering here&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana; line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;&amp;nbsp;About the non-abstract or concrete members. Which is an unnecessary detail? If we ad an&amp;nbsp;additional&amp;nbsp;concrete&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana; line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;&amp;nbsp;Member in&amp;nbsp;the abstract class, we need not to do&amp;nbsp;anything&amp;nbsp;in the child class. But if we add the&amp;nbsp;abstract&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana; line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;&amp;nbsp;members, we must have to override it. So abstract doesn&#39;t care about the concrete members which are&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana; line-height: 10.5pt; text-indent: -13.8pt;&quot;&gt;unnecessary&amp;nbsp;for it and so it hides those details.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Verdana; text-indent: -0.25in;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Verdana; text-indent: -0.25in;&quot;&gt;2.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana; text-indent: -0.25in;&quot;&gt;What do you mean by early binding and late binding in the object bindings? Which is good? Please give me a scenario where you have used the early binding and late binding concepts in your application?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;b&gt;Ans.&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #4e2800; font-family: Verdana, sans-serif; text-align: justify; text-indent: -0.25in;&quot;&gt;In .Net, the early binding and last binding concepts comes under the polymorphism. As we know that there are 2 types of polymorphism-&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;1. Compile Time polymorphism&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 2. Run time polymorphism&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;Compile Time polymorphism&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;also called as the Overloading where we have the same method name with different behaviors. By implementing the multiple prototype of the same method, we can achieve the behavior of the Overloading.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;Also this behavior is valid only for a single class. It means we should have all the overloaded methods in the same class.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;e.g.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLawxYLnwzkm59bTP3Dd2SsZpWSpJN1c-OBLln4JkOdeJyDuhNvZYft9KGmT-Jw9mDOw5JVR9mAABrZ_96E08uzje1JJSz0tMNenwZ6FVSvGMu2uLwKXEh-os4if1nhAEJlEB4wmzPWjaM/s1600/earlybinding.jpg&quot; style=&quot;color: #b5653b; margin-left: 1em; margin-right: 1em; text-align: left; text-decoration: none; text-indent: -0.25in;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLawxYLnwzkm59bTP3Dd2SsZpWSpJN1c-OBLln4JkOdeJyDuhNvZYft9KGmT-Jw9mDOw5JVR9mAABrZ_96E08uzje1JJSz0tMNenwZ6FVSvGMu2uLwKXEh-os4if1nhAEJlEB4wmzPWjaM/s1600/earlybinding.jpg&quot; height=&quot;165&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px; position: relative;&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif; text-indent: -0.25in;&quot;&gt;&amp;nbsp; &amp;nbsp;The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;Run time polymorphism&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;also named as the Overriding. This concept works in between classes or multiple classes or parent child classes where the child class has to get the behavior of the base class by inheriting the base class.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; In this concept we generally have an abstract or virtual method in the base class and we override that method in the child class by using the override method.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; e.g.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxgwUjw9BtxlkO5tx5hoShzNd_ipISENuL8dqrnLRlEnHOLyGgCmYk0lDX0YWlgMYjzWiwB7MYw5-__RWeUjwcKNQesWFip4paukfo9Qqzsc7N889nj1lESIaI2-o1ceffkBqnbc5hdmri/s1600/LateBinding.jpg&quot; style=&quot;color: #b5653b; margin-left: 1em; margin-right: 1em; text-decoration: none;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxgwUjw9BtxlkO5tx5hoShzNd_ipISENuL8dqrnLRlEnHOLyGgCmYk0lDX0YWlgMYjzWiwB7MYw5-__RWeUjwcKNQesWFip4paukfo9Qqzsc7N889nj1lESIaI2-o1ceffkBqnbc5hdmri/s1600/LateBinding.jpg&quot; height=&quot;267&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px; position: relative;&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif; text-align: justify; text-indent: -0.25in;&quot;&gt;&amp;nbsp; &amp;nbsp; So now we know the Compile Time polymorphism and Run Time polymorphism. The compile time polymorphism uses the concept of early binding and Run time polymorphism uses it as the late binding.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;In early binding, the runtime (CLR) gets the behavior in the compilation of the program. It means that the method behavior will get compiled before in the early binding.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; In Late binding, like Overriding, the behavior of the class and methods gets by the CLR when creating the object means at runtime. So, in the late binding the behavior of the class members identified by the CLR at runtime.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif; text-indent: -0.25in;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;Now come to the next part of the question-which is good?&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;One can’t say about the answer of this question, there are the scenarios where the early binding is good. When you have lot of objects and in that case, the early binding behavior performs well. While the late binding will be good when we have less objects. Let’s say you want the dropdown list to be loaded when you click on it and not while the loading of the page. So in some scenario, it will be good if we have while load and it will not be good when you click.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-align: justify;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; color: #4e2800; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; So it’s all depends on how you have implemented and the form structure.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.5in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;3.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;In garbage collection, how the object generations come in the picture? How many generations an object can have? Please tell me the process of disposing the objects based on the generations? Can an object move from one generation to another? If yes then why? What’s the need to have different generations as we are going to dispose the objects which are marked by the Garbage collector?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana; text-indent: -0.25in;&quot;&gt;&lt;b&gt;Ans.&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Let’s start with&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;what is Garbage collection&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;first and then we will come to our main question of the post. As we know that all the objects created using the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;new&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;operator gets fits in to the Heap memory. So whenever a new object gets created, it tries to fit in the heap memory. Now let’s say the heap memory is full and there is no place to keep another newly created object.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; In that case the Garbage collector installed, which is the background process, runs through CLR and take the unused objects memory. It mainly cleanup the heap memory and the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;new&lt;/b&gt;objects get placed in to it.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Now the question comes that for which objects it reclaims for the memory? How the object generations come in the picture?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; It depends on the objects generations. The CLR finds out the objects which are no longer used by the application since longer time and then the Garbage collection reclaim their memory.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;How many generations an object can have?&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;Please tell me the process of disposing the objects based on the generations?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Actually there are 3 generations exists for the objects which are written under the .Net framework library. When a new object gets created, by default it moves to the generation 0.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Can an object move from one generation to another?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Now when the generation 0 objects gets occupied with the memory and garbage collector gets called by the run-time. It checks the objects which are no longer used by the application and mark them for deletion. After deleting or reclaim the memory, the older objects moved to next generation i.e. Generation 1. Now the next time the CLR will check for the Generation 1 object too and if it finds that in generation 1 if the objects are not used since longer time, it will mark them for release and move the remaining objects to generation 2.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;In generation the objects which are under the main method, exists as they gets removed either at the end of the program or when both the generation 0 and generation 1 objects are using.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot;&gt;&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;What’s the need to have different generations as we are going to dispose the objects which are marked by the Garbage collector?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;With the different generation, it improves the performance of the application as the Garbage collector need not to check for each of the objects in the memory. It first checks for the generation 0 objects and reclaim the memory. If still needs then goes to the generation 1 and then 2.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.5in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-left: 0.5in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;4.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;What is object graph in garbage collector? Is this the graph physically exists? Or how this graph gets created?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;font-family: Verdana; text-indent: -0.25in;&quot;&gt;&lt;b&gt;Ans.&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; text-indent: -0.25in;&quot;&gt;When the Garbage Collector gets called by the CLR to DE-allocate the memory in the heap, the Garbage Collector start finding the references of all the reachable objects which are currently in use. So it find the objects which are used by the processes and for rest of objects which are un-reachable or the Garbage collector is not able to find the references for them, it marks them for deletion.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Here the Garbage collector makes an Object graph which keeps track of all the objects which are marked for deletion. After the deleting the references for those objects, the heap memory gets compacted and a new root becomes available to use by the new created object.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in; text-indent: -0.25in;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;Is this the graph physically exists? Or how this graph gets created?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif; line-height: 14.949999809265137px;&quot;&gt;&amp;nbsp; &amp;nbsp; No, this object graph creates virtually by the Garbage Collector to keep all the objects and to make them for deletion. This is the Garbage Collector responsibility to create this object graph and gets the references of each reachable object which are used by the application&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.5in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;5.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Can we suppress the Garbage collector? If yes, then why do we need to suppress it as it is used to reclaim the unused memory and which improve s the performance of our application?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; text-indent: -0.25in;&quot;&gt;&lt;b&gt;Ans.&lt;/b&gt;&amp;nbsp;Yes, We can suppress the Garbage Collector. There is the Static method in GC class called as SupressFinalize.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; text-indent: -0.25in;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;GC&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;SuppressFinalize&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;(objectName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; text-indent: -0.25in;&quot;&gt;&amp;nbsp; &amp;nbsp; This Static method takes a parameter for the object. So we can pass it to suppress the claiming memory for this object.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana; text-indent: -0.25in;&quot;&gt;&amp;nbsp; &amp;nbsp; Now the question comes &quot;&lt;/span&gt;&lt;span style=&quot;background-color: #fff2cc; color: blue; font-family: Verdana; text-indent: -0.25in;&quot;&gt;why do we need to suppress it as it is used to reclaim the unused memory&quot;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif; line-height: 18.399999618530273px;&quot;&gt;&amp;nbsp; &amp;nbsp; So, whenever we are using dispose method for class object,which is capable of disposing the object and in that case we don&#39;t need to use this method to again reclaim the memory.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif; line-height: 18.399999618530273px;&quot;&gt;&amp;nbsp; &amp;nbsp; e.g.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif; line-height: 18.399999618530273px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;DemoClass&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;IDisposable&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; text-indent: 0px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; text-indent: 0px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;Dispose&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;()&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; text-indent: 0px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dispose&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
        GC&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;SuppressFinalize&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; text-indent: 0px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;color: blue; font-family: Verdana; text-indent: -0.25in;&quot;&gt;&amp;nbsp; &amp;nbsp; As we have seen above,the DemoClass is inherited by IDisposable interface and which have the Dispose method to implement.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Verdana; text-indent: -0.25in;&quot;&gt;&amp;nbsp; &amp;nbsp; Hence after implementation of Dispose() method, we need not to reclaim the memory using the Garbage collector and so we can use the SuppressFinalize() for the current class object.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Verdana; text-indent: -0.25in;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana; text-indent: -0.25in;&quot;&gt;6.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana; text-indent: -0.25in;&quot;&gt;We already have the Finalize method which reclaims the memory using the Garbage collector. This is automatic process then why do we have the Dispose () method? Is this method different from Finalize ()? What is the interface from which the Dispose () method inherited?&lt;/span&gt;&lt;br /&gt;
&lt;b style=&quot;font-family: Verdana; text-indent: -0.25in;&quot;&gt;Ans.&lt;/b&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&amp;nbsp;Yes, We have the Finalize() method which is used to reclaim the memory for the unused objects. The Finalize() method is sufficient to release the memory from heap for the un-referenced&amp;nbsp;object but it is only for the managed objects. So Finalize() method can reclaim the managed objects memory from the heap which are not used since longer time.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&amp;nbsp; &amp;nbsp; Then what about the objects which are unmanaged? The objects which are out of .Net CLR? The objects &amp;nbsp;where the CLR can&#39;t be used to manage? Dispose() method is used for all those objects which do not comes under CLR or under the Managed heap. Dispose() method can be overrides and can be written to reclaim the object of those classes. Dispose() method is implemented by using the IDisposable interface.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif; line-height: 18.399999618530273px;&quot;&gt;e.g.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc; font-family: Verdana, sans-serif; line-height: 18.399999618530273px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp; public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;border: 0px; color: darkblue; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;TestClass&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;IDisposable&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;typ&quot; style=&quot;border: 0px; color: #2b91af; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin: 0px; padding: 0px; text-indent: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; text-indent: 0px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;  public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;Dispose&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;()&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 17.804800033569336px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; text-indent: 0px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline; white-space: inherit;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; {&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Dispose&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; border: 0px; color: darkblue; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; }&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot; style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #2b91af; white-space: inherit;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.5in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;7.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Can we call the Finalize() method to be executed explicitly when we want that particular object memory to be reclaim by the Garbage Collector? If yes, then where do we need to write the code? If no then why?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.5in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;8.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Can we inherit child class from 2 base classes? If yes then how? If not then why? What is this scenario called as in OOPs? How to implement this kind of scenario where we need to inherit the methods from more than one base class?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.5in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;9.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;How the Virtual methods are different from General methods? Can we have a method in the base class and then in the child class can we write the same method? If not? Why? What is the error we will get if we write the same method in the child class with the same name as the parent class method name?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;10.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Why do we need abstract class or abstract members? Can’t we simply write the general methods and fulfill our requirements? Can we get any advantage by implantation of abstract members? As per the abstract class scenario, let’s say we have an abstract method called Show () in the abstract base class. Now if I am inheriting this base class to a child class, we need to override this abstract method to the child class. And then we will call this method by creating instance of child class.Now if we only have the method in the child class and then create the instance and call the same method? Then why abstract class method? Is that method doing anything here?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;11.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;How abstract class and interfaces are different? Can’t we create an abstract class by having all the members as abstract members and wherever required inherit and implement its members? Then why interface? I think interface is also doing the same thing? Then how they are different?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;12.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Can we have abstract properties in Interface? If yes, then how to write the syntax for the abstract property which is having the return type string?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;13.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Can we write static methods inside a non-static class? Is it possible to call a non-static method inside the static method? If yes then how?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;14.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Shadowing is the special type of overriding? How? Please explain?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc; color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;15.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;When we inherit a class which is having the private members. Are the private members also gets inherited? If yes? Why cant’ we get them by the class object? If no then why?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #fff2cc; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.25in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;16.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;What is the Difference between Coupling and Cohesion? If the components are more cohesive the software is good? Or vice versa?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;17.&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;See the below code snippet and think about the output.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-indent: -0.25in;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5w2NShogCjDEPMKQwtx4nRA0uTqG4Ga9ZHVoEqGFI_CJfTVpZ5oBOfCY7KTnej2UlIZAKX0flUuB6C0cb-rqM5volcHLWRZUZaJp8twhkoJBNXMjF1nkLwe01L3SJaUTI7I2M8venr5Lg/s1600/untitled1.JPG&quot; style=&quot;background-color: #fff2cc; clear: left; color: #b5653b; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-decoration: none; text-indent: -0.25in;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5w2NShogCjDEPMKQwtx4nRA0uTqG4Ga9ZHVoEqGFI_CJfTVpZ5oBOfCY7KTnej2UlIZAKX0flUuB6C0cb-rqM5volcHLWRZUZaJp8twhkoJBNXMjF1nkLwe01L3SJaUTI7I2M8venr5Lg/s320/untitled1.JPG&quot; height=&quot;316&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px; position: relative;&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;18.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;What is the Difference between HTTP enabled WCF Service and Web Services? I think if we restrict the WCF service just for the HTTP communication, both WCF and Web Service will have the same&amp;nbsp;behavior. Then why&amp;nbsp;still people prefer to have the WCF service rather than the Web Service. What all the things which can be achieved through HTTP enabled WCF service and cant be just from Web Service.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;19.&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;What is the Difference between SOAP enabled Services and ReST Services?&amp;nbsp;Which one is&amp;nbsp;preferred&amp;nbsp;and why?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;........................................................................................................&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #fff2cc;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 13.800000190734863px;&quot;&gt;1. Why we used Inheritance. What is the benefit of this.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 13.800000190734863px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;Ans. Inheritance is a way to inherit the base class members to the child class so that we can save lot of memory.&lt;br /&gt;let&#39;s say, if you are already having some properties defined in the base class and then if you are inheriting this base class to the child class, the extra memory need not to be wasted to declare the base class members again. While inheriting, automatically they will be inherited.&lt;br /&gt;e.g.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;class Mybase&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;int i, j;&lt;br /&gt;&amp;nbsp;float z;&lt;br /&gt;}&lt;br /&gt;class MyChild: Mybase&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;// no need to declare again the above variables&lt;br /&gt;&amp;nbsp;// as they will be automatically inherited.&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;As we need not to declare the variables again in the child class, so we have saved here 4 + 4 + 8 = 16 bytes of memory for the child class.&lt;br /&gt;Main usage of inheritance is &#39;Re-usability&#39;. No need to declare variables, methods again.. If u want, then use them from base class. It reduce your code from complexity.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;2. Why C# does not support Multiple Inheritance.&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. Multiple Inheritance is the situation in which when there are 2 base class and a single child class is trying to inherit the members from both of them then there is the confusion that which base class member should be inherited?&lt;br /&gt;e.g.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;class MyClass1&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;public void Show()&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; // something&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;class MyClass2&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;public void Show()&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; // something else&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;class MyChildClass: MyClass1, MyClass2&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;// not possible&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Due to this, the architecture of .Net or the framework doesn&#39;t support such situation and will throw the compile time error.&lt;br /&gt;In C++, it is possible because there both the methods in the different base classes will have the different memory location and object will be accessed through the memory location. But in Java or .Net the object accessed through the class members objects.&lt;br /&gt;It is quite difficult to implement multiple inheritance in C#. But we can do this through Interfaces.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;3. Why we used virtual keyword.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. If we want to override the members of the base class, we can make them as virtual. The virtual members have the capability to override them in the child class. If they are not overridden, the base class implementation will be executed.&lt;br /&gt;It is not the mandatory to override the virtual class members.&lt;br /&gt;e.g.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;class MybaseClass&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;public virtual void Show()&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; Console.WriteLine(&quot;hey..I am in base class&quot;);&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class MyChild: MyBaseClass&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;public override void Show()&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; Console.WriteLine(&quot;hey..I am in child class&quot;);&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;The preference will be given to child class always.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;public static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;MyChild objChild = new MyChild();&lt;br /&gt;&amp;nbsp;objChild.Show(); // child class method will be called.&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;If a base class method needs to be overridden, it is defined using the keyword virtual (otherwise the sealed keyword is used to prevent overriding).&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;4. If my base class does not have virtual keyword but both class have same method , parameter and return type. then what will happen. base class method will be called or only child class method will called.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. By default the preference will be given to child class. The child class method will be called always. If you want to call the base class method, then you need to use the base keyword like&lt;span style=&quot;background-color: yellow;&quot;&gt;base.MethodName()&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;5. What are events and actions in c#.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. Events are the objects which are binded with the particular action. Whenever an action happens, an event fires. Like button click event.The action is click and event is Button_Click which is attached with the event handler to do the particular action and get the result.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;6. What is user define function in SQL or What are the user define function available in SQL.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. There are 2 types of functions in SQL Server-&lt;br /&gt;1. Inline functions&lt;br /&gt;2. Tabular functions&lt;br /&gt;Inline functions gives the result as a single value while the tabular functions return the multiple values like a table.&lt;br /&gt;Both of these types of function can be created as user defined. Means we can create our own function which can be inline or Tabular by using their syntax.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;Create function&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;return int[/Table]&lt;br /&gt;as&lt;br /&gt;Select FirstName+ LastName from Emp where EmpId = 101;&lt;br /&gt;Create Function&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;return Table&lt;br /&gt;as&lt;br /&gt;Select * from Emp;&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;7. If we have one Master Page , one aspx page and one ascx page then which one will called 1st while page_load event and which one called 1st while page_Unload event.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. If the content page contains the user controls then below will be the calling route-&lt;br /&gt;Master Page Load event --&amp;gt; Content Page Load event --&amp;gt; User control page Load event&lt;br /&gt;While unloading:&lt;br /&gt;Content page Unload --&amp;gt; user control unload --&amp;gt; Master page unload event&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;8. What is Indexers and please give the description with example.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. Indexer are the objects which doesn&#39;t need to be initialized and we can use them as it is for the storing and retrieving the data in to pages.&lt;br /&gt;Indexer is represented as []. So we can use them in Session, Application types of objects when keeping the state management data.&lt;br /&gt;e.g.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;ViewState[&quot;UserName&quot;] = txtUserName.Text;&lt;br /&gt;Session[&quot;UserName&quot;] = txtUserName.Text;&lt;br /&gt;Application[&quot;UserName&quot;] = txtUserName.Text;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;To retrieve these data, we can simply type cast them as :&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;lblUserName.Text = ViewState[&quot;UserName&quot;] as string;&lt;br /&gt;lblUserName.Text = Session[&quot;UserName&quot;] as string;&lt;br /&gt;lblUserName.Text = Application[&quot;UserName&quot;] as string;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Here you can see that there is no need to create object of the indexers. Directly we can retrieve the data.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;9. What are indexes in Database. How many types of Indexes in SQL Server&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. Indexing is used to increase the performance of a query, instead of performing the entire table scan the query uses the index to execute the query.&lt;br /&gt;There are five types of indexes in the SQL Server database:&lt;br /&gt;1. Clustered Index&lt;br /&gt;2. Non-Clustered Index&lt;br /&gt;3. KeySet Index&lt;br /&gt;4. Default Insex&lt;br /&gt;5. XML Index&lt;br /&gt;One thing here to remember that the Indexes retrieves the data by using the Binary tree formats.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;1. Clustered Index:-&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;Those indexes which can be maximum 1 per table and they will be the key to retrieve the data. the clustered indexes retrieves the data in the B-Tree format and improve the performance of the retrieval from the table.&lt;br /&gt;e.g. There are 1000 records in the table and the user want to retrieve the 234th record. Without index, the table scan will compare the record in whole table to get the matched record. So for the 1000 records, it will match for 999 times. If it found the records in the beginning, then also it will search the whole table.&lt;br /&gt;Whn using the index, the below process will occur for the searching of 234th record:&lt;br /&gt;1. It will take the 234th record as the root and compare the table by partitioning it in to two parts.1-500 and 501-1000&lt;br /&gt;2. then it compares with the left and right and then it will found that 234 is less than 500 so leave the right part.&lt;br /&gt;3. Now comparing will happen for the 1-250 and then 250-500. For this, it will check that 234 will come in the 1-250 range so leave the other part.&lt;br /&gt;4. Now the comparison will be 1-125 and 126-250...and so on..&lt;br /&gt;So if you calculate the total comparison it will be hardly 8-9. So we have reduces almost 990 comparison to improve the performance.&lt;br /&gt;In Clustered index, the actual data exists at the leaf root of the B-tree and it search the data directly.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;2. Non-Clustered Index:-&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&amp;nbsp;it searches the data in B+ tree format where the leaf node contains the memory location of the data. Once it gets the actual memory location, by using the reference it retrieve the actual data.There can be more than one Non-Clustered indexes per table.&lt;br /&gt;There can be 249 non-clustered index(in SQL Server 2005) and 999 non-clustered index (SQL Server 2008).&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;3. KeySet Indexes:-&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&amp;nbsp;Only keys are stored and not the actual data. the search will happens based on the key. Once the key found, it searches the complete data for the key. So its faster than all the indexes.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;4. Default Index:-&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&amp;nbsp;When the primary is added to the table, by default the index gets created called as Default Index.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;5. XML index:-&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&amp;nbsp;When the index is created on the XML column, the index is called as the XML index. This type of index gets introduces since SQL Server 2005 version. XML type column is supported since SQL Server 2005.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;10.Why we use Interface.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans.Interface is a way to use the global functionality throughout the application. If your application require many unrelated object types to provide certain functionality then you go for interfaces.&lt;br /&gt;It defines a contract between the application and the object.&lt;br /&gt;Let&#39;s suppose we want to Show the data or Print the data in many pages of the application, we can create a Interface which will contain the Abstract method and in the page where we want, we can implement it as per our requirements.&lt;br /&gt;e.g.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;interface inf&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;void Print(); // abstract method&lt;br /&gt;}&lt;br /&gt;internal class MyClass: inf&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;public void Print()&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; // functionality to print to PDF document&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;internal class MyTest: inf&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;public void Print()&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; // functionality to print to tiff document&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;internal Class MyTest: inf&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;public void Print()&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; // functionality to print to .jpg format&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;We can see here we have separate classes and the implementation of the Print method is different without making any changes in our interface.&lt;br /&gt;So if we want to implement something global, we can use the Interface, for local or limited to class, we can use the abstract class.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;11.Why we use Method Overloading&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. To reduce the memory and the good readability, we use the Overloading. This is the concept where we can have the same method name for similar work with different behavior.&lt;br /&gt;Let&#39;s say we want to get the Database connection based on the provider name to connect with different databases, we can use the overloaded methods like:&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;public string GetConnectionString()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;// return default connection string&lt;br /&gt;}&lt;br /&gt;public string GetConnectionString(string provider)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;// return connection string based on provider name&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;12. Why we use Method Overriding&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. Method overriding is the concept where we can use the same method in parent as well as in child class to reduce the memory and use the similar behavior. If we don&#39;t want to change the behavior, we need not to override it. So to make the changes in the behavior, we use the overriding.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;13. What is the difference between Abstraction and Encapsulation.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. Encapsulation is the biding and hiding of the data while Abstraction is to get the essential information from the raw data.&lt;br /&gt;e.g. Encapsulation&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;class Test&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;private string _name;&lt;br /&gt;&amp;nbsp;public string Name&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; set _name= value;&lt;br /&gt;&amp;nbsp; return _name;&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Here the _name is the private which is not accessible so hiding the data. All the data will be binded to the private variable as per the statement&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: yellow; color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;set _name= value;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;This property will be accessed by the public member called Name.&lt;br /&gt;So Binding and hiding means encapsulation.&lt;br /&gt;Abstraction is done by using the abstract class where we can have abstract and non abstract members.&lt;br /&gt;When ever we are having the abstract members, we need to implement it/override them in the child class to use them.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;class MyBaseClass&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;public abstract void Displaye();&lt;br /&gt;}&lt;br /&gt;class MyChildClass: MyBaseClass&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;public override void Display()&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; // do something&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;Here the essential things is the abstract method which must be overridden. If we add any number of non-abstract method, the child class wont care. So Getting the essential information is Abstraction.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;14. In which case we can use Abstract class in our project.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. Abstract class is always used when we have the limited scope or the objects are of similar types.&lt;br /&gt;e.g. Lets suppose we want to get the area of few objects. This is not the global where we need to do.&lt;br /&gt;So we can create the abstract method to calculate the area and then according to shape, we can override them. So here the scope is limited and will not be used throughout the application.&lt;br /&gt;Hence we can use the abstract class.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;15. What is the difference between Array List and Ilist.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. IList&amp;nbsp;is an interface for the implementing the List&amp;nbsp;collection.&lt;br /&gt;As the List&amp;nbsp;is the generic so we can use it to restrict the type of the list e g.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;List objList = new List();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;&lt;br /&gt;It means, the List object is restricted to the int. We can&#39;t insert here any type of data in to list. Only the int is permitted.&lt;br /&gt;ArrayList is the collection where we can insert any type of data as:&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;ArrayList objArrayList = new ArrayList();&lt;br /&gt;objArrayList.Add(&quot;Hello&quot;);&lt;br /&gt;objArrayList.Add(1);&lt;br /&gt;objArrayList.Add(&quot;Sure&quot;);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;The ArrayList will not check the type in the compilation of the program.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;16. What is difference between internal class and sealed class.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. The internal class object can be used with-in the assembly and not outside of the assembly. These classes can be inherited.&lt;br /&gt;Sealed classes are those classes which doesn&#39;t need anything from outside. These are full classes.&lt;br /&gt;These classes can&#39;t be extended.&lt;br /&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;17.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;public void show(int x , string y)&lt;br /&gt;public void show(string x , int y)&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Is this method overloading or what is it?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Ans. no, this is not the method overloading because, their signatures are not same&lt;br /&gt;Signature= Method Name + Argument types&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;Show(int, string)&lt;br /&gt;Show(string, int)&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Verdana, sans-serif; font-size: 9pt;&quot;&gt;&lt;br /&gt;Both signatures are different. So not overloading methods.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 14.25pt; margin-bottom: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;public void show(int x , string y)&lt;br /&gt;public void show(string x , int y)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 13.800000190734863px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;Is this method overloading or what is it?&lt;br /&gt;Ans: it is method overloading. As per method overloading the method should differ&lt;br /&gt;- type of parameters&lt;br /&gt;- Order of parameters&lt;br /&gt;- number of parameters&lt;br /&gt;&lt;/span&gt;&lt;b style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 13.800000190734863px;&quot;&gt;18. What is the difference between Remoting and web service.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 13.800000190734863px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;Ans. Remoting is the concept of calling the remote interfaces like communication with the heterogeneous applications but both should be developed using the same .Net language.&lt;br /&gt;For the client and server communication, we use the Remoting.&lt;br /&gt;Remoting is the platform dependent so both the client and server must be built in .Net Technology and both the systems should use the CLR.&lt;br /&gt;Web-service is small logic which runs on the internet. It is used for the heterogeneous applications and consume the service in any application. It is platform independent so no need to have the CLR or .net framework to be installed on the machines. C++ web service can be consumes in .Net application.&lt;br /&gt;&lt;/span&gt;&lt;b style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Verdana, sans-serif; font-size: 9pt; line-height: 13.800000190734863px;&quot;&gt;19. Can we use viewstate in MVC.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #333333; font-family: Verdana, sans-serif; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 13.800000190734863px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;Ans. No, ViewState cannot be used in MVC. There is no concept of ViewState in the MVC as it is not required. The MVC views are not having anything server side code so the view only be rendered and not loaded.&lt;br /&gt;To pass the data from one page to another, we can use the ViewBag.&lt;br /&gt;&lt;br /&gt;The reason we use MVC is to separate business logic from your view or UI and the site should be easily testable.&lt;br /&gt;ViewState mixes your business logic with your UI, while MVC separates the Business Logic from the UI.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/6817002256593441397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/06/real-time-scenario-based-interview.html#comment-form' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/6817002256593441397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/6817002256593441397'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/06/real-time-scenario-based-interview.html' title='Real Time Scenario Based Interview Questions'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi387roOO7DzUGiXaVr7gOH6i8fJRG82T-1tsVCaJ6umIF4q0ucLiFwTX7O37w7YqqsBvSpg3lDbjAlx6KqGCrXeZpHr7m8fa-RS1Ftrm5YKivTLTsyGKgDRy4XPVk_-2Fme6WxdztpqvhZ/s72-c/test.JPG" height="72" width="72"/><thr:total>23</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-8673227408927223707</id><published>2014-06-24T03:20:00.001-07:00</published><updated>2014-06-24T03:20:22.048-07:00</updated><title type='text'>Asp.Net MVC Interview Questions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Hey Friends,&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Now a days we can see lot of companies asking about the ASP.net MVC related questions in their interviews. So i thought of to keep few questions which are related to the ASP.Net MVC and they will be helpful for all of them who are going for the interviews or preparing for the ASP.Net MVC.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Here I kept many questions which are related to all the versions of ASP.Net MVC to keep in mind that interviewer can ask the questions from&amp;nbsp;various&amp;nbsp;aspects.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in 0in 0.0001pt; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;1. What is MVC?&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in 0in 0.0001pt; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Ans. MVC (Model View Controller) is one of the Software Architectural pattern which is built on 3 layers. So it is the pattern which basically talks about the separation of concern for a project. Here the 3 parts are having their own roles like:&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in 0in 0.0001pt; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;a. Model - It is used as the Data Container or it can also have the business rules, functions, logic&#39;s&amp;nbsp;etc.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in 0in 0.0001pt; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;b. View - It is mainly the UI (User Interface) part which is the main application built using the Web technologies like ASP.Net etc. It consists of the User Interface Design,&amp;nbsp;representation&amp;nbsp;of the information for&amp;nbsp;the end users etc.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in 0in 0.0001pt; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;c. Controller - It is the mediator between the View and Model and used to control the requests and&amp;nbsp;responses&amp;nbsp;floating through the views and Model. The command, Actions, Events are the part of Controller in MVC. All the communication is done via Controller so we can say that Controller is the heart of MVC.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in 0in 0.0001pt; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;2. What is ASP.Net MVC?&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Ans.&amp;nbsp;ASP.Net MVC is the Microsoft product based on the core MVC pattern. The Microsoft has taken the core concept of MVC and Designed the&amp;nbsp;ASP.Net MVC structure for the Visual Studio which helps the developers to get the automated&amp;nbsp;structure&amp;nbsp;and on it, they can built the applications.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;ASP.Net MVC provides the&amp;nbsp;structure&amp;nbsp;with the separation of&amp;nbsp;concerns&amp;nbsp;where each part of&amp;nbsp;ASP.Net&amp;nbsp;MVC application is separate and has no link among them. Apart from the separation of concerns, the Microsoft has provided the way to communicate between the separate&amp;nbsp;components&amp;nbsp;by using the other additional logic and libraries. These libraries supports in the connection, communication between the&amp;nbsp;components, databases and other external&amp;nbsp;components&amp;nbsp;as well with small effort.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;b&gt;3. How ASP.net MVC is different than MVC?&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Ans.&amp;nbsp;ASP.Net MVC is the inherited form of Core MVC where Microsoft has designed their MVC patterns based on the original core MVC concept. The Microsoft also provided the new MVC structure (ASP.Net MVC)&amp;nbsp;which has the&amp;nbsp;inbuilt capabilities of communication with their&amp;nbsp;components,&amp;nbsp;connection with the database etc.&amp;nbsp;The&amp;nbsp;ASP.Net MVC has the good support for creating mobile application. We can create the Mobile applications in ASP.Net MVC using the predefined template.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;br /&gt;4. What are the new features of ASP.Net MVC 2?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Ans. There are few major changes happened in the version MVC2. The Microsoft has more concentrated on the HTML Helpers, Validations support, Async controllers etc.Below are the few point which distinguishes the ASP.Net MVC 2 different than the previous versions:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;a. New HTML Helpers with Strongly Typed&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;b. Model based validations- This is very useful feature where the validation is done in the Model and will be used throughout the application.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;c. Automatic scaffolding feature also got introduces with this version.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;d. Asynchronous controller support which enables the multiple tasks to run simultaneously.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;e. Html.RenderAction introduced to render the section/part of the page.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;5. Explain MVC Architecture?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Ans.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;6. What are the new features of&amp;nbsp;ASP.Net&amp;nbsp;MVC 3?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;7. What are the new features of&amp;nbsp;ASP.Net&amp;nbsp;MVC 4?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;8. Explain&amp;nbsp;ASP.Net&amp;nbsp;MVC application life cycle?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;9. Advantages of MVC Framework?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;10. What do you mean by Separation of Concerns?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;11. Where do we see Separation of Concerns in MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;12. What is Razor View Engine in&amp;nbsp;ASP.Net&amp;nbsp;MVC 3?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;13. Explain the advantages of using routing in ASP.NET MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;14. What are the things that are required to specify a route ? Which is a better fit, Razor or ASPX?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;15. How can you do authentication and authorization in&amp;nbsp;ASP.Net&amp;nbsp;MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;16. How to implement Windows authentication for&amp;nbsp;ASP.Net&amp;nbsp;MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;17. How do you implement Forms authentication in&amp;nbsp;ASP.Net&amp;nbsp;MVC?&amp;nbsp;Mention some of the return types of a controller action method&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;18. Is&amp;nbsp;ASP.Net&amp;nbsp;MVC suitable for both Windows and web applications?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;19. What are the benefits of using&amp;nbsp;ASP.Net&amp;nbsp;MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;20. Is MVC different from a three layered architecture?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;21. What is the latest version of&amp;nbsp;ASP.Net&amp;nbsp;MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;22. What is the difference between each version of&amp;nbsp;ASP.Net&amp;nbsp;MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;23. What are HTML helpers in MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;24. What is the difference between &quot;HTML.TextBox&quot; vs &quot;HTML.TextBoxFor&quot; in ASP.Net MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;25. What is routing in MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;26. Where is the route mapping code written?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;27. Can we map multiple URLs to the same action?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;28. How can we navigate from one view to other view using a hyperlink?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;29. How can we restrict MVC actions to be invoked only by GET or POST?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;30. How can we maintain sessions in MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;31. What is the difference between tempdata, viewdata, and viewbag?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;32. What are partial views in&amp;nbsp;ASP.Net&amp;nbsp;MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;33. How do you create a partial view and consume it in&amp;nbsp;ASP.Net&amp;nbsp;MVC 4?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;34. How can we do validations in&amp;nbsp;ASP.Net&amp;nbsp;MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;35. Can we display all errors in one go? or Validation summery in&amp;nbsp;ASP.Net&amp;nbsp;MVC.&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;36. How can we enable data annotation validation on the client side?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;37. What is Razor in MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;38. Why Razor when we already have ASPX?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;39. How to implement AJAX in MVC&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;40. What kind of events can be tracked in AJAX?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;41. What is the difference between ActionResult and ViewResult?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;42. What are the different types of results in MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;43. What are ActionFilters in MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;44. Can we create our own custom view engine using MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;45. How to send result back in JSON format in MVC&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;46. What is WebAPI?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;47. But WCF SOAP also does the same thing, so how does WebAPI differ?&amp;nbsp;With WCF you can implement REST, so why WebAPI?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;48. How can we detect that a MVC controller is called by POST or GET?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;49. What is Bundling and Minification in MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;50. How does bundling increase performance?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;51. How do we implement bundling in MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;52. How can you test bundling in debug mode?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;53. Explain minification and how to implement it. How do we implement minification?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;54. Explain Areas in MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;55. Explain the concept of View Model in MVC?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;56. What kind of logic view model class will have?&lt;/span&gt;&lt;span style=&quot;font-size: 13.5pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin: 0in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;background: white; color: darkblue; font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;57. How can we use two ( multiple) models with a single view?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/8673227408927223707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/06/aspnet-mvc-interview-questions.html#comment-form' title='59 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/8673227408927223707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/8673227408927223707'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/06/aspnet-mvc-interview-questions.html' title='Asp.Net MVC Interview Questions'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>59</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-518950839904922354</id><published>2014-06-24T03:18:00.001-07:00</published><updated>2014-06-24T03:18:19.396-07:00</updated><title type='text'>Dotnet Interview Questions For 3+ Years of Experiance</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Hai Friends,&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Below I am posting the questions and answers for the short questions for 3-6 years guys. These questions will be helpful for those who are preparing for the interview or attending the interviews. This will be helpful for the last minute preparation in quickest way.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;If anyone has better answer, please reply to this post as that will be useful for all of us.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;CLR and C#&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;1. Types of Authentication and Authorization in IIS.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Types of Authentication: Anonymous Authentication, Windows Authentication, Digest Authentication&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Types of Authorization:- Anonymous&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;2. Types of Authentication and Authorization in ASP.Net.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Types of Authentication: Windows Authentication, Forms Authentication&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Types of Authorization:- File Authorization and URL Authorization&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;3. ASP.Net Life cycle.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. The request starts with the client and processed through IIS. &amp;nbsp;In IIS, there are 2 utilities- INetInfo.exe and ASPNet_ISAPI.dll the InetInfo.exe checks for the syntax and semantics of the request and then the request goes to the ASPNet_ISAPI.dll which is the filter to filter the .aspx files. Here the URL request split in to 2 parts- virtual directory and webpage. Now worker process which is nothing but the application factory basically contains all the virtual directories and checks for the current virtual directory. If this is first request, then there will be no Virtual directory available. Now the worker process (W3wp.exe) creates a memory area called as AppDomain to check for the current page. As AppDomain is the Page Handler factory so it contains all the processes pages. If this is the new page then it will not find here. The request further move to the HttpPipeline where the actual execution of the page happened by using the ProcessRequest method and creates the events of the page. After creation of event and execution of all the event, the HTML page gets back to the user.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;4. ASP.Net Page Life Cycle.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. There are few events which gets generated during the page execution like: Page_BeginRequest, Page_Init, Page_Load, Page_Prerender, Page_Render, Page_Unload etc&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;For the details of the page life cycle, you can follow the previous question.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;5. What are types: Value Type and Reference Type?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Value type holds data directly, Value type stored in the stack memory, we can get the direct value of the value types. Value type data type can’t be null.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Reference types: This type doesn’t hold the data directly. They hold the address on which the actual data present. They stored in heap memory, Can have default values.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;We can make and work with null reference type.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;6. Boxing and Unboxing: Terminology, Advantages and Disadvantages.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Converting the value type data type in to the Reference type is called as Boxing. Converting the Reference type data type and keep its value to stack is called as the reference type.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;byte b= 45;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Object o = b.Tostring();&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;The Advantage of boxing and unboxing is that we can convert the type of the object in to another type. The disadvantage is that it requires lot of memory and CPU cycles to convert from one type to another type.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Object o=10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Int i= Convert.ToInt32(o.ToString());&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;7. What is Type Safety?&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. TypeSafe is a way through which the application or framework that the memory will not be leaked to outside environment. E.g. C# is the type safe language where you must have to assign any object before using it. In VB.Net it will take the default value. So C# is the type safe language while VB.Net is not.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;8. What is Strong Name&lt;/span&gt;?&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Strong Name (SN) is used to make the dll as the unique as:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;SN -k fileName.dll&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Now it will have the unique name. This assembly when placed in the GAC, it will treat as the unique with its version number and other details. 2 assemblies with the same name can exist in the GAC but both will have different version. The CLR takes the latest version assembly while running the application.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;9. What are Extensions, modules and handlers?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. HttpModule and HttpHandler are the utilities which are used in the HttpPipeline under the ASP.Net page life cycle. When the request received to HttpPipeline, the HttpModule checks for the Authentication of the request and then it route the request to the respective handler. After that HttpHandler takes that request and process it. After Processing the request again the HttpModule takes the response and send it back to the worker process and finally to the user.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;10. What is worker process?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Worker process (w3wp.exe) is an executable which is also called as the Application Factory. This is used for the execution of the request and handling of the request for the current web page.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;11. CLR and DLR?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. CLR (Common Language Runtime) is the utility in the .Net framework to run the application. It is the run-time engine which actually executes the application with many responsibilities like taking care of memory management, versioning, CasPol etc.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;DLR is new with .Net 4.0 which is the Dynamic Language Runtime and used to run the application on the fly wherever required. CLR runs as statically while DLR runs dynamically.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;12. In case more than one version of an installable is installed, which version is invoked by default?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. By default the CLR will take and invoke the latest version of the dll and execute it accordingly. There could be the same name assemblies exists in the GAC but they will have different versions altogether for their uniqueness.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;So while running the application, CLR takes the latest version assembly and use in the application.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;13. What are Globalization and localization? How to implement them?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Globalization is the concept of developing the application in more than one language while the Localization is used for a particular language. Like if we develop the application in more than one language we need to create the resource files (.resx) by using System. Globalization and when we open the application in a particular language, then the localizations used to convert that application to the selected language.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;14. What is assembly, GAC? Where they are physically located?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Assembly is the collection of classes, namespaces, methods, properties which may be developed in different language but packed as a dll. So we can say that dll is the assembly.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;There are 3 types of assemblies- Private Assembly, Shared Assembly, and Satellite Assembly.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;GAC (Global Assembly Cache)- When the assembly is &amp;nbsp;required for more than one project or application, we need to make the assembly with strong name and keep it in GAC or in Assembly folder by installing the assembly with the GACUtil command.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;To make the assembly with strong name:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;SN -k MyDll.dll&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;And to install it in GAC:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;GacUtil -i MyDll.dll&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;GAC assemblies are physically stored in Assembly folder in the system.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;15. How to configure HTTPS for a web application?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. To configure the HTTPS (HTTP with Secure) for the web application, we need to have a client certificate. We can purchase the client certificate from the trusted providers and then we need to install that provider for our site. By implementing the HTTPS, all the data which is passing will be in encrypted format and will be more secure.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: magenta; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;&lt;span style=&quot;background-color: magenta;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;16. What are in-proc and out-proc? Where are data stored in these cases?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. In-Proc and Out-Proc is the types of Sessions where the session data can be stored in the process memory of the server and in the separate state server.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;When the session data is stored in the process memory of the server, the session is called as the In-Proc server. In this case when the server is restarted, the session data will be lost.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;When the session data is stored in the separate server like in state server or in Sql Server, the type of session is called as the Out-Proc session. In this case, if the server where the application is running is restarted, the session will be still remain in the separate servers.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;So in the &amp;nbsp;in-Proc session state, the session data is stored in the Process memory of the Server where the application is running.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;In the Out-proc session state, the session data is stored in the separate server- may be state server or in sql server.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;17. When the View state is saved, and when is it loaded? How to enable/ disable View states?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;A. View State data is stored in the current page in base64 encoded format. It gets loaded with the page and displays the values to the controls after the decoded. Internally it actually saves the check-sum of all the control data where the view state is enabled.so that when the page gets loaded due to any post back, it again finds the check-sum and then decodes the Base64 encoded string and gets back the same data to the controls. We can see the view state base 64 encoded string in View Source of the page. It will be like&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: yellow; font-size: xx-small;&quot;&gt;_VIEWETATE=&quot;DSDSDF8DGDGDFGFD5FDGGDJFF23BNN457M9UJOG&quot;&lt;/span&gt;this.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;View state won&#39;t take the client or server memory to keep the view state data.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;18. Difference between GET and POST. Which one is more secure?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. GET and POST methods are used for the data transfer between the web pages. GET mainly used for small data which is not secure because in case of GET method, the data which we are passing will be visible in the url so we can&#39;t keep the secure data which will be visible in the url. There is also limited data which can be passed in case of GET method (max 255 character).&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;POST is used for transferring the huge data between the pages where we can keep the secure data and can transfer it. In case of using the POST method, the data which is transferring between the pages will not be visible so it is more secure than the GET method. Also there is no limit for POST method to post the data to the next page.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;POST is more secure.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;19. What are Razor engines? How is it diff from ASP Engines?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. RAZOR engine is the new concept in the MVC 3 which is mainly used to create the views in the MVC applications. It created the cshtml pages for the MVC application and cshtml pages can be generated automatically by using the Razor engine.ASP engine create the aspx pages while Razor engine creates the pages.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;20. Pros and cons of JavaScript and AJAX.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. JavaScript is a scripting language and mainly used for client side validation. We can validate the client side data before sending to the server. So by this we can improve the performance of the application.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Ajax&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is Synchronous JavaScript and XML which is used for the Asynchronous calls from the server. It uses internally the JavaScript for making the call and use XML for the Data Transfer. It basically uses the XmlHttpRequest for the asynchronous calls to the server and communicates with the XML data which is platform independent. So Ajax can be used with any technology.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;21. In how many different ways can JavaScript be used/called in an application?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. JavaScript can be used for Client Side validation, can also be used for calling of server side methods and functions, can be used for calling the web services etc.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;22. What needs to be done to call a JavaScript function from code behind?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. If we want to call the JavaScript function from the code behind, we need to attach the JavaScript to the events in the page_load event as:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;protected void btnSave_cliekc9object sender, EventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&amp;nbsp;btnSave.Attributes.Add(&quot;onclick,&quot;JavaScript: retrun Validatedata();&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Here ValidateData is the JavaScript function which can be used to validate the page data and if validation fails, it will return and will not execute the server side btnSave_click event.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;23. Difference between Server Controls and User controls?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. User controls are used for the re-usability for the controls in the application. By using the user control, we can use the same control in the various pages. User controls can be created by combining more than one control. To use the user controls, first we need to register them in the web page where we want to use that control. A separate copy is need in each page where we want to use the user control. User controls can&#39;t be included in to the toolbox.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Server controls are those controls which can be found in the toolbox and can be directly drag to the application like textbox, button etc. For the server control, only 1 copy of the control is needed irrespective of the number of web pages. If we want 10 text-boxes to be added in our web page, we need only 1 copy of the textbox in the toolbox and can be dragged 10 times.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;24. Difference between Var, object and Dynamic types.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. var is the keyword introduced with .net 3.5 and used to store any kind of data like data-set, data table, int, float, char etc. We can keep any kind of data in the var variable.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;color: magenta; font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;var myVar = new String[] {&quot;hello&quot;, &quot;world!!&quot;} ;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Here the myVar is the var type variable which is used to store the string array. Like this we can store any type of data into the var.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Object is the type which is used to store the objects of any kind. These objects need to be type caste when required.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Like object mybject = &quot;Hello&quot;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Here the myObject variable of object type is used to keep the string variable. Now when we want this variable value, we need to typecast it like&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;string strvar= (string) myobject;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Dynamic- It’s a keyword introduces with the .net 4.0 and used to keep the data similar to the var keyword. The difference between the var and dynamic is that the dynamic variable uses the same memory location to store the object and not changes throughout the application.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;25. Difference between Functions and methods.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. in.Net terminology, both are same. in general, we use method in .net but in scripting language we use function like JavaScript function.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Here the difference can be Function always returns a value which method may or may not. It depends upon the return type of the method.&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;26. Difference between Abstract classes and Interface. Explain with scenario where to implement one?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Collection of the Abstract (Incomplete) and Concrete (complete) methods is called as the Abstract class. If there is at least one abstract method in a class, the class must be abstract class.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;When there is the similar behavior, we can use the abstract class.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.g. We want to calculate the area of few component. As this is not generic to the application. We have only few component- like Circle, Ellipse, parabola, Hyperbola, Triangle etc.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;So we can create an abstract class and implement it like below:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;public abstract class MyAbstractClass&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;// some other concrete members&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;public abstract void Area();// abstract member&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Now in the child class, let’s say i have a circle class and want to calculate the area of the circle:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;public class Cicle: MyAbstractClass&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;public override void Area()&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp; // calculate the area of the circle&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;In the similar fashion, we can calcite the area of other shapes.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Collection of abstract members is called as the Interface. When the behavior is not similar, we need to use the interface. All the members of the interface&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;must be overrides in the child class.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.g. Print functionality of the application can have an interface like:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;interface Inf&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;&amp;nbsp;void Print();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Now as this is the generic functionality and can be implemented in any of the page so we have taken it as interface. Now we can implement this functionality in to any page like:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;class MyClass:Inf&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;public void print&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp; // write details about the print&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;// Here we can implement any kind of print-like print to excel, xml, word all depends on the our decision.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;27. Different forms of Polymorphism. Differences between Abstraction and Polymorphism.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Polymorphism is to use the same function in many forms. The polymorphism is of 2 types-&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;a. Classical polymorphism (Overloading)&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;b. AdHoc polymorphism (Overriding)&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;When the runtime (CLR) find the behavior of class members at the runtime of the program, it is called as the AdHoc polymorphism or Overriding.in this the method name is same but they are implemented in the different class. We use virtual keyword in the base class method to be overrides in the child class using the override keyword.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.g.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;public class MyClass&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;Public int&amp;nbsp; Add(int a, int b)&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;Return a+b;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Public int&amp;nbsp; Add(int a, int b, int c)&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;Return a+b+c;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;When the run-time (CLR) find the behavior of class members at the compilation of the program, it is called as the Classical polymorphism or Overloading.in this the method name is same but there prototypes (parameters) are different and it is implemented in the same class.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.g.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Public&amp;nbsp; class MyBaseClass&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;Public virtual void Show(string&amp;nbsp; message)&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp; Console.WriteLine(“Your message is : ”+ message);&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Public class MyChildClass: MyBaseClass&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;public override void Show(string&amp;nbsp; message)&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp; Console.WriteLine(“Your new message is : ”+ message);&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Abstraction is the behavior to get the required functionality in the child class. So we don’t matter whatever is written in the base class. We only need to force the child class to implement my required functionality.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Abstract keyword is used to get the abstraction behavior.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;28. What are Delegates and Events?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A.&amp;nbsp; A Delegate is an object, which points to another method in the application. Delegate holds, name of the method, arguments of the method (if any) and the return type of the method.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;See the below points regarding the Delegate:-&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delegate keyword is sealed type in System. Multicast namespace.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delegate works like a function pointer in C language.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delegate holds the address of the function.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delegate hides the actual information which is written inside the method definition.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A delegate can hold address of a single function as well as the address of multiple functions.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; There are 2 types of delegate- Single-cast delegate (hold single function) and Multicast delegate(hold multiple functions).&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;·&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Addition and subtraction are allowed for the delegates but NOT multiplication and division. It means, we can add delegates, subtract delegates etc.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.g. To create a single cast delegate, first we can create a class with a method as:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;public class DelegateDemo&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;public void Show(string msg)&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;Console.WriteLine(msg);&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Now we can call the method Show using the delegate as:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;public&amp;nbsp; delegate void MyDelegate(string&amp;nbsp; message); //declare delegate&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;now we need to create the object of the delegate with the address of the method as:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;DelegateDemo obj = new DelegateDemo();//class object&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;MyDelegate md= new MyDelegate(obj.Show(“Hello World!!”));&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;md(); // call the delegate&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;We can create the events and event handler by using delegate with the below syntax:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;public delegate void textChangedEventHandler(Object sender, TextEventArgs e);&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;This event handler will be used to handle the textbox text changed event.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;We can get more details about the delegate and events from the below link:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-in/library/orm-9780596521066-01-17.aspx&quot; style=&quot;color: #b5653b; text-decoration: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;http://msdn.microsoft.com/en-in/library/orm-9780596521066-01-17.aspx&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;29. Covariance and Contra-variance.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. &amp;nbsp;covariance and contravariance&amp;nbsp;are the new features added with the .net 4.0. They are basically used for the implicit reference conversion for different .net types like array, delegate, and generic etc&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;You can go to the below link for more details with the examples that how we can use the covariance and contrvariance to implicate reference conversion:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;a href=&quot;http://blogs.msdn.com/b/csharpfaq/archive/2010/02/16/covariance-and-contravariance-faq.aspx&quot; style=&quot;color: #b5653b; text-decoration: none;&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;http://blogs.msdn.com/b/csharpfaq/archive/2010/02/16/covariance-and-contravariance-faq.aspx&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;30. What are Extension methods?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Extension methods are special types of methods which are static methods but called as the instance methods.&amp;nbsp; The extension methods are added with the .Net framework 3.5 and with the Visual Studio 2008.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;These methods won’t affect the existing class and the label. These methods are used for the extra behavior which the calls can provide. There is no need to build the class again if we add any extension method to the class.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;There are various inbuilt methods added in .Net 3.5 with the introduction of LINQ. We can see the extension methods like Order By when we use the Linq as:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.g.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;int[] numbers = { 10, 45, 15, 39, 21, 26 };&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;var orderedNumbers = numbers.OrderBy(a =&amp;gt; a);&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;31. What are Anonymous methods and Lambda Expression?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A.&amp;nbsp; Anonymous methods are those methods which does not have the name. As they don’t have the name, so there is no way to call these methods. These methods are created by using the work delegate as below:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;button1.Click += delegate{listBox1.Items.Add(textBox1.Text)};&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Lambda Expression: It’s an easy way to create anonymous functions. It is also an anonymous function which has the capability to contain expressions and statements. We can create the delegate and expression tree types using the lambda expression.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;For more details regarding the anonymous method and lambda express, you can go through the below link:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/47887/C-Delegates-Anonymous-Methods-and-Lambda-Expression&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #b5653b; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;http://www.codeproject.com/Articles/47887/C-Delegates-Anonymous-Methods-and-Lambda-Expression&lt;/span&gt;&lt;/a&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;32. Multithreading. How to implement Multithreading?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Executing more than one process simultaneously called as multithreading. To implement the multithreading concept, we need to use the System. Threading .dll assembly and the System. Threading namespace.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;To write the thread program, we need to create a class with the method. Now we can create the thread object and then pass the method by using the class object to the method.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;After that we need to create the ThreadStart delegate which will call the actual method of the class.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;You can go through below link for more explanation and other details regarding the implementation and the code snippet:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/1083/Multithreaded-Programming-Using-C&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #b5653b; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;http://www.codeproject.com/Articles/1083/Multithreaded-Programming-Using-C&lt;/span&gt;&lt;/a&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;33. Which interface is used to-&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;a.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Convert Boolean values to Visibility values?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;b.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compare two integer values?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;c.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compare String values?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Check the below interfaces which are used in these scenarios:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;a.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Convert Boolean values to Visibility values?&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;b.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compare two integer values?-&amp;nbsp; IComparable interface&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;c.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compare String values? IComparer interface&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;SQL Server&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;34. What is the difference between a View and a Cursor?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. View: It is one of the database object which is also called as virtual table. We can also say that it is a window through which we can see some part of database. View is also called as stored query because we are going to fetch some data using View.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;View doesn’t contain any data. It’s just a virtual table which is used to get the records from the base table for which the view is created. View is faster than ad hoc queries because when we create the view and execute it once. Next time onwards it will be available as the compiled format. So whenever the view is called, it will just execute rather than compiling.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Cursor: Cursor is a database object which is also the buffer area which is created as a result of any sql statement to hold the intermediate values.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Views are used to format the rows individually. By using the views, we can process the individual rows. There are 4 types of cursors in Sql Server-&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;a.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Static Cursor&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;b.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dynamic Cursor&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;c.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Key set cursor&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;d.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Read-only cursor&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;35. How to execute multiple update on different conditions in a single query?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. To execute multiple update using a single Sql update statement is the new feature available with the SQL Server 2008. In this, we can update multiple rows using a single update command.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;36. Left outer joins and Right Outer joins&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Joins are used to join 2 or more tables using some conditions. There are 3 types of Joins in SQL Server database-&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;a. Left Outer Join&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;b. Right Outer Join&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;c. Full Join&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;In order to extract the matched row from both the tables and unmatched row from the first table, left Outer join is used. The syntax for left outer join condition is:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;T.Col1* = T2.Col1&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;In order to extract the matched row from both the tables and unmatched row from the second table, right Outer join is used. The syntax for right outer join condition is:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;T.Col1 = *T2.Col1&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;In order to extract the matched row from both the tables and unmatched row from the first table and then unmatched row from the second table, full join is used. The syntax for full join condition is:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;T.Col1* = *T2.Col1&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;37. Exception handling.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Exception Handling is the way to handle the unexpected error. From the SQL Server 2005 version, try…catch block is also supported to catch the exceptions in SQL Server database. There is various other ways to catch the error like @@Error which is the global variable and used to get the error. RaiseError is another inbuilt method which is used to display the error.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;38. What is Performance Tuning? How do you implement it.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Performance Tuning is the process through which we can optimize the SQL Server objects like functions, triggers, stored procedure so that we can achieve high response time to the front end. In the performance tuning process we generally check for the below point and optimize the objects processing:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;a.&amp;nbsp; Through Query Execution plan, check for the processing time of the query execution.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;b. Check the join conditions and break all the condition for executions of the queries individually&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;c. Check for the error prone process, conditions in the queries.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;d. Check for the loops whether they are terminated if any error occurs&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e. Check for the processes which are taking more time in execution and how to reduce the response time.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;39. Difference between Having and Where clauses.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A.&amp;nbsp; When the where clause is not able to evaluate the condition which consists of group functions, Having clause is used. Having clause is always followed by the Group By clause.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Where clause is used to filter the records based on the conditions. If there is the requirement to get the group data in the select statement and where clause is not able to get it, we can use the Having clause.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.g. Display DeptNo, No.of Employees in the department for all the departments where more than 3 employees are working&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;SELECT DEPTNO, COUNT(*) AS TOTAL_EMPLOYEE&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;FROM EMP&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;GROUP BY DEPTNO HAVING COUNT(*) &amp;gt;3&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;40. Difference between Temp tables and Tables variables?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Temp Table in SQL Server:&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;a. Temp table is the special type of tables which are used to store the intermediate data of the actual table.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;b. Temp tables are only visible to the current sessions of the sql server instance. When the session end, these table data automatically drops.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;c. We can’t join the temp tables as they don’t allow the foreign key constraints.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;d. Temp tables are created in TempDB database.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e. We can use the same temp table name for the different user sessions.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;f. Mostly used in stored procedure to handle the intermediate data.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;41. What does @ and @@ suffixed by property names specify?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. @- This is used for the variable declaration&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.g. @name varchar2(50)&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;@@- This is used for the Global variable declaration&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.g. @@Error=0&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;42. Self-join queries.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Self-Join is a type of join which is used to join the same table by creating the second instance of the same table. So we join 2 instances of the same table in case of self-join. This type of join is used when there is the requirement to get the referenced data which is available in the same table.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.g. A table contains EmpId, Ename and ManagerId&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;As the manager id is also an employee id. Now if we want that who is the manager of which employee. In this situation, we need to create the instance of the same table and get the required data as:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;SELECT EMPID, ENAME, ENAME AS [MANAGER NAME]&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;FROM EMP E1, EMP E2&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;WHERE E1.EMPID= E2.MANAGERID&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;43. Types of Index.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. &amp;nbsp;Indexes are one the database objects which is used to improve the performance of the database queries. it reduces the table scan while retrieving the data from the database and the search gets fast-&lt;br /&gt;There are 2 types of indexes used in the SQL server:&lt;br /&gt;a. Clustered index&lt;br /&gt;b. Non clustered index&lt;br /&gt;There are 3 more types of index but those comes under the above two-&lt;br /&gt;a. unique index&lt;br /&gt;b. Composite Index&lt;br /&gt;c. XML Index-added in SQL Server 2005&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;The index basically works on searching like binary tree where the root value is the finding value and it will be compared with the partitioned value of the tree.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;44. Difference between Primary key, Unique key and Candidate key?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Primary Key- It is a key to make the unique identification of the row in a table. It doesn’t allow null values in the primary key column. We can create the lookup columns based on the primary key. One table allows maximum of 1 primary key and in 1 table, we can create the primary key column by using 16 columns. Due to one of the normalization rule, we have to create primary key for the table to make the rows unique.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Unique Key:- Primary Key+ Not null is called as unique key. Unique key is also used to make the rows as unique in a table. The only difference between primary key and unique key is that primary key doesn’t allow null value while the unique key allow. The limitation of the null in unique key is that it allows only one Null so in only one row; we can make the key as null for the unique key.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Candidate key- the key other than primary key to make the rows as unique is called as candidate key. In candidate key, we take the columns which are not in the primary key and make the key for uniqueness of the row.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;45. What is the default value for Date type. What are Min and Max values for Date in 2008.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. &amp;nbsp;The default value of Date is CURRENT_TIMESTAMP&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Below are the new date and time values in Sql Server 2008:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;In SQL Server 2008:&lt;br /&gt;1. DateTime2&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Min Value: 0001-01-01 00:00:00.0000000&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Max Value: 9999-12-31 23:59:59.9999999&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;2. Date&lt;br /&gt;Min Value: 0001-01-01&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Max Value: 9999-12-31&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;You can go through the below link for couple of work around:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;a href=&quot;http://dhaneenja.blogspot.in/2008/06/minimum-year-value-in-sql-server.html&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #b5653b; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;http://dhaneenja.blogspot.in/2008/06/minimum-year-value-in-sql-server.html&lt;/span&gt;&lt;/a&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;WCF&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;46. What is WCF also known as?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A.&amp;nbsp; WCF (Windows Communication Foundation) is also know an&amp;nbsp; Indigo by its code name.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;47. Difference between WCF and Web Services?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Below are the main differences between the WCF and Web Service:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Web Service:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;a.&amp;nbsp;&amp;nbsp;&amp;nbsp; Can be hosted in IIS only&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;b.&amp;nbsp;&amp;nbsp;&amp;nbsp; Only two types of operations affects- One-Way, Request-Response&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;c.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; To serialize the data use System.Xml.Serialization&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;d.&amp;nbsp;&amp;nbsp;&amp;nbsp; To encode the data use- XML 1.0, MTOM, DIME, Custom&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;WCF service:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;a.&amp;nbsp;&amp;nbsp;&amp;nbsp; Can be hosted in IIS, Self Hosting, WAS, Windows Services etc&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;b.&amp;nbsp;&amp;nbsp;&amp;nbsp; Three types of operations affects- One-Way, Request-Response and Duplex&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;c.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; To serialize the data use System.Runtimel.Serialization&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;d.&amp;nbsp;&amp;nbsp;&amp;nbsp; To encode the data use- XML 1.0, MTOM,Binary, Custom&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.&amp;nbsp;&amp;nbsp;&amp;nbsp; WCF Service can be accessed through HTTP, TCP, Named pipes, MSMQ,P2P etc.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;48. What are Endpoints?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. The collection of Address, Binding and Contract is called as End Point. In Sort,&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;EndPoint = A+B+C&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Address (Where)-&amp;nbsp; it means where the service is hosted. URL of the service shows the address.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Binding (How)- How to connect to the service, is defined by the Binding. It basically has the definition of the communication channel to communicate to the WCF service&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Contract (what)- It means what the service contains for the client. What all the methods are implemented in the WCF service is implemented in the Contract.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;49. What are&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Behavior&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and Bindings?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Binding mainly describes about the communication of the client and service. For this, there are protocols corresponding to the binding behavior which will take care of the communication channel. There are different protocols which we use for the different types of bindings. E.g. HTTP, TCP, MSMQ, Named Pipes etc.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Behavior is used for the common configurations that could be for endpoints. When we use the common behavior, they affect to all the end points. Adding the service behavior affect the service related stuff while the endpoint related behavior affects the end points. Also operations level behavior affects the operations.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;50. What are different types of Contracts supported?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. There are mainly 5 type of contracts used in WCF service:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;a. Service Contract&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;b. Operation Contract&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;c. Data Contract&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;d. Message Contract&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e. Fault Contract&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;51. What is the difference between Transport and Message Security mode?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. WCF supports 2 types of security- Transport Level Security and Message Level Security&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Transport Level Security- In this type of security, we make the transport channel as secure so that the data flows in that channel will be automatically secured. For HTTP channel, we use the client certificate for the security of the web address. SSL is used for the HTTP channel security. As we don’t need to secure each of the messages which are floating between the client and the service, the speed is faster as direct message is going to the client from the service.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Message level security- This type of security in WCF is used where we don’t have the fixed transport medium and we need to secure each message which is floating between the server and the client. In this type of security we use certain algorithms for making the message as secure message. We use some extra bits and send with the message. We also use some encryption techniques like SHA1 or MD5 which make the proper security for our message. As each message needs to be secured, this type of security makes some delay in the process of sending and receiving the messages.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;52. How to configure WCF security to support Windows authentication?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. To support the WCF security in Windows Authentication, we need to add the ClientCredetialType attribute to “Windows” under the security tab element:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;transport clientCredentialType=&quot;Windows&quot;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;53. How to use Fault Contract?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A.&amp;nbsp; Fault Contract is mainly used for viewing and displaying the errors which occurred in the service. So it basically documents the error and the error message can be shown to the user in the understandable way. We can’t use here the try….catch block for the error handling because the try…catch is the technology specific (.Net Technology). So we use the Fault contract for the error handling.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;e.g. To use the Fault contract, we can simply write like the below:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;public&amp;nbsp; int Add(int number1,int number2)&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp; // write some implementation&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;&amp;nbsp;throw new FaultException (“Error while adding data..”);&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Here the fault Exception method is the inbuilt method which will throw the exception and display the message . We can use the custom class so that the message can be customized and the customized message can be sent to the client.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;So we can creeat&amp;nbsp; a clss like:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Public Class CustomException()&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;public int ID{get;set;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;public string Message{get;set;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; display: inline !important; float: none; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;public string Type{get;set;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Now this custom type we ca use with the Operation Contract as:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;[ServiceContract]&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Public interface IMyInterface&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;[OperationContract]&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;[FaultContract(typeOf(CustomException))]&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;Int Add(int num1,int num2);&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Now while implementation of the Add method, we can assign the class properties.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;WPF&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;54. Diff between XML and XAML.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. XAML is the declarative XML based language which is used to define the objects and properties. XAML document is loaded by XAML parser. So XAML Parser initiates the objects and set those properties. XAML is mainly used in creating the objects in WPF and Silverlight applications.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;For more detailed explanation, you can go through the below link:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;http://www.differencebetween.net/technology/software-technology/difference-between-xml-and-xaml/&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;55. Stack Panel and Wrap Panel.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;is one of layout control in WPF. We can place the child controls inside the stack panel either horizontally or vertically. So it provides two types of orientations- Horizontal Orientation and Vertical orientation.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;You can go through the below link for more detailed explanation and the code snippet:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;a href=&quot;http://wpftutorial.net/StackPanel.html&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #b5653b; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;http://wpftutorial.net/StackPanel.html&lt;/span&gt;&lt;/a&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Wrap panel is another layout control which is similar to the&amp;nbsp;&lt;a href=&quot;http://wpftutorial.net/StackPanel.html&quot; style=&quot;color: #b5653b; text-decoration: none;&quot;&gt;&lt;span style=&quot;color: windowtext; font-family: &#39;Times New Roman&#39;; font-size: 12pt; text-decoration: none;&quot;&gt;StackPanel&lt;/span&gt;&lt;/a&gt;. Wrap panel not only keep the control in horizontal and vertical orientation but also wrap them in to new line if there is no space. Here also the orientation can be set as Horizontal&amp;nbsp;or&amp;nbsp;Vertical. Its main use is to arrange the tabs in the tab control, menu control or in toolbar items.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;You can go through the below link for more details:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;a href=&quot;http://wpftutorial.net/WrapPanel.html&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #b5653b; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;http://wpftutorial.net/WrapPanel.html&lt;/span&gt;&lt;/a&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;56. Hierarchical Data Template.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Hierarchical Data Template is a type of data template which is used to bind the controls which &amp;nbsp;supports&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.headereditemscontrol.aspx&quot; style=&quot;color: #b5653b; text-decoration: none;&quot;&gt;&lt;span style=&quot;color: windowtext; font-family: &#39;Times New Roman&#39;; font-size: 12pt; text-decoration: none;&quot;&gt;HeaderedItemsControl&lt;/span&gt;&lt;/a&gt;, like &amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.treeviewitem.aspx&quot; style=&quot;color: #b5653b; text-decoration: none;&quot;&gt;&lt;span style=&quot;color: windowtext; font-family: &#39;Times New Roman&#39;; font-size: 12pt; text-decoration: none;&quot;&gt;TreeViewItem&lt;/span&gt;&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.menuitem.aspx&quot; style=&quot;color: #b5653b; text-decoration: none;&quot;&gt;&lt;span style=&quot;color: windowtext; font-family: &#39;Times New Roman&#39;; font-size: 12pt; text-decoration: none;&quot;&gt;MenuItem&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;We can bind those controls items using the Hierarchical Data Template. It displayed the data in to Hierarchical structure in the tree structure. It could be in the left to right or top to bottom.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;You can go through the below link for more details:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.hierarchicaldatatemplate.aspx&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #b5653b; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;http://msdn.microsoft.com/en-us/library/system.windows.hierarchicaldatatemplate.aspx&lt;/span&gt;&lt;/a&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;57. Virtualization.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. This is the feature in WPF which increases the efficiency of the programs when there are the large data objects. If the WPF&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; display: inline !important; float: none; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;ItemsControl&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&amp;nbsp;is bound with the large collection data source object and we enabled the virtualization, then the controls will show only the data which is in the visual container for those items which are visible currently. This visual data is only the small part of the large data object. Now when the user will scroll down or up, the rest of the data will be visible and previous data will be hidden again. So this is increase the efficiency of the program from the UI prospective.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;58. Events and Routed Events.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. &amp;nbsp;Routed event is special type of event which can invoke and handle multiple events from different objects rather than the event which is coming from one object. So it generally handles the object from the element tree. So whatever the elements inside the element tree and if they generate the event-may be multiple events, the routed event is capable of handling those events.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;The routed event can be invoked in both the directions but in general it comes from the source element and then bubbled up in the element tree until the root element.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;59. Bubbling and Tunneling.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Bubbling: When the events are raised form the innermost element in the visual tree and comes up towards the root element, is called as bubbling.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Tunneling: It is the opposite process of Bubbling where the events fired by the root element goes down towards the last child element control.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Please go through the below link for more details:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;a href=&quot;http://www.dotnetspider.com/forum/130497-event-bubbling-event-tunneling.aspx&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #b5653b; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;http://www.dotnetspider.com/forum/130497-event-bubbling-event-tunneling.aspx&lt;/span&gt;&lt;/a&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;60. Resource Dictionary, Static Resources and Dynamic Resources.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Static and Dynamic resources are used for binding the resources to the control objects.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;The main difference between&amp;nbsp;StaticResource&amp;nbsp;and&amp;nbsp;DynamicResource&amp;nbsp;is that how the resource is retrieved elements. If the resource is StaticResource, it will be retrieved only once by the element whoe is referencing it&amp;nbsp; and it will be used for all the resources. While the DynamicResource&amp;nbsp;gets its value each time they reference to the objects. So StaticResource is faster than the DynamicResource&amp;nbsp;, because StaticResource needs to get the value only once while the DynamicResource&amp;nbsp; needs each time to get it.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;61. What is Prism?&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Prism is the framework or the set of guidelines which is used to develop the WPF desktop application as well as the Silverlight Rich Internet applications. So it’s a kind of Design pattern to Develop the XMAL based application. It also used to develop the Windows 7 applications. Prism mainly helps to design the loosely coupled components which can be easily integrated with the other components of the overall application. Prism mainly used to build the composite applications which need various other components to be integrated.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Prism mainly guides of creating the applications using the Model-View-ViewModel (MVVM) model, Managed Extensibility Framework (MEF), and navigation in the application.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;To use the Prism framework, we need to use their library called as Prism Library. So prism Library is the inbuilt set of components which can be used in developing the WPF and Silverlight applications.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;You can go through the below link for more details and the use of the components of the Prism framework:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ff648465.aspx&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #b5653b; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;http://msdn.microsoft.com/en-us/library/ff648465.aspx&lt;/span&gt;&lt;/a&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;62. Dependency Injection, Event Aggregator.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. For the details about the dependency injection, you can follow the below link:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;a href=&quot;http://wpftutorial.net/ReferenceArchitecture.html&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #b5653b; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;http://wpftutorial.net/ReferenceArchitecture.html&lt;/span&gt;&lt;/a&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;EventAggregator : It is the utility service which contains the events and allows the decouple the publisher and subscriber so that they can be buildup independently. Decouple is primarily useful when a new module needs to be added or removed or modified. The new module can be added as per the event fired and defined in the shell.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;For more details about the Event Aggregator, you can follow the below link:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ff921122(v=pandp.20).aspx&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #b5653b; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;http://msdn.microsoft.com/en-us/library/ff921122(v=pandp.20).aspx&lt;/span&gt;&lt;/a&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;63. Shell, Bootstrapper and Region Managers&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. Bootstrapper:- An utility in WPF engine which is mainly responsible for the initialization of the application by using the composite application library. By using the bootstrapper we can find out how the components of the application are wired up in the composite application library. The bootstrapper responsibility to create the Shell or main window. Composite application library has the default abstract class UnityBootstrapper which actually handles the initialization.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;You can go through the below link for more details about the bootstrapper:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ff921139%28v=pandp.20%29.aspx&quot; style=&quot;color: #b5653b; text-decoration: none;&quot;&gt;&lt;span style=&quot;color: windowtext; font-family: &#39;Times New Roman&#39;; font-size: 12pt; text-decoration: none;&quot;&gt;http://msdn.microsoft.com/en-us/library/ff921139(v=pandp.20).aspx&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;Region and Region Managers: This is concept of Prism framework. We define the region through XAML code and once a region is defined, automatically it will be registered with the RegionManager. Actually the Bootstrapper registers a service called the RegionManager at run time. RegionManager is a dictionary where the key is name of the region. The value of the key is the reference of the IRegion interface. RegionAdapter is used to create the instance reference of the IRegion interface.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;You can go through the below link for more details about the Region and Region Manager:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/magazine/cc785479.aspx#id0090091&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #b5653b; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;http://msdn.microsoft.com/en-us/magazine/cc785479.aspx#id0090091&lt;/span&gt;&lt;/a&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;64. What are MEF and Unity?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. &amp;nbsp;The MEF (Managed Extensibility Framework) is the new concept in .net 4.0. It is used to create the lightweight and extensible applications to create Managed Extensibility Framework. It is not only allows the extension but also reused within the application. Extension can be easily encapsulating the code using the MEF.&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;For more details, you can go through the below link:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: xx-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd460648.aspx&quot; style=&quot;color: #b5653b; text-decoration: none;&quot;&gt;&lt;span style=&quot;color: windowtext; font-family: &#39;Times New Roman&#39;; font-size: 12pt; text-decoration: none;&quot;&gt;http://msdn.microsoft.com/en-us/library/dd460648.aspx&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: magenta; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 11pt;&quot;&gt;65. How to navigate to another page?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;A. There is a class NavigationService which can be used for navigation of the WPF window:&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;this.NavigationService.GoForward();&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;//or&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: yellow; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: xx-small;&quot;&gt;this.NavigationService.Navigate(&quot;MysecondPage.xaml&quot;)&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;b&gt;66. What is the difference between IEnumerable and IQueryable?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 13px; line-height: 14px;&quot;&gt;&lt;b&gt;Ans.&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;IEnumerable and IQuerable are used to query data from database and collections. &amp;nbsp;The IEnumerable is basically inherited from IQueryable, so it’s having all the features of the IQueryable in addition to its having additional own features.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 24.25pt;&quot;&gt;&lt;td style=&quot;border: 1pt solid windowtext; height: 24.25pt; padding: 0in 5.4pt; width: 45.15pt;&quot; valign=&quot;top&quot; width=&quot;60&quot;&gt;&lt;b&gt;S.No&lt;/b&gt;&lt;/td&gt;&lt;td style=&quot;border: 1pt solid windowtext; height: 24.25pt; padding: 0in 5.4pt; width: 212.25pt;&quot; valign=&quot;top&quot; width=&quot;283&quot;&gt;&lt;b&gt;IEnumerable&lt;/b&gt;&lt;/td&gt;&lt;td style=&quot;border: 1pt solid windowtext; height: 24.25pt; padding: 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;b&gt;IQueryable&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border: 1pt solid windowtext; padding: 0in 5.4pt; width: 45.15pt;&quot; valign=&quot;top&quot; width=&quot;60&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;1.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 212.25pt;&quot; valign=&quot;top&quot; width=&quot;283&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Exists in System.Collections Namespace&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Exists in System.Linq Namespace&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border: 1pt solid windowtext; padding: 0in 5.4pt; width: 45.15pt;&quot; valign=&quot;top&quot; width=&quot;60&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;2.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 212.25pt;&quot; valign=&quot;top&quot; width=&quot;283&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Can move to forward only in the collection.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Can move to forward, backward or in between the items.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border: 1pt solid windowtext; padding: 0in 5.4pt; width: 45.15pt;&quot; valign=&quot;top&quot; width=&quot;60&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;3.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 212.25pt;&quot; valign=&quot;top&quot; width=&quot;283&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Best for collection like List, Array or in-memory collection&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Best for the collections which is out memory like services, remote databases etc&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border: 1pt solid windowtext; padding: 0in 5.4pt; width: 45.15pt;&quot; valign=&quot;top&quot; width=&quot;60&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;4.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 212.25pt;&quot; valign=&quot;top&quot; width=&quot;283&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Suitable for LINQ to Objet and Linq to XML queries.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Suitable for Linq to SQL queries&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border: 1pt solid windowtext; padding: 0in 5.4pt; width: 45.15pt;&quot; valign=&quot;top&quot; width=&quot;60&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;5.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 212.25pt;&quot; valign=&quot;top&quot; width=&quot;283&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;It doesn’t supports custom query, Lazy loading so it’s not good for paging scenarios.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;It supports custom query using CreateQuery and Execute methods. Also support lazy loading so good for the paging scenarios.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border: 1pt solid windowtext; padding: 0in 5.4pt; width: 45.15pt;&quot; valign=&quot;top&quot; width=&quot;60&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;6.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 212.25pt;&quot; valign=&quot;top&quot; width=&quot;283&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;The extension methods which supports be IEnumrable takes the functional objects as the parameters.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; border-style: none solid solid none; padding: 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;The extension methods which supports be IEnumrable takes the expression tree expressions as the parameters.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe4DE0gqKWIYC_pEJDtSdcJYBrL_wpOWD-XfMqfAN75ciK1-mpkKpdoWh-prlnO-avuXch78hrA-gGummK4p6uTE0jdrXAbBg1icVnh6eVYZRV9qYXY4whWDhs4zfEzHeWsMIVQ0xEGged/s1600/Untitled.jpg&quot; style=&quot;clear: left; color: #b5653b; float: left; margin-bottom: 1em; margin-right: 1em; text-decoration: none;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe4DE0gqKWIYC_pEJDtSdcJYBrL_wpOWD-XfMqfAN75ciK1-mpkKpdoWh-prlnO-avuXch78hrA-gGummK4p6uTE0jdrXAbBg1icVnh6eVYZRV9qYXY4whWDhs4zfEzHeWsMIVQ0xEGged/s1600/Untitled.jpg&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px; position: relative;&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;&quot;&gt;In the first example (By using the IEnumerable), the generated SQL is as below:&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiswpY-JlxhHyD4sJM0Xbm1IVzNUe3WuRbKnd2NuuwHApuDKJ-ryCauJWWrYInnSL2Wv6N5XK_ovD2vU3uENiwV1aVvftIDDs7JEwWvB3vPwy1Rpfc6rjDE-ETYAOO72ZCgqQerKsutUxVw/s1600/Untitled.jpg&quot; style=&quot;clear: left; color: #b5653b; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-decoration: none;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiswpY-JlxhHyD4sJM0Xbm1IVzNUe3WuRbKnd2NuuwHApuDKJ-ryCauJWWrYInnSL2Wv6N5XK_ovD2vU3uENiwV1aVvftIDDs7JEwWvB3vPwy1Rpfc6rjDE-ETYAOO72ZCgqQerKsutUxVw/s1600/Untitled.jpg&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px; position: relative;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;&quot;&gt;In the second example (By using the IQueryable), the generated SQL is as below:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCDp9CGpQor9JV8Muix_12MhFpo-mGvJGNoXhMkWJAY5yJLKp5i2jPvBBysinxErg_3c4Zg-tSwhscpM-VifY_3riHA4xq5suEOpHTUTVCF-J2J3CVh1JqhAqMQNdGUgHij0Mek6ZLupje/s1600/Untitled.jpg&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; font-family: Verdana, sans-serif; padding: 8px;&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
We can see that by using the IQueryable, the performance will increase as it has the TOP clause in the query.&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;67. What is cross site scripting? (XSS)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Ans&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;. Cross-site scripting is the way to attacks and insert the vulnerabilities in Web page. This attack is injected by client-side code. The script which is inject by the client can embed itself in response data. The response data which send back to the malicious user. The browser can’t recognize the scripts as it is responded from the trusted source.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;The cross-site scripting attacks also work on the HTTP and HTTPS.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;There are 2 ways to prevent the cross site scripting attack:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Constrain input- Validate the input length, type, formatting, range etc&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Encode output- Send the input data with encode e.g. Encode to HTML&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 13px;&quot;&gt;To prevent the cross-site attack, we can set the below attributes in web.config file:&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; clear: both; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;clear: left; float: left; font-family: Verdana, sans-serif; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqmGAaU0SxSu5cpoEp0lPZZ8E-7L6aBQ62AD28kwIENPNfruJ3KbRVHwG5413TDfngPbl2Lwn0Z7UXD7LPGCMlaaSWMU7NqskJRTC1NPN7jqKrRd1i_SV_Zf2L2f1jEJeePMtVBkCUwSq3/s1600/Untitled.jpg&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; clear: both; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;b style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;68. If I want to see my website similar in all the browsers then what I need to do for that?&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;b&gt;Ans.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;If you want to see the website with the same look and feel then you need to write the common css style which should be same for all browsers. Actually every browser will not support every css elements so it is not possible to use the same css to support all the browsers. You need to write the common css elements in the file and then apply it across the website. Else you need to write the separate css file as per the browser.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 13px; line-height: 14px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;69. If say 1 Lac users are using any particular website then what you will do to prevent crashing of server? Which care you will take at the time of coding?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 13px; line-height: 14px;&quot;&gt;&lt;b&gt;Ans.&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;There are the ways like we can have multiple servers to handle the requests from the users. In this, we can have the Web Gardening concept where we can have the multiple web servers and then one main server to handle the number of requests and switch the requests to other servers.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 13px; line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;70. Why to use design patterns?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;b&gt;Ans.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;Design Pattern is the way to solve the recurring problems which occur during the designing of the applications. As the requirements increases, the projects becomes complex and due to the complexity, it’s difficult to maintain it.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;With the help of design patterns, we can reduce the complexity and with the help of OOPs paradigm, we can make our applications more efficient in all the ways.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;According to the GoF (Gang of Four) company, the Design Patterns can be classified to 3 ways:-&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;ul style=&quot;line-height: 1.4; list-style: disc; margin: 0.5em 0px; padding: 0px 2.5em; text-align: left;&quot;&gt;
&lt;li style=&quot;border: none; color: #4e2800; margin: 0px 0px 0.25em; padding: 0.25em 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;Creational Design Pattern&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border: none; color: #4e2800; margin: 0px 0px 0.25em; padding: 0.25em 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;Behavioral Design Pattern&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border: none; color: #4e2800; margin: 0px 0px 0.25em; padding: 0.25em 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;Structural Design pattern&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;b style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;&quot;&gt;71. If I have a class C and two interfaces I1 and I2 and I have add method inside I1 and I2 then how to specify which one has to be called?&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;&quot;&gt;&lt;b&gt;Ans.&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;By using the explicit implement interface, we can implement the same method which is defined in both the interfaces.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;&quot;&gt;e.g.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwsHDgXoLYGN9WEVQ_JpLP8cFpV_da-9JRPhSThDAtCCRchbG4uGYwfT4xPlXnAHi_0xTwZp1VJ4s_bwvicaNti6uiG8lhBr4FF6G0T06Vc4cqJ5Cl3PLsGpb-OexJwC-kAcv6_ue3aS_L/s1600/Untitled.jpg&quot; style=&quot;clear: left; color: #b5653b; float: left; margin-bottom: 1em; margin-left: 1em; text-decoration: none;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;222&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwsHDgXoLYGN9WEVQ_JpLP8cFpV_da-9JRPhSThDAtCCRchbG4uGYwfT4xPlXnAHi_0xTwZp1VJ4s_bwvicaNti6uiG8lhBr4FF6G0T06Vc4cqJ5Cl3PLsGpb-OexJwC-kAcv6_ue3aS_L/s320/Untitled.jpg&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px; position: relative;&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 14px;&quot;&gt;The implementation will be as below:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;clear: left; float: left; font-family: Verdana, sans-serif; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAd87dxokMlcgK1jaJ29UM3bGM1vdj3sXnYDFTg_C8RWIh_Awzjo2jRhuE0N5_HeFTdzaaKf1nnVFH94tZFbqTbvgKP95rGlSzrfvPd7CX5BpVdU5agpJQBUdhwFCrXiuJG2beBg7acfD4/s1600/Untitled.jpg&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;72. Garbage collection uses which type of algorithm? How it will find which object is unused?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;b&gt;Ans.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;Mark-And-Release is the algorithm which the garbage collection uses to reclaim the memory of the unreferenced objects which are no longer used.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;The algorithm Mark-and-Release work in 2 steps:-&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.5in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;a.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;In the first steps, it marks all the accessible objects of the heap memory. This is called as&amp;nbsp;&lt;i&gt;mark&lt;/i&gt;&amp;nbsp;phase.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.5in; orphans: auto; text-align: left; text-indent: -0.25in; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;b.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;In the second step, scan the heap and reclaim all the unmarked objects by the Garbage Collection algorithm. This step is called as&amp;nbsp;&lt;i&gt;sweep&lt;/i&gt;&amp;nbsp;phase.&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; margin-left: 0.5in; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;Below are the algorithm steps:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; clear: both; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;clear: left; float: left; font-family: Verdana, sans-serif; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfYhkNbqE4pGiYoMIn4jwxt8eGZdTeX6uhatUknreKiIYywYBEQOo6m1SOtYsXzOu0_e9vJ4rHqh7KxJ932P2SKLmtf48BlyW2hl90O6sbyKjZBMl9Bb-CX9NAVmvvb7KlrqEjb_hoj7Sz/s1600/Untitled.jpg&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; clear: both; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;For the detailed description, follow the below link:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;a href=&quot;http://www.brpreiss.com/books/opus5/html/page424.html&quot; style=&quot;color: #b5653b; text-decoration: none;&quot;&gt;&lt;b&gt;http://www.brpreiss.com/books/opus5/html/page424.html&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;73. What is the difference between out and ref?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;b&gt;Ans:&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Ref and Out are the parameters which are used in the methods &amp;nbsp;[ref] and [out] both allows the called method to modify a parameter. The difference between them is what happens before you make a call.&lt;/span&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style: disc; margin: 0.5em 0px; padding: 0px 2.5em; text-align: left;&quot;&gt;
&lt;li style=&quot;border: none; color: #4e2800; margin: 0px 0px 0.25em; padding: 0.25em 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;[ref] means that the parameter has a value on it&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;border: 1pt none windowtext; font-family: Verdana, sans-serif; font-size: 10pt; font-weight: normal; padding: 0in;&quot;&gt;before&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;apple-converted-space&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;going into the function. The called function can read and or change the value any time.&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;em style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;border: 1pt none windowtext; font-family: Verdana, sans-serif; font-size: 10pt; padding: 0in;&quot;&gt;The parameter goes in, then comes out&lt;/span&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li style=&quot;border: none; color: #4e2800; margin: 0px 0px 0.25em; padding: 0.25em 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt;&quot;&gt;[out] means that the parameter has no official value before going into the function. The called function must initialize it.&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;em style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;border: 1pt none windowtext; font-family: Verdana, sans-serif; font-size: 10pt; padding: 0in;&quot;&gt;The parameter only goes out.&lt;/span&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;So the main difference between the ref and out parameter is that the out parameter doesn&#39;t needs to be&amp;nbsp;initialized&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&amp;nbsp;while the ref parameter must be&amp;nbsp;initialized&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&amp;nbsp;before passing to the function.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;74. Is it possible to use more than one out parameter?&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;b&gt;Ans&lt;/b&gt;. &amp;nbsp;As we know that the method always returns a single value but by using the out parameter, we can return multiple values from the method or function.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;In C# we can write the small code snippet which will describe to return the multiple values using the out parameters:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;We can also use the struct which will contain the multiple values as the return:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; clear: both; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyyRlZQdxqImuNdXc-t69i2zNQdQJBG3t9isHq5xlyW3HaJJtREnTnQtfZQB_4Y_978Zadx_yMmwN4qD0GUn2-vAHouJCQfDiBEsmVFMPliqd64TsHUnazAVSXABAnFWiKtl_6uEZRRTfh/s1600/Untitled.jpg&quot; style=&quot;clear: left; color: #b5653b; float: left; margin-bottom: 1em; margin-left: 1em; text-decoration: none;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;237&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyyRlZQdxqImuNdXc-t69i2zNQdQJBG3t9isHq5xlyW3HaJJtREnTnQtfZQB_4Y_978Zadx_yMmwN4qD0GUn2-vAHouJCQfDiBEsmVFMPliqd64TsHUnazAVSXABAnFWiKtl_6uEZRRTfh/s320/Untitled.jpg&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px; position: relative;&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; clear: both; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;There is another way to return multiple values like using Tuple class (newly introduces in .Net 4.0). The tuple class can return the object which can contain multiple values in it.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; clear: both; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; clear: both; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;clear: left; float: left; font-family: Verdana, sans-serif; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9VtVFNSkgmFoclv6B_ZfZPCnAafwgXPQ67phn6hn61LdT7EFypYJbFbdJ59rOrWfdY9_-Y3LTahdYFSdms4NsDXU-Kmothe3nTPUH59NPg0LkGDGH3B1kuKEiowMz9WHlGuiaDaJpB-3n/s1600/Untitled.jpg&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background: transparent; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; padding: 8px;&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; clear: both; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;b style=&quot;font-family: Verdana, sans-serif; font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;75. Is it possible to use .js files used under script will be in body and not in header? Why?&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.200000762939453px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: 10pt; line-height: 15.333332061767578px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Ans.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;The .js file is used in header because first the .js file should be loaded to the application and then rest of the content should be load.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: #ffeedd; color: #4e2800; font-family: Verdana; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/518950839904922354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/06/dotnet-interview-questions-for-3-years.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/518950839904922354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/518950839904922354'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/06/dotnet-interview-questions-for-3-years.html' title='Dotnet Interview Questions For 3+ Years of Experiance'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe4DE0gqKWIYC_pEJDtSdcJYBrL_wpOWD-XfMqfAN75ciK1-mpkKpdoWh-prlnO-avuXch78hrA-gGummK4p6uTE0jdrXAbBg1icVnh6eVYZRV9qYXY4whWDhs4zfEzHeWsMIVQ0xEGged/s72-c/Untitled.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-7169598528512488031</id><published>2014-06-24T03:08:00.002-07:00</published><updated>2014-06-24T03:08:43.988-07:00</updated><title type='text'>Dotnet Interview Questions </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;1.) What is asp.net life cycle ?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; display: inline !important; float: none; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; display: inline !important; float: none; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Life Cycle Events&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;PreInit&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The properties like IsPostBack have been set at this time.&lt;br /&gt;&lt;br /&gt;This event will be used when we want to:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; display: inline !important; float: none; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Set master page dynamically.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Set theme dynamically.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Read or set profile property values.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This event is also preferred if want to create any dynamic controls.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Init&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;ol style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Raised after all the controls have been initialized with their default values and any skin settings have been applied.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Fired for individual controls first and then for page.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;LoadViewState&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;ol style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Fires only if IsPostBack is true.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Values stored in HiddenField with id as _ViewState decoded and stored into corresponding controls.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;LoadPostData&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Some controls like:&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;ol style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;letter-spacing: 0.75pt;&quot;&gt;Fires only if IsPostBack is true.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Some controls like Textbox are implemented from IPostBackDataHandler and this fires only for such controls.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In this event page processes postback data included in the request object pass it to the respective controls.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;PreLoad&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; margin: 0.5em 0px; orphans: auto; padding: 0px 2.5em; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Used only if want to inject logic before actual page load starts.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Load&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; margin: 0.5em 0px; orphans: auto; padding: 0px 2.5em; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Used normally to perform tasks which are common to all requests, such as setting up a database query.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Control events&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;ol style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This event is fired when IsPostBack is true.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Use these events to handle specific control events, such as a Button control&#39;s Click event or a TextBox control&#39;s TextChanged event.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;PreRender&lt;/b&gt;Raised after the page object has created all the controls that are required for rendering which includes child controls and composite controls.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;ol style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Use the event to make final changes to the contents of the page or its controls before the values are stored into the viewstate and the rendering stage begins.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Mainly used when we want to inject custom JavaScript logic.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;SaveViewState&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; margin: 0.5em 0px; orphans: auto; padding: 0px 2.5em; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;All the control values that support viewstate are encoded and stored into the viewstate.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Render&lt;/b&gt;Generates output (HTML) to be rendered at the client side.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; margin: 0.5em 0px; orphans: auto; padding: 0px 2.5em; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;We can add custom HTML to the output if we want here.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;Unload&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;ol style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Fired for individual controls first and then for page.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp; 2. Used to perform cleanup work like closing open files and database connections.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;2.) How the request is handled by IIS ?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We&amp;nbsp;give an URL to an aspx page in the browser address bar and press enter. What happens next? We get the response in terms of rendered HTML but how?&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;ol style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;We are requesting something from the browser, which means indirectly we are requesting something from the Web Server, that means IIS. IIS, based on the file extension, decides which ISAPI extension can serve the request.&lt;br /&gt;&lt;br /&gt;And in case of ASP.Net (.aspx) it will be aspnet_isapi_dll so the request is passed to&amp;nbsp;it for processing.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;When the first request comes to the website,&lt;br /&gt;&lt;br /&gt;an&amp;nbsp;application domain is created by the ApplicationManager class where exactly the website runs, and which creates an isolation between 2 web applications.&lt;br /&gt;Within the application domain an instance of the HostingEnvironment class is created which provides access information about the application such as the name of the folder where the application is stored.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Next ASP.Net creates core objects like HttpContext, HttpRequest,HttpResponse.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Finally the application starts by creating an instance of the HttpApplication Class (which can be reused for multiple requests to maximize performance).&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;3.) What is Difference between Session and Cookies&amp;nbsp; ?&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The basic and main difference between cookie and session is that cookies are stored in the user&#39;s browser but sessions can&#39;t store in user&#39;s browser. This specifies which is best used for.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;• A cookie can keep all the information in the client&#39;s browser until deleted. If a person has a login and password, this can be set as a cookie in their browser so they do not have to re-login to your website every time they visit. You can store almost anything in a browser cookie.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;• 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. The problem in sessions is when you close the browser the session will automatically lost. So, if you had a site requiring a login, this couldn&#39;t be saved as a session but it can be saved as a cookie, and the user has to re-login every time they visit.&lt;br /&gt;cookies are nothing but a small piece of information on the client machine. before we create a cookies we should check whether the cookies are allowed at the browser side. They are limited in a size 4k.(they are 2 types of cookies peristant cookie , and session cookies)&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sessions cookies are stored in a server memory during the client browser session.When the browser is closed the session cookies are lost.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; display: inline !important; float: none; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: blue; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;4.) Advantages and disadvantages of Session?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Following are the basic advantages and disadvantages of using session. I have describe in details with each type of session at later point of time.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;h4 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 18.479999542236328px; margin: 0px; orphans: auto; position: relative; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Advantages:&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; display: inline !important; float: none; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; margin: 0.5em 0px; orphans: auto; padding: 0px 2.5em; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;It helps maintain user state and data all over the application.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;It is easy to implement and we can store any kind of object.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Stores client data separately.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Session is secure and transparent from the user.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; display: inline !important; float: none; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;h4 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 18.479999542236328px; margin: 0px; orphans: auto; position: relative; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Disadvantages:&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; display: inline !important; float: none; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; margin: 0.5em 0px; orphans: auto; padding: 0px 2.5em; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Performance overhead in case of large volumes of data/user, because session data is stored in server memory.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Overhead involved in serializing and de-serializing session data, because in the case of&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;StateServer&lt;/code&gt;and&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code&gt;SQLServer&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;session modes, we need to serialize the objects before storing them.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: x-small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Besides these, there are many advantages and disadvantages of session that are based on the session type. I have discussed all of them in the respective sections below.&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;5). What is state management?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ans:&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;State management&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is the process by which you maintain state and page information over multiple requests for the same or different pages.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;6). Http is stateless, What does this mean?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ans: Stateless protocol is a&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;communications protocol&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;that treats each request as an independent transaction that is unrelated to any previous request so that the communication consists of independent pairs of requests and responses.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;7). What is Session?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ans: We know that Http is stateless, means when we open a webpage and fill some information and then move to next page then the data which we have entered will lost.&lt;br /&gt;It happed do to Http protocol stateless nature. So here session come into existence, Session provide us the way of storing data in server memory. So you can store your page data into server&lt;br /&gt;memory and retrieve it back during page postbacks.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;8).&amp;nbsp; What are the Advantage and disadvantage of Session?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ans: Advantages:&lt;br /&gt;Session provide us the way of maintain user state/data.&lt;br /&gt;It is very easy to implement.&lt;br /&gt;One big advantage of session is that we can store any kind of object in it. :eg, datatabe, dataset.. etc&lt;br /&gt;By using session we don&#39;t need to worry about data collesp, because it store every client data separately.&lt;br /&gt;Session is secure and transparent from the user.&lt;br /&gt;Disadvantages:&lt;br /&gt;Performance overhead in case of large volumes of data/user, because session data is stored in server memory.&lt;br /&gt;Overhead involved in serializing and de-serializing session data, because in the case of StateServer and SQLServer session modes, we need to serialize the objects before storing them.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;9). What is Session ID in Asp.net?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ans: Asp.Net use 120 bit identifier to track each session. This is secure enough and can&#39;t be reverse engineered. When client communicate with server, only session id is transmitted, between them. When client request for data, ASP.NET looks on to session ID and retrieves corresponding data.&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;10). By default where the sessions ID&#39;s are stored ?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ans: By default, the unique identifier for a session is stored in a non-expiring session cookie in the browser. You can specify that session identifiers not be stored in a cookie by setting the cookieless attribute to true in the sessionState configuration element.&lt;br /&gt;We can also configure our application to store it in the url by specifying a &quot;cookieless&quot; session&lt;br /&gt;The ASP Session cookie has this format:-&lt;br /&gt;ASPSESSIONIDACSSDCCC=APHELKLDMNKNIOJONJACDHFN&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;11). Where does session stored if cookie is disabled on client’s machine?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ans: If you want to disable the use of cookies in your ASP.NET application and still make use of session state, you can configure your application to store the session identifier in the URL instead of a cookie by setting the cookieless attribute of the sessionState configuration element to true, or to UseUri, in the Web.&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;config file&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;for your application.&lt;br /&gt;The following code example shows a Web.config file that configures session state to use cookieless session identifiers.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;codeblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Code:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;body&quot; dir=&quot;ltr&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;code&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;system.web&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;sessionState&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cookieless=&quot;true&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;regenerateExpiredSessionId=&quot;true&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timeout=&quot;30&quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/system.web&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;12). Can you describe all the property set in web.config under session state?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ans:&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;codeblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Code:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;body&quot; dir=&quot;ltr&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;sessionstate&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mode=&quot;inproc&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cookieless=&quot;false&quot;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timeout=&quot;20&quot;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sqlconnectionstring=&quot;data source=127.0.0.1;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;user id&lt;/span&gt;=&amp;lt;user id&amp;gt;;password=&amp;lt;password&amp;gt;&quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;server=&quot;127.0.0.1&quot;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;port=&quot;42424&quot;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;lt;/configuration&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Mode: The mode setting supports three options: inproc, sqlserver, and stateserver. As stated earlier, ASP.NET supports two modes: in process and out of process. There are also two options for out-of-process state management: memory based (stateserver), and SQL Server based (sqlserver). We&#39;ll discuss implementing these options shortly.&lt;br /&gt;Cookieless: The cookieless option for ASP.NET is configured with this simple Boolean setting.&lt;br /&gt;Timeout: This option controls the length of time a session is considered valid. The session timeout is a sliding value; on each request the timeout period is set to the current time plus the timeout value&lt;br /&gt;Sqlconnectionstring: The sqlconnectionstring identifies the database connection string that names the database used for mode sqlserver.&lt;br /&gt;Server: In the out-of-process mode stateserver, it names the server that is running the required Windows NT service: ASPState.&lt;br /&gt;Port: The port setting, which accompanies the server setting, identifies the port number that corresponds to the server setting for mode stateserver.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;13). What are Session Events?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ans: There are two types of session events available in ASP.NET:&lt;br /&gt;Session_Start&lt;br /&gt;Session_End&lt;br /&gt;You can handle both these events in the global.asax file of your web application. When a new session initiates, the session_start event is raised, and the Session_End event raised when a session is abandoned or expires.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;14). How you can disable session?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ans: If we set session Mode=&quot;off&quot; in web.config, session will be disabled in the application. For this, we need to configure web.config the following way:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;codeblock&quot;&gt;
&lt;div class=&quot;title&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Code:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;body&quot; dir=&quot;ltr&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;sessionstate&amp;nbsp;&amp;nbsp;Mode=&quot;off&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;br style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; /&gt;&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;15). If I have more than one version of one assemblies, then how will I use old version (how/where to specify version number?) in my application?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;background-color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: #0b5394;&quot;&gt;&lt;br /&gt;&lt;/span&gt;Ans.The version number is stored in the following format: …. The assembly manifest can then contain a reference to which version number we want to use.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;16). How do you create threading in.NET? What is the namespace for that?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Ans.&lt;br /&gt;System.Threading;&lt;br /&gt;&lt;br /&gt;//create&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;new thread&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;using the thread class’s constructor&lt;br /&gt;&lt;br /&gt;Thread myThread = new Thread(new ThreadStart (someFunction));&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;17). What do you mean by Serialize and MarshalByRef?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Serialization is the act of saving the state of an object so that it can be recreated (i.e deserialized) at a later date.&lt;br /&gt;The MarshalByRef class is part of the System.Runtime.Remoting namespace and enables us to access and use objects that reside in different application&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;domains. It is the base class for objects that need to communicate across application domains. MarshalByRef objects are accessed directly within their own&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;application domain by using a proxy to communicate. With MarshalByValue the a copy of the entire object is passed across&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;the application&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;domain&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;18).&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is the difference between Array and LinkedList?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;An array is a collection of the same type. The size of the array is fixed in its&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;declaration&lt;/span&gt;.&lt;br /&gt;A linked list is similar to an array but it doesn’t have a limited size.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;19). What is Asynchronous call and how it can be implemented using delegates?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A synchronous call will wait for a method to complete before program flow is resumed. With an asynchronous call the program flow continues whilst the method executes.&lt;br /&gt;&lt;br /&gt;//create object&lt;br /&gt;SomeFunction objFunc = new SomeFunction();&lt;br /&gt;&lt;br /&gt;//create delegate&lt;br /&gt;SomeDelegate objDel = new SomeDelegate(objFunc.FunctionA);&lt;br /&gt;&lt;br /&gt;//invoke the method asynchronously (use interface IAsyncResult)&lt;br /&gt;IAsyncResult asynchCall = SomeDelegate.Invoke();&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&amp;nbsp;20). How to create events for a control? What is custom events? How to create it?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Ans.&lt;br /&gt;An event is a mechanism used in a class that can be used to provide a notification when something interesting happens. (typical evens in a windows application&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;include: change text in textbox, double click or click a button, select an item in dropdown box).&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;A custom event is an event created by the user that other developers can use. For example assuming that we have a CashTransaction class and we have a bank&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;balance property in that class. We may want to set-up an event that provides a notification when the bank balance drops below a certain amount. In order to&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;produce an event the process would be roughly as follows:&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;Create the class for the event derived from EventArgs.&lt;br /&gt;Create a delegate with a return type of void.&lt;br /&gt;Create a class containing the method that will activate the event.&lt;br /&gt;Create a class with methods to handle the event.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&amp;nbsp;21). If you want to write your own dot net language, what steps you will you take care?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We will need to ensure that the high level code is compiled to MSIL (Microsoft intermediate language) so that it can be interpreted by the CLR.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;22). Describe the diffeerence between inline and code behind - which is best in a loosely coupled solution?&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;br /&gt;The term ‘code behind’ refers to application code that is not embedded within the ASPX page and is separated out into a separate file which is then referenced&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;from the ASPX page. Inline code is the traditional ASP architectural model where business logic code was embedded within the ASP page. Separating&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;the business&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;logic code from the presentation layer offers several advantages:&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;1) It allows graphic designers and web developers to work on the presentation layer whilst the application developers concentrate on the business logic.&lt;br /&gt;2) The codebehind file is compiled as a single dll increasing the efficiency of the application,&lt;br /&gt;3) The codebehind model offers a true OO development platform,&lt;br /&gt;4) It speeds up development time as it allows developers to fully maximise the features of the .NET framework such as Cahing, ViewState, Session, Smart Navigation etc.&lt;br /&gt;5) Code is much easier to maintain and susceptible for change.&lt;br /&gt;6) The compiler and VS.NET provides much better support for error checking, intellisense and debugging when using the code behind model.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;23). How dot net compiled code will become platform independent?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;br /&gt;The raison d’etre for .NET was to cater for multiples languages on a single windows platform whereas the aim of Java was to be a single language on multiple&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;platforms. The only way that .NET can be platform independent is if there is a version of the .NET framework installed on the target machine.&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;&amp;nbsp;24). Without modifying source code if we compile again, will it be generated MSIL again?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Ans.&lt;/span&gt;No.&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;25). How does you handle this COM components developed in other programming languages in.NET?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Ans.&lt;/span&gt;&lt;br /&gt;use TlbImp.exe to import the COM types into your .NET project. If no type library for the COM component then use System.Runtime.InteropServices&lt;br /&gt;use RegAsm.exe to call a .NET developed component in a COM application.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&amp;nbsp;26). How CCW (Com Callable Wrapper) and RCW (Runtime Callable Wrappers) works?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;br /&gt;CCW: When a COM application calls a NET object the CLR creates the CCW as a proxy since the COM application is unable to directly access the .NET object.&lt;br /&gt;RCW: When a .NET application calls a COM object the CLR creates the RCW as a proxy since the .NET application is unable to directly access the .COM object.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;27). What are the new thee features of COM+ services, which are not there in COM (MTS)?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;br /&gt;Role based security.&lt;br /&gt;Neutral apartment threading.&lt;br /&gt;New environment called context which defines the execution environment&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-weight: bold;&quot;&gt;28). What are the differences between COM architecture and.NET architecture?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;br /&gt;.Net architecture has superseded the old COM architecture providing a flexible rapid application development environment which can be used to create windows,&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;web and console applications and web services. .NET provides a powerful development environment that can be used to create objects in any .NET compliant language.&lt;br /&gt;.NET addresses the previous problems of dll hell with COM by providing strongly named assemblies and side-by-side execution where two assemblies with the same name can run on the same box.&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;29). Can we copy a COM dll to GAC folder?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Ans.&lt;/span&gt;&lt;br /&gt;No. It only stores .NET assemblies.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;30). What is Shared and Repeatable Inheritance?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;br /&gt;Shared Inheritance-: Shared Inheritance-: ITt is multiple times using same class. The mechanism of deriving a new class from an existing class is called inheritance. Shared inheritance introduces a new opportunity of ambiguity and additional implementation complexity. Assume D inherits from B and C, both of which inherits from A. Here A in shared. Single copy made from both derived classes is called shared inheritance.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;31). Can you explain what inheritance is and an example of when you might use it?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;Ans&lt;/span&gt;.&lt;br /&gt;Inheritance is a fundamental feature of any OO language. It allows us to inherit the members and attributes from a base class to a new derived class. This&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;leads to increased code reusability and also makes applications easier to develop, maintain and extend as the new derived class can contain new features not&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;available in the base class whilst at the same time preserving the attributes inherited from the base class.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;32). How can you write a class to restrict that only one object of this class can be created (Singleton class)?&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;br /&gt;Ans.&lt;/span&gt;&lt;br /&gt;Use the singleton design pattern.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;public sealed class Singleton&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;{&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; static readonly Singleton Instance=new Singleton();&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static Singleton()&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Singleton()&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static Singleton Instance&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Instance;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;33). What are virtual destructures?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A constructor can not be virtual but a destructor may. Use virtual destructors when you want to implement polymorphic tearing down of an object.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;34). What is close method? How its different from Finalize and Dispose?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;finalise is the process that allows the garbage collector to clean up any unmanaged resources before it is destroyed.&lt;br /&gt;The finalise method can not be called directly; it is automatically called by the CLR. In order to allow more control over the release of unmanaged resources&lt;br /&gt;the .NET framework provides a dispose method which unlike finalise can be called directly by code.&lt;br /&gt;Close method is same as dispose. It was added as a convenience.&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;35). What is Boxing and UnBoxing?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ans.&lt;br /&gt;Boxing is the process of converting a value type to a reference type. More specifically it involves encapsulating a copy of the object and moving it from&lt;br /&gt;stack to heap. Unboxing is the reverse process.&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;br /&gt;&amp;nbsp; 36). What is check/uncheck?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ans.&lt;br /&gt;checked: used to enable overflow checking for arithmetic and conversion functions.&lt;br /&gt;unchecked: used to disable overflow checking for arithmetic and conversion functions&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;37). What is the use of base keyword? Tell me a practical example for base keyword’s usage?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Ans.&lt;br /&gt;The base keyword is used to access members of the base class from within a derived class:&lt;br /&gt;* Call a method on the base class that has been overridden by another method.&lt;br /&gt;* Specify which base-class constructor should be called when creating instances of the derived class.&lt;br /&gt;&lt;br /&gt;A base class access is permitted only in a constructor, an instance method, or an instance property accessor.&lt;br /&gt;It is an error to use the base keyword from within a static method.&lt;br /&gt;Example:In this example, both the base class, Person, and the derived class, Employee, have a method named Getinfo. By using the base keyword,&lt;br /&gt;it is possible to call the Getinfo method on the base class, from within the derived class.&lt;br /&gt;// keywords_base.cs&lt;br /&gt;// Accessing base class members&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;using System;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;public class Person&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;{&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;protected string ssn = &quot;444-55-6666&quot;;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;protected string name = &quot;John L. Malgraine&quot;;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;public virtual void GetInfo()&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;{&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;Console.WriteLine(&quot;Name: {0}&quot;, name);&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;Console.WriteLine(&quot;SSN: {0}&quot;, ssn);&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;}&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;}&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;class Employee: Person&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;{&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;public string id = &quot;ABC567EFG&quot;;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;public override void GetInfo()&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;{&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;// Calling the base class GetInfo method:&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;base.GetInfo();&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;Console.WriteLine(&quot;Employee ID: {0}&quot;, id);&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;}&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;}&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;class TestClass {&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;public static void Main()&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;{&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;Employee E = new Employee();&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;E.GetInfo();&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;}&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;}&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;br /&gt;&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 22px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0.75em 0px 0px; position: relative;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;38). Difference Between Query String and Session&lt;/span&gt;&lt;/h3&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 22px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0.75em 0px 0px; position: relative;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;
&lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; class=&quot;Design4&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Querystring&lt;/th&gt;&lt;th&gt;Session&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;Querystring&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is client side&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot;&gt;state management&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;technique.&lt;/td&gt;&lt;td&gt;Session is&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;server&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;side state management technique.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Querystring data is page specific i.e. can be&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;accessed&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;in that page only.&lt;/td&gt;&lt;td&gt;Session data can be accessed throughout the session.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Querystring data is visible to user and can be seen in browser url.&lt;/td&gt;&lt;td&gt;Session data is not visible to user.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Data is not secured and can be altered hence insensitive data is stored in querystring.&lt;/td&gt;&lt;td&gt;Data is secured hence sensitive data such as&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot;&gt;user information&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is stored.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Querystring has constraint of Maxlength.&lt;/td&gt;&lt;td&gt;Session does not have such constraint.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 22px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0.75em 0px 0px; position: relative;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h1 style=&quot;margin: 0px; padding-bottom: 5px; position: relative;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;39). Difference between Query string and Cookies&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;cookies&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is a&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot;&gt;text file&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;stored on client machine when we surf ant thing on internet by the server automatically we dont have to create it&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;query string&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is used to transfer data from 1 page to anothe but this is not safe s it shows in url what data we r sending&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;pen any site and see url after question mark tht is url&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;Cookies&lt;/span&gt;:&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;- Cookies are little pieces of information that a server stores on a browser. They are of two types&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;1. Temporary cookie&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;2. Persistent cookie&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Temporary cookie: - They are also known as session cookies. These are volatile in nature. When the browser is shutdown they are erased.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Persistent cookie:- These may be called as permanent cookies. These are especially saved in files. It may remain for a month or year.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;Properties of cookies&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Some properties of cookie&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;Name: - represent the name of cookie.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;Name value: - represent a collection of key values of cookie&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;Domain: - represent the domain associated with a specific cookie.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;Path: - the path associated with a cookie.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;Expires: - expired time of cookie.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;Hashkey: - identifies whether the cookie is a cookie dictionary.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;Secure: - specifies whether the cookie is to be sent in an encrypted connection or not&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: #073763;&quot;&gt;Query string&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is the limited way to pass information to the web server while Transferring from one page to another page. This information is passed in url of the request. see below the code sample&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Code Sample&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;//Retrieving values from&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;query string&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;String name;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;//Retrieving from query string&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;name = Request.Param[&quot;umar&quot;].ToString();&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But remember that many browsers impose a limit of 255 characters in query strings. You need to use HTTP-Get method to post a page to server otherwise query string values will not be available.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;40).&lt;span style=&quot;color: blue;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;How can we identify that the Page is Post Back?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div id=&quot;font&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Page object has an &quot;IsPostBack&quot; property, which can be checked to know that is the page posted back.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;41). What is the lifespan for items stored in ViewState?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;PThe items stored in ViewState live until the lifetime of the current page expires including the postbacks to the same page&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;42). What is AutoPostBack?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If you want a control to postback automatically when an event is raised, you need to set the AutoPostBack property of the control to True&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;43). Why do you use the App_Code folder in ASP.NET?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;div id=&quot;font&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The App_Code folder is automatically present in the project. It stores the files, such as classes, typed data set, text files, and reports. If this folder is not available in the application, you can add this folder. One of the important features of the App_Code folder is that only one dll is created for the complete folder, irrespective of how many files it contains.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot;&gt;
&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;44). In which event of page cycle is the ViewState available?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;After the Init() and before the Page_Load().&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot;&gt;
&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;45). How long the items in ViewState exists?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;They exist for the life of the current page.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;46). Where the viewstate is stored after the page postback?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;ViewState is stored in a hidden field on the page at client side. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;47). What are the different Session state management options available in ASP.NET?&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In-Process&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin: 0px 0px 0.25em; padding: 0px; text-indent: 0px;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Out-of-Process.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;In-Process&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;stores the session in memory on the web server.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;strong&gt;Out-of-Process&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Session state management stores data in an external server.&amp;nbsp; The external server may be either a SQL Server or a State Server.&amp;nbsp; All objects stored in session are required to be serializable for Out-of-Process state management.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;48). What is the difference between web config and machine config?&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Web config file is specific to a web application where as machine config is specific to a machine or server. There can be multiple web config files into an application where as we can have only one machine config file on a server.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;49). What are the different types of cookies in ASP.NET?&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;Session Cookie&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– Resides on the client machine for a single session until the user does not log out.&lt;br /&gt;&lt;strong&gt;Persistent Cookie&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;– Resides on a user’s machine for a period specified for its expiry, such as 10 days, one month, and never.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div id=&quot;font&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #666666; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 18.479999542236328px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;h3 style=&quot;margin: 0px; position: relative;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;50). What is the difference between ExecuteScalar and ExecuteNonQuery?&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;ExecuteScalar returns output value where as ExecuteNonQuery does not return any value but the number of rows affected by the query. ExecuteScalar used for fetching a single value and ExecuteNonQuery used to execute Insert and Update statements.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/7169598528512488031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/06/dotnet-interview-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/7169598528512488031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/7169598528512488031'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/06/dotnet-interview-questions.html' title='Dotnet Interview Questions '/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-3623523530980795482</id><published>2014-05-26T04:00:00.003-07:00</published><updated>2014-05-26T04:00:32.240-07:00</updated><title type='text'>Explain about Partial Class and partual methods</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #ff9900; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 30px; font-style: normal; font-variant: normal; font-weight: 200; letter-spacing: normal; line-height: normal; margin: 20px 0px 11px; orphans: auto; padding: 0px 0px 10px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Introduction&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Recently I was researching about partial classes and their real world use. Many of the postings found on Google talked about the concept of partial classes and partial methods, but very few highlighted in what scenarios to use them.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
In this article, we will first start with the fundamentals of partial classes and methods and then discuss four real world uses. I have also created a video here where I have discussed about partial classes and shown their real world use.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;a href=&quot;http://youtu.be/ZEsS9-KfC70?hd=1&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;293&quot; src=&quot;http://www.codeproject.com/KB/cs/partial/1a.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;484&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #ff9900; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 30px; font-style: normal; font-variant: normal; font-weight: 200; letter-spacing: normal; line-height: normal; margin: 20px 0px 11px; orphans: auto; padding: 0px 0px 10px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Fundamentalsofpartialclasses&quot; style=&quot;border: 0px; color: inherit; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;Fundamentals of partial classes&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
A partial class allows a single class to be divided into two separate physical files. During compile time, these files get compiled into a single class. For instance, you can see in the below figure we have the customer class divided into two different files “&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;customer1.cs&lt;/em&gt;” and “&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;customer2.cs&lt;/em&gt;”.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
During compilation, these files get compiled into a single class internally. So when you create an object of the&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;Customer&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;class, you will be able to see methods lying in both the physical files. For instance, you can see the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;Add&lt;/code&gt;method belongs to&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;customer1.cs&lt;/em&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;Delete&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;method belongs to&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;customer2.cs&lt;/em&gt;, but when the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;Customer&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;object is created, we can see both the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;Add&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;Delete&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;methods.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img height=&quot;301&quot; src=&quot;http://www.codeproject.com/KB/cs/partial/2.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;447&quot; /&gt;&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #ff9900; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 30px; font-style: normal; font-variant: normal; font-weight: 200; letter-spacing: normal; line-height: normal; margin: 20px 0px 11px; orphans: auto; padding: 0px 0px 10px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Fundamentalsofpartialmethods&quot; style=&quot;border: 0px; color: inherit; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;Fundamentals of partial methods&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
There is one more important concept in partial classes called partial methods. Partial methods helps us to define a method in one physical file and we can implement that method in another physical file, as shown in the below figure.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
In the figure, you can see we have defined the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;Validate&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;method in&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Customer1.cs&lt;/em&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and this&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;Validate&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;method is implemented in&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Customer2.cs&lt;/em&gt;. Please note the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;partial&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;keywords attached to both of these methods.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img height=&quot;305&quot; src=&quot;http://www.codeproject.com/KB/cs/partial/3.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;628&quot; /&gt;&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #ff9900; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 30px; font-style: normal; font-variant: normal; font-weight: 200; letter-spacing: normal; line-height: normal; margin: 20px 0px 11px; orphans: auto; padding: 0px 0px 10px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Usenumber1:-ASP.NETautogeneratedcode&quot; style=&quot;border: 0px; color: inherit; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;Use number 1: ASP.NET auto generated code&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
The biggest use of partial classes is in technologies where there is code generation. The Microsoft team themselves use partial classes in ASP.NET, LINQ, and EF code generation. For instance when we look at ASP.NET, there are two parts: the auto generated code of a page and the code-behind where you write your custom logic.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
The custom logic is written in the “&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;.aspx.cs&lt;/em&gt;” file while the auto generated logic is in the “&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;.aspx.designer.cs&lt;/em&gt;” file, as shown in the below figure.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img height=&quot;126&quot; src=&quot;http://www.codeproject.com/KB/cs/partial/4.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;268&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
As a developer, you would like the auto generated code to do its work, i.e., generate code when you drag and drop a button in the ASP.NET designer.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img border=&quot;0&quot; height=&quot;166&quot; src=&quot;http://www.codeproject.com/KB/cs/partial/5.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;313&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Below is how the auto generated code looks like:&lt;/div&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain0&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; display: block; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0px; orphans: auto; padding: 0px; text-align: right; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; width=&quot;100%&quot;&gt;
&lt;img height=&quot;9&quot; id=&quot;preimg0&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; style=&quot;border: 0px; cursor: pointer; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;9&quot; /&gt;&lt;span id=&quot;precollapse0&quot; style=&quot;border: 0px; cursor: pointer; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Collapse&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;|&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/313352/real-time-use-of-Partial-classes-and-partial-met#&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Copy Code&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre0&quot; lang=&quot;cs&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); color: black; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-top: 0px; orphans: auto; overflow: auto; padding: 6px; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt; WebForm1 {
        
    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; form1 control.
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; 
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;remarks&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; Auto-generated field.
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; To modify move field declaration from designer file to code-behind file.
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;remarks&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;protected&lt;/span&gt; global::System.Web.UI.HtmlControls.HtmlForm form1;
    
    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; Button1 control.
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;remarks&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; Auto-generated field.
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; To modify move field declaration from designer file to code-behind file.
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;remarks&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;protected&lt;/span&gt; global::System.Web.UI.WebControls.Button Button1;
        
    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; Label1 control.
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;summary&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;remarks&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; Auto-generated field.
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; To modify move field declaration from designer file to code-behind file.
&lt;/span&gt;    &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;///&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; &lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;remarks&lt;/span&gt;&lt;span class=&quot;code-summarycomment&quot; style=&quot;border: 0px; color: grey; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;protected&lt;/span&gt; global::System.Web.UI.WebControls.Label Label1;
}&lt;/pre&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
At the same time, you would also like to customize the code in some other file in such a way that the auto generation part is not disturbed. For that, ASP.NET provides the “&lt;em style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;.aspx.cs&lt;/em&gt;” file which is a partial class where you can put your own custom logic.&lt;/div&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain1&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; display: block; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0px; orphans: auto; padding: 0px; text-align: right; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; width=&quot;100%&quot;&gt;
&lt;img height=&quot;9&quot; id=&quot;preimg1&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; style=&quot;border: 0px; cursor: pointer; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;9&quot; /&gt;&lt;span id=&quot;precollapse1&quot; style=&quot;border: 0px; cursor: pointer; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Collapse&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;|&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/313352/real-time-use-of-Partial-classes-and-partial-met#&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Copy Code&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre1&quot; lang=&quot;cs&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); color: black; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-top: 0px; orphans: auto; overflow: auto; padding: 6px; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt; WebForm1 : System.Web.UI.Page
{
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;object&lt;/span&gt; sender, EventArgs e)
    {
        &lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; Your custom logic
&lt;/span&gt;    }
}&lt;/pre&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
This is only possible when the class is split into two physical files but united via the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;partial&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;keyword. So if you look at any ASP.NET code-behind class file, it’ll be marked with the word&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;partial&lt;/code&gt;.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
By using the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;partial&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;keyword in ASP.NET, the Microsoft team has made VS and developers work side by side thus not fiddling with each other’s code and increasing productivity.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img border=&quot;0&quot; height=&quot;211&quot; src=&quot;http://www.codeproject.com/KB/cs/partial/6.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;373&quot; /&gt;&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #ff9900; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 30px; font-style: normal; font-variant: normal; font-weight: 200; letter-spacing: normal; line-height: normal; margin: 20px 0px 11px; orphans: auto; padding: 0px 0px 10px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Usenumber2:-LINQandEntityframework&quot; style=&quot;border: 0px; color: inherit; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;Use number 2: LINQ and Entity Framework&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
LINQ and EF also use partial classes and methods heavily because of the auto generation nature of these technologies. So when you drag tables in these framework, they create auto generated classes as shown in the below figure.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
In the figure, you can see how the auto generated code has partial classes and partial methods.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img border=&quot;0&quot; height=&quot;223&quot; src=&quot;http://www.codeproject.com/KB/cs/partial/7.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;366&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img border=&quot;0&quot; height=&quot;163&quot; src=&quot;http://www.codeproject.com/KB/cs/partial/8.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;463&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
The partial methods later can be extended to put custom logic. For instance, you can see in the below code that for the above auto-generated class&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;tblCustomer&lt;/code&gt;, we have used partial methods to override the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 0px; padding: 0px;&quot;&gt;OnCustomerCodeChanged&lt;/code&gt;event to ensure that customer code is not more than 8 characters.&lt;/div&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain2&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; display: block; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 0px; orphans: auto; padding: 0px; text-align: right; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot; width=&quot;100%&quot;&gt;
&lt;img height=&quot;9&quot; id=&quot;preimg2&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; style=&quot;border: 0px; cursor: pointer; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;9&quot; /&gt;&lt;span id=&quot;precollapse2&quot; style=&quot;border: 0px; cursor: pointer; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Collapse&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;|&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/313352/real-time-use-of-Partial-classes-and-partial-met#&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Copy Code&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre2&quot; lang=&quot;cs&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); color: black; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-top: 0px; orphans: auto; overflow: auto; padding: 6px; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: auto; word-spacing: 0px; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;class&lt;/span&gt; tblCustomer
{
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;void&lt;/span&gt; OnCustomerCodeChanged()
    {
        &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; (_CustomerCode.Length &amp;gt; &lt;span class=&quot;code-digit&quot; style=&quot;border: 0px; color: navy; margin: 0px; padding: 0px;&quot;&gt;8&lt;/span&gt;)
        {
            &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;new&lt;/span&gt; Exception(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;Customer code can not be greater than 8&quot;&lt;/span&gt;);
        }
    }
}&lt;/pre&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
So by using partial classes and partial methods, LINQ and EF keep auto generating classes and by using partial methods, we can customize the classes with our own logic.&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #ff9900; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 30px; font-style: normal; font-variant: normal; font-weight: 200; letter-spacing: normal; line-height: normal; margin: 20px 0px 11px; orphans: auto; padding: 0px 0px 10px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Usenumber3:-Bettermaintenancebycompactinglargeclasses&quot; style=&quot;border: 0px; color: inherit; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;Use number 3: Better maintenance by compacting large classes&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
The other important use of partial classes is for better maintenance of the project. If you have large classes with lots of methods as shown in the figure, it’s a bit of a pain to maintain those classes.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img border=&quot;0&quot; height=&quot;230&quot; src=&quot;http://www.codeproject.com/KB/cs/partial/9.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;233&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
By using partial classes, you can split them into physical files as shown in the below figure, thus making your project better and easy to maintain.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img border=&quot;0&quot; height=&quot;296&quot; src=&quot;http://www.codeproject.com/KB/cs/partial/10.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;231&quot; /&gt;&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #ff9900; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 30px; font-style: normal; font-variant: normal; font-weight: 200; letter-spacing: normal; line-height: normal; margin: 20px 0px 11px; orphans: auto; padding: 0px 0px 10px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;Usenumber4:-Multiplepeopleworkingonthesameclass&quot; style=&quot;border: 0px; color: inherit; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;/a&gt;Use number 4: Multiple people working on the same class&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img border=&quot;0&quot; height=&quot;210&quot; src=&quot;http://www.codeproject.com/KB/cs/partial/11.jpg&quot; style=&quot;border: 0px; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;351&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
The last and final real world use I see of partial classes is when we want developers to work simultaneously in the same class. I agree this can be a very rare use as there are better options like using a version control software like TFS or Subversion, but in case you want something quick and local, this option is not bad at all.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/3623523530980795482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/05/explain-about-partial-class-and-partual.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/3623523530980795482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/3623523530980795482'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/05/explain-about-partial-class-and-partual.html' title='Explain about Partial Class and partual methods'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-2017124097339386174</id><published>2014-05-26T03:59:00.002-07:00</published><updated>2014-05-26T03:59:18.043-07:00</updated><title type='text'> SSL on IIS 7.0 </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
SSL&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;enables browsers to communicate with a web-server over a secure channel that prevents eavesdropping, tampering and message forgery.&amp;nbsp;&amp;nbsp;You should&amp;nbsp;always use SSL for login pages where users are entering usernames/passwords, as well as for all other sensitive pages on sites (for example: account pages that show financial or personal&amp;nbsp;information).&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Configuring SSL on Windows with previous versions of IIS has been a pain.&amp;nbsp; Figuring out how to install and manage a certificate, and then associate it with a web-site, is something I bet most web developers don&#39;t know how to enable.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
The good news is that IIS 7.0 makes it radically easier to configure and enable SSL.&amp;nbsp; IIS 7.0 also now has built-in support for creating &quot;Self Signed Certificates&quot; that enable you to easily create test/personal certificates that you can use to quickly SSL enable a site for development or test purposes.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Using IIS 7.0 you can SSL enable an existing web site in under 30 seconds.&amp;nbsp; The below tutorial demonstrates how to-do this.&lt;/div&gt;
&lt;h5 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: 1em; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; margin: 0px 0px 0.5em; orphans: auto; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;strong&gt;&lt;u&gt;Step 1: Create a New Web Site&lt;/u&gt;&lt;/strong&gt;&lt;/h5&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
We&#39;ll start by creating a new web-site using the new IIS 7.0 admin tool.&amp;nbsp; This admin tool is a complete re-write of the previous IIS admin tool (and was written entirely in managed code using Windows Forms), and provides a more logical organization of web features.&amp;nbsp; It provides a GUI admin experience for all ASP.NET and IIS settings:&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&amp;nbsp;&lt;img src=&quot;http://www.scottgu.com/blogposts/ssl/step0.jpg&quot; style=&quot;margin: 0.5em; max-width: none;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
To create a new site on the box, right click on the &quot;Web Sites&quot; node in the left hand tree-view pane and choose the &quot;Add Web Site&quot; context menu option.&amp;nbsp; Enter the appropriate details to create a new web-site:&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img src=&quot;http://www.scottgu.com/blogposts/ssl/step1.jpg&quot; style=&quot;margin: 0.5em; max-width: none;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
One nice feature of IIS7 on Windows Vista is that you can now have an unlimited number of sites on a box (previous versions of IIS on Windows Client only allowed 1 site).&amp;nbsp; The 10 simultaneous request limitation on Windows Client versions of IIS also no longer exists with IIS 7.0.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Once we&#39;ve completed the above steps, we will now have a brand new site running on our IIS web-server.&lt;/div&gt;
&lt;h5 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: 1em; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; margin: 0px 0px 0.5em; orphans: auto; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;strong&gt;&lt;u&gt;Step 2: Create a new Self Signed Certificate&lt;/u&gt;&lt;/strong&gt;&lt;/h5&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Before binding SSL rules to our new site, we need to first import and setup&amp;nbsp;a security certificate to use with the SSL binding.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Certificates are managed in IIS 7.0 by clicking the root machine node in the left-hand tree-view explorer, and then selecting the &quot;Server Certificates&quot; icon in the feature pane on the right:&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img src=&quot;http://www.scottgu.com/blogposts/ssl/step3.jpg&quot; style=&quot;margin: 0.5em; max-width: none;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
This will then list all certificates registered on the machine, and allow you to optionally import and/or create new ones.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
I could optionally go to a certificate authority like Verisign and purchase a certificate to import using this admin UI.&amp;nbsp; Alternatively, I can create a &quot;self-signed certificate&quot; which is a test certificate that I can use during the development and testing of my site.&amp;nbsp; To-do this, click the &quot;Create Self-Signed Certificate&quot; link on the right-hand side of the admin tool:&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img src=&quot;http://www.scottgu.com/blogposts/ssl/step4.jpg&quot; style=&quot;margin: 0.5em; max-width: none;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Enter a name to use for the certificate (for example: &quot;test&quot;) and hit ok.&amp;nbsp; IIS7 will then automatically create a new self-signed crypto certificate for you and register it on the machine:&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img src=&quot;http://www.scottgu.com/blogposts/ssl/step5.jpg&quot; style=&quot;margin: 0.5em; max-width: none;&quot; /&gt;&lt;/div&gt;
&lt;h5 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: 1em; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; margin: 0px 0px 0.5em; orphans: auto; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;strong&gt;&lt;u&gt;Step 3: Enable HTTPS Bindings for our New Site&lt;/u&gt;&lt;/strong&gt;&lt;/h5&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
To SSL enable the web-site we created earlier, select the web-site node in the left-hand tree-view, and the click the &quot;Bindings&quot; link in its &quot;actions&quot; pane on the right-hand side of the screen:&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img src=&quot;http://www.scottgu.com/blogposts/ssl/step6.jpg&quot; style=&quot;margin: 0.5em; max-width: none;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
This will then bring up a dialog that lists all of the binding rules that direct traffic to this site (meaning the host-header/IP address/port combinations for the site):&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img src=&quot;http://www.scottgu.com/blogposts/ssl/step7.jpg&quot; style=&quot;margin: 0.5em; max-width: none;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
To enable SSL for the site, we&#39;ll want to click the &quot;Add&quot; button.&amp;nbsp;This will&amp;nbsp;bring up an &quot;add binding&quot; dialog that we can&amp;nbsp;use to add HTTPS protocol support.&amp;nbsp; We can select the self-signed certificate we created earlier from the SSL certificate dropdownlist in the dialog, and in doing so&amp;nbsp;indicate that we want to use that certificate when encrypting content over SSL:&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img src=&quot;http://www.scottgu.com/blogposts/ssl/step8.jpg&quot; style=&quot;margin: 0.5em; max-width: none;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Click ok, and we now have SSL enabled for our site:&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img src=&quot;http://www.scottgu.com/blogposts/ssl/step9.jpg&quot; style=&quot;margin: 0.5em; max-width: none;&quot; /&gt;&lt;/div&gt;
&lt;h5 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: 1em; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; margin: 0px 0px 0.5em; orphans: auto; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;strong&gt;&lt;u&gt;Step 4: Test out the Site&lt;/u&gt;&lt;/strong&gt;&lt;/h5&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Add a &quot;default.aspx&quot; page to the site, and then try and hit it with the browser by typing&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://localhost/default.aspx&quot; style=&quot;color: #0066cc;&quot;&gt;https://localhost/default.aspx&lt;/a&gt;&amp;nbsp;(note the usage of &quot;https&quot; instead of &quot;http&quot; to indicate that you want to connect over SSL).&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
If you are using IE7, you&#39;ll likely see this anti-phishing error message kick in&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img src=&quot;http://www.scottgu.com/blogposts/ssl/step10.jpg&quot; style=&quot;margin: 0.5em; max-width: none;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Don&#39;t panic if this happens - it is just IE being helpful by suggesting that a self-signed certificate on your local machine looks suspicious. Click the &quot;Continue to this website&quot; link to bypass this security warning and proceed to&amp;nbsp;the site.&amp;nbsp; You&#39;ll find that your&amp;nbsp;default.aspx page is now running protected via SSL:&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;img src=&quot;http://www.scottgu.com/blogposts/ssl/step11.jpg&quot; style=&quot;margin: 0.5em; max-width: none;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
You are all done. :-)&lt;/div&gt;
&lt;h5 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: 1em; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; margin: 0px 0px 0.5em; orphans: auto; padding: 0px; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;strong&gt;&lt;u&gt;Appendix: A Few Last SSL Notes&lt;/u&gt;&lt;/strong&gt;&lt;/h5&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin: 10px 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
A few last SSL related notes:&lt;/div&gt;
&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li&gt;The IIS 7.0 admin tool has an &quot;SSL Settings&quot; node that you can select for each site, directory or file that allows you to control whether that particular resource (and by default its children) requires an SSL request in order to execute.&amp;nbsp; This is useful for pages like a login.aspx page, where you want to guarantee that users can only enter their credentials when they are posting via an encrypted channel. If you configure the login.aspx page to require SSL, IIS 7.0 will block browsers from accessing it unless they are doing so over SSL.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li&gt;Within an ASP.NET page or handler, you can programmatically check whether the current request is using SSL by checking the Request.IsSecure property (it will return &quot;true&quot; if the incoming browser request is over SSL).&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: black; font-family: arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li&gt;You can set the &quot;requireSSL&quot; attribute on the &amp;lt;forms&amp;gt; configuration section within web.config files to have ASP.NET&#39;s forms-authentication system ensure that forms-authentication cookies are only set and used on SSL enabled pages and URLs.&amp;nbsp; This avoids the risk of a hacker trying to intercept the authentication cookie on a non-SSL secured page, and then trying to use a &quot;replay attack&quot; from a different machine to impersonate a user.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/2017124097339386174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/05/ssl-on-iis-70.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/2017124097339386174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/2017124097339386174'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/05/ssl-on-iis-70.html' title=' SSL on IIS 7.0 '/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-6036728241000251304</id><published>2014-05-26T03:57:00.004-07:00</published><updated>2014-05-26T03:58:20.252-07:00</updated><title type='text'>Explain about Constant and ReadOnly and Static</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;firstpara&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 10px 0px 5px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Constant and ReadOnly keyword are used to make a field constant which value cannot be modified. Static keyword is used to make members static that can be shared by all the class objects. In this article, I am going to explain the difference among these three.&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #4466c5; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Constant&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Constant fields or local variables must be assigned a value at the time of declaration and after that they cannot be modified. By default constant are static, hence you cannot define a constant type as static.&lt;/div&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: pre-wrap; widows: auto; width: 750px; word-spacing: 0px;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; X &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;box-sizing: border-box; color: #007efd; margin: 0px; vertical-align: top;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
A const field is a compile-time constant. A constant field or local variable can be initialized with a constant expression which must be fully evaluated at compile time.&lt;/div&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: pre-wrap; widows: auto; width: 750px; word-spacing: 0px;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Calculate&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; Z&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; X &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;box-sizing: border-box; color: #007efd; margin: 0px; vertical-align: top;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; X1 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;box-sizing: border-box; color: #007efd; margin: 0px; vertical-align: top;&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; Y &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; X &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; X1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;//no error, since its evaluated a compile time&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; Y1 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; X &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; Z&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;//gives error, since its evaluated at run time&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
You can apply const keyword to built-in value types (byte, short, int, long, char, float, double, decimal, bool), enum, a string literal, or a reference type which can be assigned with a value null.&lt;/div&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: pre-wrap; widows: auto; width: 750px; word-spacing: 0px;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;MyClass&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; obj1 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; null&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;//no error, since its evaluated a compile time&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;const&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;MyClass&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; obj2 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;MyClass&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;//gives error, since its evaluated at run time&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Constants can be marked as public, private, protected, internal, or protected internal access modifiers.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Use the const modifier when you sure that the value a field or local variable would not be changed.&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #4466c5; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
ReadOnly&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
A readonly field can be initialized either at the time of declaration or with in the constructor of same class. Therefore, readonly fields can be used for run-time constants.&lt;/div&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: pre-wrap; widows: auto; width: 750px; word-spacing: 0px;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;MyClass&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; readonly &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; X &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;box-sizing: border-box; color: #007efd; margin: 0px; vertical-align: top;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;// initialized at the time of declaration&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; readonly &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; X1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;MyClass&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; x1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L7&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; X1 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; x1&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;// initialized at run time&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L8&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L9&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Explicitly, you can specify a readonly field as static since, like constant by default it is not static. Readonly keyword can be apply to value type and reference type (which initialized by using the new keyword) both. Also, delegate and event could not be readonly.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Use the readonly modifier when you want to make a field constant at run time.&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #4466c5; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Static&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; margin: 0px; orphans: auto; padding: 7px 0px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
The static keyword is used to specify a static member, which means static members are common to all the objects and they do not tied to a specific object. This keyword can be used with classes, fields, methods, properties, operators, events, and constructors, but it cannot be used with indexers, destructors, or types other than classes.&lt;/div&gt;
&lt;pre class=&quot;prettyprint lang-c linenums&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f3f3f3; border-left-color: rgb(68, 102, 197); border-left-width: 2px; border-style: none none none solid; box-sizing: border-box; color: #161616; font-size: 14px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 24px; margin: 10px 0px 0px; orphans: auto; padding: 1px 5px 5px 0px; text-align: justify; text-indent: 0px; text-transform: none; vertical-align: top; white-space: pre-wrap; widows: auto; width: 750px; word-spacing: 0px;&quot;&gt;&lt;ol class=&quot;linenums&quot; style=&quot;box-sizing: border-box; color: #9d9d9d; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li class=&quot;L0&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;MyClass&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; X &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;box-sizing: border-box; color: #007efd; margin: 0px; vertical-align: top;&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; Y &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;box-sizing: border-box; color: #007efd; margin: 0px; vertical-align: top;&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #ff0080; margin: 0px; vertical-align: top;&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Show&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;()&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;{&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Console&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;);&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L7&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;Console&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #5353a6; margin: 0px; vertical-align: top;&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;Y&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;box-sizing: border-box; color: #4e9b00; font-style: italic; margin: 0px; vertical-align: top;&quot;&gt;//error, since you can access only static members&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L8&quot; style=&quot;box-sizing: border-box; color: #9d9d9d;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L9&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #393124; margin: 0px; vertical-align: top;&quot;&gt;}&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #00a69a; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 24px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 30px; margin: 15px 0px 10px; orphans: auto; padding-left: 0px; text-align: justify; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
Key points about Static keyword&lt;/h3&gt;
&lt;ol class=&quot;orderlist&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #f9f9f9; box-sizing: border-box; color: #161616; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 22px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 24px; list-style-type: decimal-leading-zero; margin-bottom: 10px; margin-left: 2px; margin-top: 0px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;box-sizing: border-box; padding: 5px 0px; text-align: justify;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; font-size: 14px; font-weight: normal; margin: 0px; padding: 0px; vertical-align: top;&quot;&gt;
If the static keyword is applied to a class, all the members of the class must be static.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; padding: 5px 0px; text-align: justify;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; font-size: 14px; font-weight: normal; margin: 0px; padding: 0px; vertical-align: top;&quot;&gt;
Static methods can only access static members of same class. Static properties are used to get or set the value of static fields of a class.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box; padding: 5px 0px; text-align: justify;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; font-size: 14px; font-weight: normal; margin: 0px; padding: 0px; vertical-align: top;&quot;&gt;
Static constructor can&#39;t be parameterized and public. Static constructor is always a private default constructor which is used to initialize static fields of the class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: &#39;segoe UI&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; outline: none 0px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; outline: none 0px;&quot;&gt;These are very common keywords and are quite confusing. So today we will discuss these keywords and try to understand them.&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #333333; font-family: &#39;segoe UI&#39;; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; outline: none 0px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;outline: none 0px;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; outline: none 0px;&quot;&gt;&lt;b style=&quot;outline: none 0px;&quot;&gt;Const&lt;/b&gt;: Const is nothing but &quot;constant&quot;, a variable of which the value is constant but at compile time. And it&#39;s mandatory to assign a value to it. By default a const is static and we cannot change the value of a const variable throughout the entire program.&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;img alt=&quot;Csharp-Const-ReadOnly-and-StaticReadOnly1.jpg&quot; border=&quot;0&quot; height=&quot;126&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/c210df/difference-between-const-readonly-and-static-readonly-in-C-Sharp/Images/Csharp-Const-ReadOnly-and-StaticReadOnly1.jpg&quot; style=&quot;border: none; outline: none 0px;&quot; width=&quot;494&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Here I have created a class named Variables and defined all three variables, so first let&#39;s play with const.&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;img alt=&quot;Csharp-Const-ReadOnly-and-StaticReadOnly2.jpg&quot; border=&quot;0&quot; height=&quot;118&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/c210df/difference-between-const-readonly-and-static-readonly-in-C-Sharp/Images/Csharp-Const-ReadOnly-and-StaticReadOnly2.jpg&quot; style=&quot;border: none; outline: none 0px;&quot; width=&quot;424&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Here I tried to de-initialize the const variable, it gaves me an error like &quot;A const field requires a value to be provided&quot;.&amp;nbsp; Ok now I initialize&amp;nbsp;a value for this variable and try to change it further in the class.&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;img alt=&quot;Csharp-Const-ReadOnly-and-StaticReadOnly3.jpg&quot; border=&quot;0&quot; height=&quot;366&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/c210df/difference-between-const-readonly-and-static-readonly-in-C-Sharp/Images/Csharp-Const-ReadOnly-and-StaticReadOnly3.jpg&quot; style=&quot;border: none; outline: none 0px;&quot; width=&quot;501&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Here I have created a static constructor, default constructor, parameterized constructor and a Simple Method. I tried to change the value of the const variable everywhere but once I assign the value, I am unable to change it again since when I do it gives me a compile time error as you can see in the snapshot above.&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Now let&#39;s on to the readonly keyword.&lt;br style=&quot;outline: none 0px;&quot; /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;outline: none 0px;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; outline: none 0px;&quot;&gt;&lt;b style=&quot;outline: none 0px;&quot;&gt;Readonly&lt;/b&gt;: Readonly is the keyword whose value we can change&amp;nbsp;during runtime or we can assign it at run time but only through the non-static constructor. Not even a method. Let&#39;s see:&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;img alt=&quot;Csharp-Const-ReadOnly-and-StaticReadOnly4.jpg&quot; border=&quot;0&quot; height=&quot;197&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/c210df/difference-between-const-readonly-and-static-readonly-in-C-Sharp/Images/Csharp-Const-ReadOnly-and-StaticReadOnly4.jpg&quot; style=&quot;border: none; outline: none 0px;&quot; width=&quot;619&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Here first I try to initialize the value in the static constructor. It gives me an error. Which you can see above.&lt;br style=&quot;outline: none 0px;&quot; /&gt;Now I try to change the value in a method, see what happened:&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;img alt=&quot;Csharp-Const-ReadOnly-and-StaticReadOnly5.jpg&quot; border=&quot;0&quot; height=&quot;223&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/c210df/difference-between-const-readonly-and-static-readonly-in-C-Sharp/Images/Csharp-Const-ReadOnly-and-StaticReadOnly5.jpg&quot; style=&quot;border: none; outline: none 0px;&quot; width=&quot;541&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&amp;nbsp;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Here, it is also giving an error that you can only assign a value either through a variable or a constructor.&lt;br style=&quot;outline: none 0px;&quot; /&gt;Now try to change the value in the default constructor.&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;img alt=&quot;Csharp-Const-ReadOnly-and-StaticReadOnly6.jpg&quot; border=&quot;0&quot; height=&quot;366&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/c210df/difference-between-const-readonly-and-static-readonly-in-C-Sharp/Images/Csharp-Const-ReadOnly-and-StaticReadOnly6.jpg&quot; style=&quot;border: none; outline: none 0px;&quot; width=&quot;543&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&amp;nbsp;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Now in the snapshot above you can see it&#39;s built successfully without an error, warning or messages. Let&#39;s check if there is a runtime error&lt;span style=&quot;font-size: x-small; outline: none 0px;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;OK.&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;img alt=&quot;Csharp-Const-ReadOnly-and-StaticReadOnly7.jpg&quot; border=&quot;0&quot; height=&quot;369&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/c210df/difference-between-const-readonly-and-static-readonly-in-C-Sharp/Images/Csharp-Const-ReadOnly-and-StaticReadOnly7.jpg&quot; style=&quot;border: none; outline: none 0px;&quot; width=&quot;650&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&amp;nbsp;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Now here we can see that there is not a runtime error and the value was assigned successfully to the Readonly variable.&lt;br style=&quot;outline: none 0px;&quot; /&gt;Now one gotcha is, now that you have assigned the value, can you change this value again ???&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Let&#39;s try to change the value agai&lt;span style=&quot;font-size: x-small; outline: none 0px;&quot;&gt;n.&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;img alt=&quot;Csharp-Const-ReadOnly-and-StaticReadOnly8.jpg&quot; border=&quot;0&quot; height=&quot;370&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/c210df/difference-between-const-readonly-and-static-readonly-in-C-Sharp/Images/Csharp-Const-ReadOnly-and-StaticReadOnly8.jpg&quot; style=&quot;border: none; outline: none 0px;&quot; width=&quot;556&quot; /&gt;&lt;/span&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&amp;nbsp;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Here I created &amp;nbsp;a parameterized constructor and created a new object, and passing a value as &quot;Hello Frend&#39;z&quot; and as I built it, it gave me the result &quot;Build Succeeded&quot;.&amp;nbsp; Now let&#39;s move ahead and check for a runtime error:&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;img alt=&quot;Csharp-Const-ReadOnly-and-StaticReadOnly9.jpg&quot; border=&quot;0&quot; height=&quot;407&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/c210df/difference-between-const-readonly-and-static-readonly-in-C-Sharp/Images/Csharp-Const-ReadOnly-and-StaticReadOnly9.jpg&quot; style=&quot;border: none; outline: none 0px;&quot; width=&quot;650&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&amp;nbsp;&lt;br style=&quot;outline: none 0px;&quot; /&gt;See guys. There is no runtime error !!&amp;nbsp; And the value can be changed again and again through a constructor.&lt;br style=&quot;outline: none 0px;&quot; /&gt;&amp;nbsp;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Now move ahead to Static Readonly variables.&lt;br style=&quot;outline: none 0px;&quot; /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;outline: none 0px;&quot;&gt;&lt;span style=&quot;font-family: Segoe UI; font-size: x-small; outline: none 0px;&quot;&gt;&lt;b style=&quot;outline: none 0px;&quot;&gt;Static ReadOnly&lt;/b&gt;: A Static Readonly type variable&#39;s value can be assigned at runtime or assigned at compile time and changed at runtime. But this variable&#39;s value can only be changed in the static constructor. And cannot be changed further. It can change only once at runtime. Let&#39;s understand it practically.&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;img alt=&quot;Csharp-Const-ReadOnly-and-StaticReadOnly10.jpg&quot; border=&quot;0&quot; height=&quot;286&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/c210df/difference-between-const-readonly-and-static-readonly-in-C-Sharp/Images/Csharp-Const-ReadOnly-and-StaticReadOnly10.jpg&quot; style=&quot;border: none; outline: none 0px;&quot; width=&quot;377&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;Now in the preceding you can see that I&amp;nbsp;used two variables, one is not assigned and another is assigned, and the static constructor.&amp;nbsp; Now in the static constructor you can see that the unassigned variable is being assigned and the assigned value is being changed. And there is no compile time error. Further I try to again change this variable&#39;s value.&amp;nbsp; See what happened:&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&lt;img alt=&quot;Csharp-Const-ReadOnly-and-StaticReadOnly11.jpg&quot; border=&quot;0&quot; height=&quot;406&quot; src=&quot;http://www.c-sharpcorner.com/UploadFile/c210df/difference-between-const-readonly-and-static-readonly-in-C-Sharp/Images/Csharp-Const-ReadOnly-and-StaticReadOnly11.jpg&quot; style=&quot;border: none; outline: none 0px;&quot; width=&quot;570&quot; /&gt;&lt;br style=&quot;outline: none 0px;&quot; /&gt;&amp;nbsp;&lt;br style=&quot;outline: none 0px;&quot; /&gt;As you can see in the above, I created Default, Parameterized Constructor and Method and tried to change the value again here. But I am getting a compile time error for all&lt;span style=&quot;font-size: x-small; outline: none 0px;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/6036728241000251304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2014/05/explain-about-constant-and-readonly-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/6036728241000251304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/6036728241000251304'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2014/05/explain-about-constant-and-readonly-and.html' title='Explain about Constant and ReadOnly and Static'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-6491083752564873703</id><published>2013-10-15T00:15:00.004-07:00</published><updated>2013-10-15T00:15:57.895-07:00</updated><title type='text'>Exception Handling in C#.Net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;
1. Introduction to Exceptions&lt;/h2&gt;
An &lt;code&gt;Exception&lt;/code&gt; is an object delivered by the &lt;code&gt;Exception&lt;/code&gt; class. This &lt;code&gt;Exception&lt;/code&gt; class is exposed by the &lt;code&gt;System.Exception&lt;/code&gt; namespace. &lt;code&gt;Exception&lt;/code&gt;s are used to avoid system failure in an unexpected manner. &lt;code&gt;Exception&lt;/code&gt; handles the failure situation that may arise. All the &lt;code&gt;exception&lt;/code&gt;s in the .NET Framework are derived from the &lt;code&gt;System.Exception&lt;/code&gt; class. &lt;br /&gt;


To understand &lt;code&gt;exception&lt;/code&gt;, we need to know two basic things:&lt;br /&gt;


&lt;ol&gt;
&lt;li&gt;Somebody sees a failure situation that happened and throws an exception by packing the valid information. &lt;/li&gt;
&lt;li&gt;Somebody who knows that a failure may happen catches the exception thrown. We call it &lt;code&gt;Exception&lt;/code&gt; Handler. &lt;/li&gt;
&lt;/ol&gt;
Below is a simple example, which shows what happens when an &lt;code&gt;Exception&lt;/code&gt; is not handled: &lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain0&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/125470/Exception-Handling-for-C-Beginners#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre0&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; ExceptionsEx
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;001: Start the Program Execution.
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; StartProgram()
    {
        Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Making Call to F1() &quot;&lt;/span&gt; );
        F1();
        Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Successfully returned from F1() &quot;&lt;/span&gt; );
    }

    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;002: Set of Function that calls each other
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; F1()
    {
        Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Making Call to F2() &quot;&lt;/span&gt; );
        &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; System.Exception();
        F2();
        Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Successfully returned from F2() &quot;&lt;/span&gt; );
    }
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; F2()
    {
        Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Inside F2 &quot;&lt;/span&gt; );
    }

    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Client 001: Program Entry
&lt;/span&gt;    [STAThread]
    &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Main(&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;[] args)
    {
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Create the Object and start the Execution
&lt;/span&gt;        ExceptionsEx app = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ExceptionsEx();
        app.StartProgram();
    }
}&lt;/pre&gt;
In the above code, look at the function F1 that throws an &lt;code&gt;Exception&lt;/code&gt;. But, there is no handler to deal with the thrown &lt;code&gt;exception&lt;/code&gt;. This situation is called an Un-Handled &lt;code&gt;exception&lt;/code&gt; situation. When you execute the code, you get an unhandled &lt;code&gt;exception&lt;/code&gt; dialog. &lt;br /&gt;

&lt;img alt=&quot;Pic01.jpg&quot; border=&quot;0&quot; height=&quot;189&quot; hspace=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/cs/Exceptions1/Pic01.jpg&quot; style=&quot;height: 189px; width: 444px;&quot; width=&quot;444&quot; /&gt; 
The above dialog is shown in debug mode, so you may get a chance to 
break the execution to see where the exception is thrown (or) continue 
ignoring the &lt;code&gt;exception&lt;/code&gt; (not advisable). &lt;br /&gt;


In release mode, you will get un-handled &lt;code&gt;Exception&lt;/code&gt; in the form of Application crash. &lt;br /&gt;

&lt;img alt=&quot;Pic02.jpg&quot; border=&quot;0&quot; height=&quot;165&quot; hspace=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/cs/Exceptions1/Pic02.jpg&quot; style=&quot;height: 165px; width: 492px;&quot; width=&quot;492&quot; /&gt; 
So, how do we avoid Un-Handled &lt;code&gt;Exception&lt;/code&gt;? Simple, handle it. &lt;br /&gt;


&lt;h2&gt;
2. Handling Exception&lt;/h2&gt;
To handle the exception, we need to place the code within the &lt;code&gt;try&lt;/code&gt; block. When an exception occurs inside the &lt;code&gt;try&lt;/code&gt; block, the control looks for the &lt;code&gt;catch&lt;/code&gt; block and raises an exception that&amp;nbsp;is handled in the &lt;code&gt;catch&lt;/code&gt; block. Below is the simple skeleton for the &lt;code&gt;try&lt;/code&gt; and &lt;code&gt;catch&lt;/code&gt; block: &lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain1&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/125470/Exception-Handling-for-C-Beginners#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre1&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt;
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Some Code that may expected to raise an exception
&lt;/span&gt;}
&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Raised exception Handled here
&lt;/span&gt;}&lt;/pre&gt;
The above skeleton handles any &lt;code&gt;exception&lt;/code&gt;. But, the main disadvantage is that we don’t know what &lt;code&gt;exception&lt;/code&gt; is raised and who raised the &lt;code&gt;exception&lt;/code&gt;. Below is the example that handles the &lt;code&gt;Exception&lt;/code&gt; raised by the function F1 and avoids the crash: &lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain2&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/125470/Exception-Handling-for-C-Beginners#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre2&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; ExceptionsEx
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;001: Start the Program Execution.
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; StartProgram()
    {
        Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Making Call to F1() &quot;&lt;/span&gt; );
        &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt;
        {
            F1();
        }
        &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;
        {
            Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Some Exception Occurred. 
  I don&#39;t know what Exception it is and where it Occurred. Sorry!&quot;&lt;/span&gt;);
        }
        Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Successfully returned from F1() &quot;&lt;/span&gt; );
    }

    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;002: Set of Function that calls each other
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; F1()
    {
        Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Making Call to F2() &quot;&lt;/span&gt; );
        &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; System.Exception();
        Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Successfully returned from F2() &quot;&lt;/span&gt; );
    }

    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Client 001: Program Entry
&lt;/span&gt;    [STAThread]
    &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Main(&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;[] args)
    {
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Create the Object and start the Execution
&lt;/span&gt;        ExceptionsEx app = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ExceptionsEx();
        app.StartProgram();
    }
}&lt;/pre&gt;
&lt;h2&gt;
3. Exception Bubbling&lt;/h2&gt;
In the above example, we saw that &lt;code&gt;Exception&lt;/code&gt; is handled in the &lt;code&gt;catch&lt;/code&gt; block. But, the function call order is simple (Call Stack) that is; &lt;code&gt;StartProgram&lt;/code&gt; calls the function F1 and F1 raised &lt;code&gt;exception&lt;/code&gt; is handled in the &lt;code&gt;catch&lt;/code&gt; block of the &lt;code&gt;StartProgram&lt;/code&gt;. &lt;br /&gt;


Imagine the situation what happens if there are multiple nested function calls, and &lt;code&gt;exception&lt;/code&gt; occurred in the fourth or fifth nested call. Look at the picture below: &lt;br /&gt;

&lt;img alt=&quot;PicA.jpg&quot; border=&quot;0&quot; height=&quot;347&quot; hspace=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/cs/Exceptions1/PicA.jpg&quot; style=&quot;height: 347px; width: 413px;&quot; width=&quot;413&quot; /&gt; 
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;F1()&lt;/code&gt;: Calls &lt;code&gt;F2&lt;/code&gt; within the &lt;code&gt;try&lt;/code&gt; block and handles the exception in &lt;code&gt;catch&lt;/code&gt; block &lt;/li&gt;
&lt;li&gt;&lt;code&gt;F2()&lt;/code&gt;: Makes a call to the function &lt;code&gt;F3&lt;/code&gt;. But it neither wraps the call for &lt;code&gt;F3&lt;/code&gt; in the &lt;code&gt;try&lt;/code&gt; block nor has the exception handler &lt;/li&gt;
&lt;li&gt;&lt;code&gt;F3()&lt;/code&gt;: Raises an Exception &lt;/li&gt;
&lt;/ul&gt;
Note, when the exception is thrown by the function &lt;code&gt;F3&lt;/code&gt;, even though the caller is &lt;code&gt;F2&lt;/code&gt;, as there is no &lt;code&gt;catch&lt;/code&gt; handler, the execution comes out of &lt;code&gt;F2&lt;/code&gt; and enters the &lt;code&gt;catch&lt;/code&gt; block of &lt;code&gt;F1&lt;/code&gt;. Travelling back from &lt;code&gt;F3&lt;/code&gt;-&amp;gt;&lt;code&gt;F2&lt;/code&gt;-&amp;gt;&lt;code&gt;F1&lt;/code&gt; is known as Stack Unwind. And exception occurred in &lt;code&gt;F3&lt;/code&gt; is handled in &lt;code&gt;F1&lt;/code&gt; even when there is no handler at &lt;code&gt;F2&lt;/code&gt; is known as &lt;code&gt;Exception&lt;/code&gt; Bubbling.&lt;br /&gt;Below is the example that demonstrates the &lt;code&gt;Exception&lt;/code&gt; Bubbling: &lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain3&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/125470/Exception-Handling-for-C-Beginners#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre3&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;using&lt;/span&gt; System;

&lt;span class=&quot;code-keyword&quot;&gt;namespace&lt;/span&gt; ExceptionHandling
{
    &lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; ExceptionsEx
    {
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;001: Start the Program Execution.
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; StartProgram()
        {
            Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Making Call to F1() &quot;&lt;/span&gt; );
            &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt;
            {
                F1();
            }
            &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;
            {
                Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Some Exception Occurred. 
  I don&#39;t know what Exception it is and where it Occurred. Sorry!&quot;&lt;/span&gt;);
            }
            Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Successfully returned from F1() &quot;&lt;/span&gt; );
        }

        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;002: Set of Function that calls each other
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; F1()
        {
            Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Making Call to F2() &quot;&lt;/span&gt; );
            F2();
            Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Successfully returned from F2() &quot;&lt;/span&gt; );
        }
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; F2()
        {
            Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Making Call to F2() &quot;&lt;/span&gt; );
            F3();
            Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Successfully returned from F2() &quot;&lt;/span&gt; );
        }
        &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; F3()
        {
            Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Inside F3 &quot;&lt;/span&gt; );
            &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; System.Exception();
        }

        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Client 001: Program Entry
&lt;/span&gt;        [STAThread]
        &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Main(&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;[] args)
        {
            &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Create the Object and start the Execution
&lt;/span&gt;            ExceptionsEx app = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ExceptionsEx();
            app.StartProgram();
        }
    }
}&lt;/pre&gt;
&lt;h2&gt;
4. The Importance of Finally Block&lt;/h2&gt;
In the above example, we saw that when an &lt;code&gt;exception&lt;/code&gt; occurs, we directly jump back on the call stack and travel back searching for the &lt;code&gt;catch&lt;/code&gt;
 handler. What about the piece of code that comes next to the exception 
raising code? If we do releasing resource and releasing the heap memory 
in the next couple of statements, that will not get reached. Right? &lt;br /&gt;


&lt;code&gt;Finally&lt;/code&gt; block is the solution for this. Now look at the improved &lt;code&gt;exception&lt;/code&gt;-handling skeleton below:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain4&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/125470/Exception-Handling-for-C-Beginners#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre4&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt;
{
}
&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;
{
}
&lt;span class=&quot;code-keyword&quot;&gt;finally&lt;/span&gt;
{
}&lt;/pre&gt;
Whatever happens inside the &lt;code&gt;try&lt;/code&gt; block, it is guaranteed that &lt;code&gt;finally&lt;/code&gt; block gets executed. Hence, all resource releases should be in the &lt;code&gt;finally&lt;/code&gt; block. Have a look at the below picture: &lt;br /&gt;

&lt;img alt=&quot;PicB.jpg&quot; border=&quot;0&quot; height=&quot;375&quot; hspace=&quot;0&quot; src=&quot;http://www.codeproject.com/KB/cs/Exceptions1/PicB.jpg&quot; style=&quot;height: 375px; width: 537px;&quot; width=&quot;537&quot; /&gt; 
&lt;code&gt;Exception&lt;/code&gt; raised at function &lt;code&gt;F3&lt;/code&gt; is handled in the function &lt;code&gt;F2&lt;/code&gt;. Look at the &lt;code&gt;try&lt;/code&gt; block, I marked two blocks of code before &lt;code&gt;exception&lt;/code&gt; and code after &lt;code&gt;exception&lt;/code&gt;. It is obvious that when an &lt;code&gt;exception&lt;/code&gt;
 raised, the set of code inside the code after exception is never 
executed. If resources are allocated in code before exception and the 
allocated resources are released in code after exception, we do have a 
resource leak for each &lt;code&gt;exception&lt;/code&gt; occurred. Also, think about business logic that needs to revert back apart from the resource leak. This is why &lt;code&gt;finally&lt;/code&gt; block is introduced. &lt;br /&gt;


Whether an &lt;code&gt;Exception&lt;/code&gt; occurs or not, the code inside &lt;code&gt;finally&lt;/code&gt; block always gets executed. So you can keep all the cleaning code inside the &lt;code&gt;finally&lt;/code&gt;
 block. The attached sample solution explains the above situation. Put a
 break point in the very first statement of the function &lt;code&gt;public void StartProgram()&lt;/code&gt; and examine the situation explained above. Note, the usage of &lt;code&gt;try&lt;/code&gt; block with only &lt;code&gt;finally&lt;/code&gt; and without &lt;code&gt;catch&lt;/code&gt; in function &lt;code&gt;F2&lt;/code&gt;. Think about it.&lt;br /&gt;


&lt;h2&gt;
5. What is Exception Class?&lt;/h2&gt;
This class is provided by .NET Framework to handle any &lt;code&gt;exception&lt;/code&gt; that occurred. The &lt;code&gt;Exception&lt;/code&gt; class is the base class for all other &lt;code&gt;Exception&lt;/code&gt; class provided by .NET Framework.&lt;br /&gt;


The exception object has some important properties. Some of then are given below: &lt;br /&gt;


&lt;table class=&quot;ArticleTable&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 50%;&quot;&gt;&lt;strong&gt;Property&lt;/strong&gt; &lt;/td&gt;

&lt;td style=&quot;width: 50%;&quot;&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 50%;&quot;&gt;&lt;code&gt;Message&lt;/code&gt;&lt;/td&gt;

&lt;td style=&quot;width: 50%;&quot;&gt;Gives detailed information about the message&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 50%;&quot;&gt;&lt;code&gt;StackTrace&lt;/code&gt;&lt;/td&gt;

&lt;td style=&quot;width: 50%;&quot;&gt;Gives the function stack to show where &lt;code&gt;exception&lt;/code&gt; is thrown &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 50%;&quot;&gt;&lt;code&gt;Targetsite&lt;/code&gt;&lt;/td&gt;

&lt;td style=&quot;width: 50%;&quot;&gt;Shows which method throws the &lt;code&gt;exception&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
In the previous example, we only used the &lt;code&gt;catch&lt;/code&gt; block and missed all the above said information. The &lt;code&gt;exception&lt;/code&gt; object is thrown by the piece of code, which raises an &lt;code&gt;Exception&lt;/code&gt; and the handler code catches that &lt;code&gt;Exception&lt;/code&gt; object and makes use of the information packed in it. Consider the below example:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain5&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/125470/Exception-Handling-for-C-Beginners#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre5&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; SomefunctionX()
{
 &lt;span class=&quot;code-keyword&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; DivideByZeroException();
}

&lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; SomeFunctionY()
{
 &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt;
 {
  SomefunctionX();
 }
&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (DivideByZeroException Ex)
 {
 &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Use the Ex here to get information
&lt;/span&gt; }
}&lt;/pre&gt;
The example was shown just to understand from where the object that is used in the &lt;code&gt;catch&lt;/code&gt; block is coming from. Hope, now you know the &lt;code&gt;exception&lt;/code&gt; instance created on the &lt;code&gt;throw&lt;/code&gt; statement caught in the &lt;code&gt;catch&lt;/code&gt; block and used. Note that, the base class of &lt;code&gt;DivideByZeroException&lt;/code&gt; is &lt;code&gt;ArithmaticException&lt;/code&gt;, which is derived from the &lt;code&gt;System.Exception&lt;/code&gt;. Now the question is, May I use &lt;code&gt;ArithmaticException&lt;/code&gt; in the &lt;code&gt;catch&lt;/code&gt;
 block? Yes. Why not? That is the beauty of polymorphism. When you do, 
always keep in mind that you are moving from more specialized 
information thrown to the generalized one.&lt;br /&gt;


&lt;h2&gt;
6. Handler for Multiple Exceptions&lt;/h2&gt;
A code placed in the &lt;code&gt;try&lt;/code&gt; block can raise different kinds
 of exception. It can be say, a Divide by Zero or a Network System 
Access Denied or a File not exists. How do you handle all the 
exceptions? The answer is, you can place multiple &lt;code&gt;catch&lt;/code&gt; blocks for a &lt;code&gt;try&lt;/code&gt; block. When an exception is thrown, type of that exception is examined against each &lt;code&gt;catch&lt;/code&gt; block. When a match occurs (even polymorph), the &lt;code&gt;exception&lt;/code&gt; enters into the &lt;code&gt;catch&lt;/code&gt; block and gets handled. &lt;br /&gt;


Let me walk through an example, which will explain the following to you:&lt;br /&gt;


&lt;ol&gt;
&lt;li&gt;Make use of &lt;code&gt;Exception&lt;/code&gt; object in the &lt;code&gt;catch&lt;/code&gt; block &lt;/li&gt;
&lt;li&gt;Using multiple &lt;code&gt;catch&lt;/code&gt; blocks for different &lt;code&gt;exception&lt;/code&gt;s &lt;/li&gt;
&lt;li&gt;The importance order of the &lt;code&gt;catch&lt;/code&gt; blocks &lt;/li&gt;
&lt;/ol&gt;
1) Program enters the main function and calls the member function &lt;code&gt;StartProgram&lt;/code&gt; after creating the object of type &lt;code&gt;ExceptionsP2&lt;/code&gt;. &lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain6&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/125470/Exception-Handling-for-C-Beginners#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre6&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;[STAThread]
&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Main(&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;[] args)
{
 ExceptionsP2 start = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ExceptionsP2();
 start.StartProgram();
}&lt;/pre&gt;
2) The &lt;code&gt;StartProgram&lt;/code&gt; function makes a call to &lt;code&gt;Calculate&lt;/code&gt; function. And this call is placed in the &lt;code&gt;try&lt;/code&gt; block as it is expected that there be some arithmetic exception and possibly a Divide by Zero exception. Two &lt;code&gt;catch&lt;/code&gt; blocks are placed for the &lt;code&gt;try&lt;/code&gt; block of code. One is &lt;code&gt;DivideByZeroException&lt;/code&gt; and other one is &lt;code&gt;System.Exception&lt;/code&gt;. Inside each &lt;code&gt;catch&lt;/code&gt; block, the exception object caught was used to display the &lt;code&gt;Exception&lt;/code&gt; message, and function call stack of where the &lt;code&gt;exception&lt;/code&gt; raised. Below is the code:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain7&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/125470/Exception-Handling-for-C-Beginners#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre7&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;001: Function that Handles the Exception
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; StartProgram()
{
 Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Calling the Function Calculate&quot;&lt;/span&gt;);
 &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt;
 {
  Calculate();
 }
 &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (DivideByZeroException Ex)
 {
  Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Divide By Zero. 
   Look at the Call stack for More information&quot;&lt;/span&gt;);
  Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Packed Message: &quot;&lt;/span&gt; +  Ex.Message );
  Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Thrown By: &quot;&lt;/span&gt; + Ex.TargetSite );
  Console.Write(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Call Stack: &quot;&lt;/span&gt; + Ex.StackTrace );
 }
 &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (Exception Ex)
 {
  Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;General Exception Occurred&quot;&lt;/span&gt;);
  Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Packed Message: &quot;&lt;/span&gt; +  Ex.Message );
  Console.Write(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Call Stack: &quot;&lt;/span&gt; + Ex.StackTrace );
 }
}&lt;/pre&gt;
3) The calculate is just an intermediate function which makes a call to &lt;code&gt;Divide&lt;/code&gt;.
 Note how the stack rewind and exception bubbling is happening. Below is
 the function which makes a call to divide, and does not have any 
Exception handler code:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain8&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/125470/Exception-Handling-for-C-Beginners#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre8&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;002: An intermediate function, just for Demo Purpose
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Calculate()
{
 Console.WriteLine(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;Calling Divide Function &quot;&lt;/span&gt;);
 Divide();
}&lt;/pre&gt;
4) The &lt;code&gt;divide&lt;/code&gt; function tries to divide a number by zero.
 The .NET environment detects the situation and raises the exception for
 us. Note there is no &lt;code&gt;throw&lt;/code&gt; statement here. In my previous examples (actually in the previous part), I forced the system to throw an &lt;code&gt;Exception&lt;/code&gt; for my demonstration purpose. We usually use the &lt;code&gt;throw&lt;/code&gt;
 statement for Custom defined exceptions. The .NET environment is smart 
enough to detect the exception at right time and raise it. Below is the 
code for divide: &lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain9&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/125470/Exception-Handling-for-C-Beginners#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre9&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;003: The Divide function which actually raises an Exception
&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Divide()
{
 &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; x = &lt;span class=&quot;code-digit&quot;&gt;10&lt;/span&gt;;
 &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; y = &lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;;
 y = x / y;   
}&lt;/pre&gt;
&lt;h2&gt;
7. Closing Notes &lt;/h2&gt;
The &lt;code&gt;DivideByZeroException&lt;/code&gt; thrown in the &lt;code&gt;Divide&lt;/code&gt; function is caught by the &lt;code&gt;StartProgram&lt;/code&gt; function. Then the &lt;code&gt;exception&lt;/code&gt; object is matched against the first &lt;code&gt;catch&lt;/code&gt; block. As there is a match, the &lt;code&gt;exception&lt;/code&gt; enters that &lt;code&gt;catch&lt;/code&gt; block.&lt;br /&gt;


What happens if &lt;code&gt;System.Exception catch&lt;/code&gt; block is before the &lt;code&gt;DivideByZeroException&lt;/code&gt;? We do enter the &lt;code&gt;System.Exception catch&lt;/code&gt; block even though a more perfect match exists. Because, the &lt;code&gt;exception&lt;/code&gt; caught is matched from top to bottom. As the &lt;code&gt;System.Exception&lt;/code&gt; is on the top (that is; Before &lt;code&gt;DivideByZero&lt;/code&gt;) and the caught &lt;code&gt;Exception DivideByZeroException&lt;/code&gt; is polymorphically a &lt;code&gt;System.Exception&lt;/code&gt; the execution control just enters the &lt;code&gt;System.Exception catch&lt;/code&gt; block.&lt;br /&gt;


So always keep in mind to place more specific &lt;code&gt;catch&lt;/code&gt; statement first and move down with more Generalized &lt;code&gt;Exception&lt;/code&gt;s. Look at the code below how a smart developer placed his &lt;code&gt;catch&lt;/code&gt; block based on what his Team Lead told. &lt;br /&gt;


Lead: “The code block may raise a &lt;code&gt;DivideByZeroException&lt;/code&gt; or Any &lt;code&gt;ArithmeticException&lt;/code&gt;. It is possible to have &lt;code&gt;FileNotFound Exception&lt;/code&gt; also. These are the possibilities of &lt;code&gt;Exception&lt;/code&gt; I am seeing when I am reviewing your code. But, for safety, try to handle all &lt;code&gt;exception&lt;/code&gt;s in the world and it is OK if it is not more specific”. &lt;br /&gt;


That&#39;s all, the Lead went to a meeting. &lt;br /&gt;


Forget what meeting he is going for, see how the developer placed his &lt;code&gt;catch&lt;/code&gt; block:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain10&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/125470/Exception-Handling-for-C-Beginners#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre10&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt;
{
 &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; The set of code and function here
&lt;/span&gt; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; reviewed by an Experienced lead.
&lt;/span&gt;}
&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (System.FileNotFoundException Ex)
{
 &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;File Not Found Exception is Different from Divide by zero.
&lt;/span&gt; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Look at the Inheritance hierarchy in MSDN for FileNotFoundException
&lt;/span&gt; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;and DivideByZeroException.
&lt;/span&gt; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;So I don&#39;t care Which one First, FileNotFond or DivideByZero
&lt;/span&gt;}
&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;( System.DivideByZeroException Ex) 
{
 &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Divide by Zero Exception. Need More Specialized care
&lt;/span&gt;}
&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (System.ArithmeticException Ex)
{
 &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; For any ArithmaticException except DivideByZero. Because I already handled it 
&lt;/span&gt; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; before this catch statement
&lt;/span&gt;}
&lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt;(System.Exception Ex)
{
 &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;I am not expecting that this would Occur. As per my Lead
&lt;/span&gt; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;I placed it for safe to handle any Exception in the world 
&lt;/span&gt; &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; That derived from Exception.
&lt;/span&gt;}
&lt;span class=&quot;code-keyword&quot;&gt;finally&lt;/span&gt;
{
 &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Clean-up code
&lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/6491083752564873703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2013/10/exception-handling-in-cnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/6491083752564873703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/6491083752564873703'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2013/10/exception-handling-in-cnet.html' title='Exception Handling in C#.Net'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-8675635515539919640</id><published>2013-10-15T00:10:00.005-07:00</published><updated>2013-10-15T00:10:38.555-07:00</updated><title type='text'>Explain about DefaultIfEmpty() in LINQ</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot;&gt;
Using Linq DefaultIfEmpty() extension method
&lt;/h3&gt;
&lt;div class=&quot;post-header&quot;&gt;

&lt;/div&gt;
By Using DefaultIfEmpty() extension method you can check the sequence 
for empty and return something for it and do some manipulation on it 
afterwards.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #f3f3f3; color: blue;&quot;&gt;
&lt;b&gt;For example&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  sql&quot; id=&quot;highlighter_351818&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;sql plain&quot;&gt;var numbers = new &lt;/code&gt;&lt;code class=&quot;sql keyword&quot;&gt;int&lt;/code&gt;&lt;code class=&quot;sql plain&quot;&gt;[] {1,2,3,4,5,6,7};&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;sql plain&quot;&gt;Console.WriteLine(numbers.DefaultIfEmpty().&lt;/code&gt;&lt;code class=&quot;sql color2&quot;&gt;Sum&lt;/code&gt;&lt;code class=&quot;sql plain&quot;&gt;());&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
If the sequence is empty it will return 0 otherwise it will sum and return that.&lt;br /&gt;
&lt;br /&gt;
By Default if you want to return some value other then 0 it will return that as well&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  sql&quot; id=&quot;highlighter_431300&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;sql plain&quot;&gt;Console.WriteLine(numbers.DefaultIfEmpty(100).&lt;/code&gt;&lt;code class=&quot;sql color2&quot;&gt;Sum&lt;/code&gt;&lt;code class=&quot;sql plain&quot;&gt;());&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
In this case it will return 100 if the sequence is empty.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/8675635515539919640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2013/10/explain-about-defaultifempty-in-linq.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/8675635515539919640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/8675635515539919640'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2013/10/explain-about-defaultifempty-in-linq.html' title='Explain about DefaultIfEmpty() in LINQ'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-796971830978732455</id><published>2013-10-15T00:10:00.000-07:00</published><updated>2013-10-15T00:10:00.881-07:00</updated><title type='text'>Explain about ISAPI DLL and ISAPI Filter </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
 
   &lt;div class=&quot;introduction&quot;&gt;
&lt;br /&gt;
&lt;blockquote&gt;
  &lt;em&gt;&lt;strong&gt;ISAPI&lt;/strong&gt; (Internet Server Application Program Interface) is a set of Windows
  program calls that let you write a Web
  server application that will run
  faster than a common gateway interface
  (CGI) application. A disadvantage of a
  CGI application (or &quot;executable file,&quot;
  as it is sometimes called) is that
  each time it is run, it runs as a
  separate process with its own address
  space, resulting in extra instructions
  that have to be performed, especially
  if many instances of it are running on
  behalf of users. Using ISAPI, you
  create a dynamic link library (DLL)
  application file that can run as part
  of the Hypertext Transport Protocol
  (HTTP) application&#39;s process and
  address space. The DLL files are
  loaded into the computer when HTTP is
  started and remain there as long as
  they are needed; they don&#39;t have to be
  located and read into storage as
  frequently as a CGI application.&lt;/em&gt;  &lt;br /&gt;

  
  &lt;em&gt;A special kind of ISAPI DLL is called
  an ISAPI filter, which can be
  designated to receive control for
  every HTTP request. You can create an
  ISAPI filter for encryption or
  decryption, for logging, for request
  screening, or for other purposes.&lt;/em&gt; &lt;/blockquote&gt;
&lt;h2&gt;
Introduction&lt;/h2&gt;
Unless you have been a caveman, you have seen a number of web sites 
that whenever is browsed, the navigation ends up to a DLL file residing 
in a scripting directory of that dominium! Something like the following 
pseudo URL:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain0&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/1432/What-is-an-ISAPI-Extension#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre0&quot; lang=&quot;html&quot; style=&quot;margin-top: 0px;&quot;&gt;http://www.mydomain.com/script/&lt;strong&gt;example.dll&lt;/strong&gt;?ID=p05874&amp;amp;Tx=870250AZT6&lt;/pre&gt;
What does this DLL suppose to do and what does it have to do with today&#39;s paper?&lt;br /&gt;


These DLLs are created using the Internet Server API, or &lt;strong&gt;ISAPI &lt;/strong&gt;for short. ISAPI is developed to provide a benefit or two, over the shortcomings of Common Gateway Interface, &lt;strong&gt;CGI&lt;/strong&gt;.
 Although we surprisingly experience new web sites developed exclusively
 by CGI scripts nowadays, however, ISAPI DLLs have got something to 
offer that CGI could never bring us this way or that way.&lt;br /&gt;


I am going to start off this paper by describing the underlying 
details that any ISAPI programmer has to know, to be able to develop a 
better ISAPI extension. From then on, I will go through a development of
 a useful ISAPI extension step by step. The extension is supposed to &lt;strong&gt;validate a given credit card&lt;/strong&gt;.
 Yeah! This is also my answer to those people who asked me the algorithm
 involved validating a credit card over and over again. Gotta go!&lt;br /&gt;


&lt;h2&gt;
What is ISAPI?&lt;/h2&gt;
Internet Server Application Programming Interface (ISAPI), is an API 
developed to provide the application developers with a powerful way to 
extend the functionality of Internet Information Server (IIS). Although 
ISAPI extensions by no means are limited to IIS, they are extensively 
used in conjunction with MS-IIS.&lt;br /&gt;


&lt;h3&gt;
CGI vs. ISAPI&lt;/h3&gt;
Developing a CGI program involves creating an EXE with C, C++, and/or
 Perl programming languages. This EXE file will be executed and 
terminated for every request received, causing an excessive memory 
usage, whenever users hit the same page over and over again! &lt;br /&gt;


This excessive memory usage that could bring the server completely 
down, has been solved under ISAPI extensions. An ISAPI extension is a 
regular DLL file that exposes 3 special functions that is called by the 
calling process (i.e., IIS) and therefore, will be loaded to memory 
once, no matter how many clients are going to use it at the same time. 
(It would be a good idea if you could take a look at a reference, to see
 how memory management is done under Windows 2000. The &lt;a href=&quot;http://shop.barnesandnoble.com/booksearch/isbnInquiry.asp?userid=161SPKPJFX&amp;amp;mscssid=9UPEER8MRM698JDFN5513EXSRGWG8CL1&amp;amp;isbn=0764532286&quot; target=&quot;_blank&quot;&gt;Visual C++ 6.0 Bible&lt;/a&gt;, Chapter 18, The Memory Management, describes it well!)&lt;br /&gt;


&lt;h2&gt;
ISAPI fundamentals&lt;/h2&gt;
Since the ISAPI extension and the calling process (IIS) live at the 
same address space, they could contact each other, directly. This means a
 great potential to bring the whole IIS down, and in some cases, the 
entire web server! Take a look at the following figure:&lt;br /&gt;


&lt;img height=&quot;240&quot; src=&quot;http://www.codeproject.com/KB/ISAPI/ISAPI_Extensions/fig1.gif&quot; width=&quot;340&quot; /&gt;&lt;br /&gt;


You see whatever problem your extension encounters, it could affect 
the entire web server process, if it&#39;s not handled properly. As 
illustrated above, communicating between the extension and IIS is done 
via a pointer to a structure of type ECB, or Extension Control Block 
that is declared as follows: &lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain1&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/1432/What-is-an-ISAPI-Extension#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre1&quot; style=&quot;margin-top: 0px;&quot;&gt;typedef &lt;span class=&quot;code-keyword&quot;&gt;struct&lt;/span&gt; _EXTENSION_CONTROL_BLOCK
{
   DWORD     cbSize;                 &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; size of this struct.
&lt;/span&gt;   DWORD     dwVersion;              &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; version info of this spec
&lt;/span&gt;   HCONN     ConnID;                 &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Context number not to be modified!
&lt;/span&gt;   DWORD     dwHttpStatusCode;       &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; HTTP Status code
&lt;/span&gt;   CHAR      lpszLogData[HSE_LOG_BUFFER_LEN];&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; null terminated log info
&lt;/span&gt;
   LPSTR     lpszMethod;             &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; REQUEST_METHOD
&lt;/span&gt;   LPSTR     lpszQueryString;        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; QUERY_STRING
&lt;/span&gt;   LPSTR     lpszPathInfo;           &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; PATH_INFO
&lt;/span&gt;   LPSTR     lpszPathTranslated;     &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; PATH_TRANSLATED
&lt;/span&gt;
   DWORD     cbTotalBytes;           &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Total bytes indicated from client
&lt;/span&gt;   DWORD     cbAvailable;            &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Available number of bytes
&lt;/span&gt;   LPBYTE    lpbData;                &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; pointer to cbAvailable bytes
&lt;/span&gt;
   LPSTR     lpszContentType;        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Content type of client data
&lt;/span&gt;
   BOOL (WINAPI * GetServerVariable) (HCONN hConn,
   LPSTR      lpszVariableName,
   LPVOID     lpvBuffer,
   LPDWORD    lpdwSize );

   BOOL (WINAPI * WriteClient)  (HCONN ConnID,
   LPVOID     Buffer,
   LPDWORD    lpdwBytes,
   DWORD      dwReserved );

   BOOL (WINAPI * ReadClient)  (HCONN ConnID,
   LPVOID     lpvBuffer,
   LPDWORD    lpdwSize );

   BOOL (WINAPI * ServerSupportFunction)( HCONN hConn,
   DWORD      dwHSERequest,
   LPVOID     lpvBuffer,
   LPDWORD    lpdwSize,
   LPDWORD    lpdwDataType ); 

}EXTENSION_CONTROL_BLOCK, *LPEXTENSION_CONTROL_BLOCK; &lt;/pre&gt;
Whatever information either the calling process or the extension 
wants to pass to the other, is done through this control block. We will 
shortly have a look at this ECB structure. For now, let&#39;s see how IIS 
works in conjunction with your extension, to serve the visitor of your 
web site.&lt;br /&gt;


Whenever an extension is accessed (e.g., &lt;em&gt;http://www.mydomain.com/script/&lt;strong&gt;example.dll&lt;/strong&gt;?ID=p05874 &amp;amp; Tx=870250AZT6),&lt;/em&gt; IIS checks to see whether the &lt;em&gt;example.dll&lt;/em&gt;
 is loaded into memory. If it is not, then it initiates the loading 
process. Once the DLL is loaded into memory, a worker thread starts 
running to manage our extension, and thereafter the entry point (&lt;code&gt;DLLMain&lt;/code&gt; function) is called. When the &lt;code&gt;DLLMain&lt;/code&gt; finishes, the server makes a call to &lt;code&gt;GetExtensionVersion&lt;/code&gt; function to perform two tasks:&lt;br /&gt;


&lt;ol&gt;
&lt;li&gt;Exchange version information &lt;/li&gt;
&lt;li&gt;Get a short text description of the extension &lt;/li&gt;
&lt;/ol&gt;
The server then calls the &lt;code&gt;HttpExtensionProc&lt;/code&gt; function 
passing a copy of the ECB&#39;s pointer to start the actual ISAPI extension.
 This is the function that makes writing data back to the client, 
possible! We will examine this, shortly.&lt;br /&gt;


The third and the last entry point in an ISAPI extension DLL is the &lt;code&gt;TerminateExtension&lt;/code&gt;
 function that is called whenever the extension is going to be unloaded 
from the memory. All the cleanup code can be done in this function.&lt;br /&gt;


&lt;em&gt;In brief, an ISAPI extension is a regular DLL that exposes 3 functions to interact with the server:&lt;/em&gt;&lt;br /&gt;


&lt;ol&gt;
&lt;li&gt;&lt;code&gt;GetExtensionVersion&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;&lt;code&gt;HttpExtensionProc&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;&lt;code&gt;TerminateExtension&lt;/code&gt; (optional) &lt;/li&gt;
&lt;/ol&gt;
Having this information in hand, let&#39;s start with the &lt;code&gt;DLLMain&lt;/code&gt;, the entry point of any DLL!&lt;br /&gt;


&lt;h3&gt;
DLLMain, the entry point&lt;/h3&gt;
As indicated by Microsoft, &quot;the &lt;code&gt;DllMain&lt;/code&gt; function is an 
optional entry point into a dynamic-link library (DLL). If the function 
is used, it is called by the system when processes and threads are 
initialized and terminated, or upon calls to the &lt;code&gt;LoadLibrary&lt;/code&gt; and &lt;code&gt;FreeLibrary&lt;/code&gt; functions&quot;, that is prototyped as follows:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain2&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/1432/What-is-an-ISAPI-Extension#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre2&quot; style=&quot;margin-top: 0px;&quot;&gt;BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwCallReason, 
                                            LPVOID lpReserved);&lt;/pre&gt;
If you provide your extension with this function, it will be called 
upon the initialization and the termination process of your extension. 
The state is indicated by the &lt;code&gt;dwCallReason&lt;/code&gt; parameter that could be one the following predefined values:&lt;br /&gt;


&lt;ul&gt;
&lt;li&gt;&lt;code&gt;DLL_PROCESS_ATTACHED&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;&lt;code&gt;DLL_THREAD_ATTACH&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;&lt;code&gt;DLL_THREAD_DETACH&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;&lt;code&gt;DLL_PROCESS_DETACH&lt;/code&gt; &lt;/li&gt;
&lt;/ul&gt;
Describing each of these parameters in detail is beyond the scope of this paper, so I simply refer you to &lt;a href=&quot;http://msdn.microsoft.com/&quot; target=&quot;_blank&quot;&gt;Microsoft&#39;s Developer Network&lt;/a&gt; to read more about this function.&lt;br /&gt;


Anyhow, we could save the &lt;code&gt;hModule&lt;/code&gt; parameter for later use in our extension (if this suites us) and simply return &lt;code&gt;TRUE&lt;/code&gt; from this function. We usually do not have anything to do in this function, while developing an extension!&lt;br /&gt;


&lt;h3&gt;
GetExtensionVersion, the actual entry point&lt;/h3&gt;
This function is actually the first entry point that is called by IIS
 to determine the information about the extension. To understand this 
better, let&#39;s have a look at it&#39;s prototype:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain3&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/1432/What-is-an-ISAPI-Extension#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre3&quot; style=&quot;margin-top: 0px;&quot;&gt;BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer);&lt;/pre&gt;
Upon the activation of this function, we are supposed to fill out the extension information within the &lt;code&gt;pVer&lt;/code&gt; parameter passed to the function. This pointer is of type &lt;code&gt;HSE_VERSION_INFO&lt;/code&gt; that is declared as follows:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain4&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/1432/What-is-an-ISAPI-Extension#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre4&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;struct&lt;/span&gt; _HSE_VERSION_INFO
{
   DWORD dwExtensionVersion;
   CHAR lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN];
}HSE_VERSION_INFO, *LPHSE_VERSION_INFO;&lt;/pre&gt;
where &lt;code&gt;dwExtensionVersion&lt;/code&gt; is the extension version and &lt;code&gt;lpszExtensionDescription&lt;/code&gt; is the description of the extension. If we return &lt;code&gt;TRUE&lt;/code&gt; from this function, we notify IIS that our extension is ready to be used. Otherwise, IIS will not use the extension.&lt;br /&gt;


&lt;h3&gt;
HttpExtensionProc, the main entry point&lt;/h3&gt;
The amazing part of any ISAPI extension starts when the extension procedure (&lt;code&gt;HttpExtensionProc&lt;/code&gt;)
 is called. As far as you could remember, this is the procedure that 
makes writing data back to the client possible! To see how this happens,
 lets start by having a look at the prototype of &lt;code&gt;HttpExtensionProc&lt;/code&gt;:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain5&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/1432/What-is-an-ISAPI-Extension#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre5&quot; style=&quot;margin-top: 0px;&quot;&gt;DWORD WINAPI HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB);&lt;/pre&gt;
where &lt;code&gt;pECB&lt;/code&gt; is a pointer to an extension control block, 
that makes the intercommunication between the server and the extension 
possible. You decide what the web page should contain and how to present
 it to the user in this entry point. But how?&lt;br /&gt;


Do you recall the members of the ECB&#39;s structure? ECB contains a method, prototyped as follows:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain6&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/1432/What-is-an-ISAPI-Extension#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre6&quot; style=&quot;margin-top: 0px;&quot;&gt;BOOL WriteClient(HCONN ConnID, LPVOID Buffer, LPDWORD lpdwBytes, 
                                                        DWORD dwSync);&lt;/pre&gt;
Using this member function, you can send the data present in the given &lt;code&gt;Buffer&lt;/code&gt; to the client that is identified by its &lt;code&gt;ConnID&lt;/code&gt;, the one that made the request. For example, to send &lt;strong&gt;A BIG RED ROSE&lt;/strong&gt; to a client, you could simply make the following calls:&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain7&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/1432/What-is-an-ISAPI-Extension#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre7&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;char&lt;/span&gt; szBigRedRos[] = 
  &lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;&amp;lt;font color=&#39;#FF0000&#39; size=&#39;3&#39;&amp;gt;&amp;lt;b&amp;gt;A BIG RED ROSE&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;&quot;&lt;/span&gt;;
DWORD dwSize = strlen(szBigRedRos);
pECB-&amp;gt;WriteClient(pECB-&amp;gt;ConnID, szBigRedRose, dwSize, &lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;);&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ISAPI filters are DLL files that can be 
used to modify and enhance the functionality provided by IIS. ISAPI 
filters always run on an IIS server, filtering every request until they 
find one they need to process. The ability to examine and modify both 
incoming and outgoing streams of data makes ISAPI filters powerful and 
flexible.&lt;br /&gt;
Filters are registered at either the site level or the 
global level (that is, global filters apply to all sites on the IIS 
server), and are initialized when the worker process is started. A 
filter listens to all requests to the site on which it is installed.&lt;br /&gt;
Both
 ISAPI filters and ISAPI extensions can only be developed using C/C++. 
Visual Studio comes with wizards that make ISAPI development fast and 
easy. &lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;
&lt;div&gt;
&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;http://www.blogger.com/null&quot; title=&quot;Click to collapse. Double-click to collapse all.&quot;&gt;&lt;span class=&quot;cl_CollapsibleArea_expanding LW_CollapsibleArea_Img&quot;&gt;&lt;/span&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Possible Uses for ISAPI Filters&lt;/span&gt;&lt;/a&gt;&lt;div class=&quot;LW_CollapsibleArea_HrDiv&quot;&gt;
&lt;hr class=&quot;LW_CollapsibleArea_Hr&quot; /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;sectionblock&quot;&gt;
ISAPI
 filters can be registered with IIS to modify the behavior of a server. 
For example, filters can perform the following tasks:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Change request data (URLs or headers) sent by the client&lt;/li&gt;
&lt;li&gt;Control which physical file gets mapped to the URL&lt;/li&gt;
&lt;li&gt;Control the user name and password used with anonymous or basic authentication&lt;/li&gt;
&lt;li&gt;Modify or analyze a request after authentication is complete&lt;/li&gt;
&lt;li&gt;Modify a response going back to the client&lt;/li&gt;
&lt;li&gt;Run custom processing on &quot;access denied&quot; responses&lt;/li&gt;
&lt;li&gt;Run processing when a request is complete&lt;/li&gt;
&lt;li&gt;Run processing when a connection with the client is closed&lt;/li&gt;
&lt;li&gt;Perform special logging or traffic analysis.&lt;/li&gt;
&lt;li&gt;Perform custom authentication.&lt;/li&gt;
&lt;li&gt;Handle encryption and compression.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;alert&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;&lt;img alt=&quot;Note&quot; class=&quot;cl_IC101471&quot; id=&quot;alert_note&quot; src=&quot;http://i.msdn.microsoft.com/areas/global/content/clear.gif&quot; title=&quot;Note&quot; /&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;ISAPI filter DLLs cannot be requested explicitly, like ISAPI extensions can.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;
&lt;div&gt;
&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;http://www.blogger.com/null&quot; title=&quot;Click to collapse. Double-click to collapse all.&quot;&gt;&lt;span class=&quot;cl_CollapsibleArea_expanding LW_CollapsibleArea_Img&quot;&gt;&lt;/span&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;ISAPI Filter Processing Sequence&lt;/span&gt;&lt;/a&gt;&lt;div class=&quot;LW_CollapsibleArea_HrDiv&quot;&gt;
&lt;hr class=&quot;LW_CollapsibleArea_Hr&quot; /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
Every ISAPI filter is contained in a separate DLL that must export two entry-point functions, &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms525465%28v=vs.90%29.aspx&quot; target=&quot;_blank&quot;&gt;GetFilterVersion&lt;/a&gt;and &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms525878%28v=vs.90%29.aspx&quot; target=&quot;_blank&quot;&gt;HttpFilterProc&lt;/a&gt;, and optionally export the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms525148%28v=vs.90%29.aspx&quot; target=&quot;_blank&quot;&gt;TerminateFilter&lt;/a&gt; function. The metabase property, &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms524730%28v=vs.90%29.aspx&quot; target=&quot;_blank&quot;&gt;FilterLoadOrder&lt;/a&gt;, contains a list of all filters that IIS loads when the Web service is started.&lt;br /&gt;
&lt;h3 class=&quot;procedureSubHeading&quot;&gt;
The following steps outline the interaction between ISAPI filters and IIS:&lt;/h3&gt;
&lt;div class=&quot;subSection&quot;&gt;
&lt;ol&gt;
&lt;li&gt;When IIS initially loads an ISAPI filter, it also creates and partially populates an &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms525822%28v=vs.90%29.aspx&quot; target=&quot;_blank&quot;&gt;HTTP_FILTER_VERSION&lt;/a&gt; structure. It then calls the filter&#39;s &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms525465%28v=vs.90%29.aspx&quot; target=&quot;_blank&quot;&gt;GetFilterVersion&lt;/a&gt; function, passing a pointer to the new structure as a parameter.&lt;/li&gt;
&lt;li&gt;The ISAPI filter populates the &lt;strong&gt;HTTP_FILTER_VERSION&lt;/strong&gt; structure with version information and descriptive information. More importantly, the filter also uses &lt;strong&gt;HTTP_FILTER_VERSION&lt;/strong&gt;
 to specify which event notifications it should receive, and to declare 
the general priority level for the filter. In addition, the filter also 
indicates whether it is interested in events from secure ports only, 
unsecure ports only, or both.&lt;/li&gt;
&lt;li&gt;Each HTTP transaction 
between IIS and a client browser triggers several distinct events. Every
 time an event occurs for which an ISAPI filter is registered, IIS calls
 the filter&#39;s &lt;strong&gt;HttpFilterProc&lt;/strong&gt; entry-point function. &lt;br /&gt;
If
 more than one ISAPI filter is registered for a given event, IIS 
notifies the filters that the event occurred. The filters, which are 
marked as high, medium, or low priority, are notified according to 
priority in descending order. If more than one ISAPI filter is declared 
the same general priority level, IIS uses the order in which the filters
 appear in the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms524730%28v=vs.90%29.aspx&quot; target=&quot;_blank&quot;&gt;FilterLoadOrder&lt;/a&gt; property to resolve the tie.&lt;/li&gt;
&lt;li&gt;The ISAPI filter uses the notification type information, passed by IIS as a parameter to &lt;strong&gt;HttpFilterProc&lt;/strong&gt;, to determine which particular data structure is pointed to by the other &lt;strong&gt;HttpFilterProc&lt;/strong&gt; parameter, &lt;span class=&quot;parameter&quot;&gt;pvNotification&lt;/span&gt;. The ISAPI filter then uses the data contained in that data structure, as well as in the context structure &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms524517%28v=vs.90%29.aspx&quot; target=&quot;_blank&quot;&gt;HTTP_FILTER_CONTEXT&lt;/a&gt;, to perform any custom processing.&lt;/li&gt;
&lt;li&gt;Once
 processing is complete, the filter returns one of the SF_STATUS status 
codes to IIS, and IIS continues processing the HTTP request or response 
until another event occurs for which ISAPI filters are registered.&lt;/li&gt;
&lt;li&gt;When the Web service is stopped or unloaded, IIS calls &lt;strong&gt;TerminateFilter&lt;/strong&gt; in all ISAPI filters as part of its shutdown sequence, for any filters that implemented and exported the function. &lt;strong&gt;TerminateFilter&lt;/strong&gt; is typically used to perform cleanup and de-allocation of allocated resources.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;strong&gt;GetFilterVersion&lt;/strong&gt;
 is called exactly once, when the ISAPI filter is initially loaded. Any 
per-connection initializations the developer wants to perform must be 
managed internally within the context of the &lt;strong&gt;HttpFilterProc&lt;/strong&gt; function call.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/796971830978732455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2013/10/explain-about-isapi-dll-and-isapi-filter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/796971830978732455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/796971830978732455'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2013/10/explain-about-isapi-dll-and-isapi-filter.html' title='Explain about ISAPI DLL and ISAPI Filter '/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-4129824603214412221</id><published>2013-10-08T02:04:00.005-07:00</published><updated>2013-10-08T02:04:59.940-07:00</updated><title type='text'>Explain  about IEnumerable Interface  and yield Keyword</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;
Introduction&lt;/h2&gt;
In this article we will discuss about the &lt;code&gt;IEnumerable&lt;/code&gt; interface. We will discuss how &lt;code&gt;IEnumerable
&lt;/code&gt;interface facilitate the use of &lt;code&gt;foreach &lt;/code&gt;statement to iterate through a set of data. We will then look how to implement our own collections that implement &lt;code&gt;IEnumerable &lt;/code&gt;interface. The use of yield keyword and
Enumerating generic collections will also be discussed in this article.&lt;br /&gt;


&lt;h2&gt;
Background&amp;nbsp;&lt;/h2&gt;
Whenever we work with collection of objects, we might find ourselves 
in need to iterate the collection. The best way to iterate through a 
collection is by implementing the Iterator pattern. (refer: Understanding and Implementing the Iterator Pattern in C# and C++[&lt;a href=&quot;http://www.codeproject.com/Articles/362986/Understanding-and-Implementing-the-Iterator-Patter&quot; target=&quot;_blank&quot; title=&quot;New Window&quot;&gt;^&lt;/a&gt;]). C# provides a very clean construct of &lt;code&gt;foreach &lt;/code&gt;statement to iterate in a read only manner over a collection. &lt;br /&gt;


C# also provides us the possibility of using the same &lt;code&gt;foreach &lt;/code&gt;construct and all the enumeration techniques 
on our custom collection objects by implementing the IEnumerable interface. So let us see how we can implement &lt;code&gt;IEnumerable &lt;/code&gt;interface with our custom collection classes.&lt;br /&gt;


&lt;h2&gt;
Using the code&lt;/h2&gt;
&lt;h3&gt;
Enumerating the Collection classes&lt;/h3&gt;
Before starting the discussion let us see how we can use the Built-in
 classes and iterate over them. Lets start by looking into the &lt;code&gt;ArrayList &lt;/code&gt;class that implements &lt;code&gt;IEnumerable &lt;/code&gt;and see how we can have read only iteration
over that using &lt;code&gt;foreach &lt;/code&gt;statement.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain0&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/474678/A-Beginners-Tutorial-on-Implementing-IEnumerable-I#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre0&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Let us first see how we can enumerate an object implementing IEnumerable
&lt;/span&gt;ArrayList list = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; ArrayList();

list.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;1&quot;&lt;/span&gt;);
list.Add(&lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;);
list.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;3&quot;&lt;/span&gt;);
list.Add(&lt;span class=&quot;code-string&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;4&#39;&lt;/span&gt;);

&lt;span class=&quot;code-keyword&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;object&lt;/span&gt; s &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; list)
{
    Console.WriteLine(s);
}
&lt;/pre&gt;
&lt;h3&gt;
Enumerating the Generic Collection classes&lt;/h3&gt;
The &lt;code&gt;Arraylist &lt;/code&gt;class is a generalized class that let us 
keep a collection. We can also have a generic class in which we can 
provide the type along with the data. Iterating over generic collection 
classes is also possible because they implement&lt;code&gt; IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; interface. Lets see how we can enumerate over a generic collection. &lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain1&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/474678/A-Beginners-Tutorial-on-Implementing-IEnumerable-I#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre1&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Let us first see how we can enumerate an object implementing IEnumerable&amp;lt;T&amp;gt;
&lt;/span&gt;List&amp;lt;&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;&amp;gt; listOfStrings = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; List&amp;lt;&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;&amp;gt;();

listOfStrings.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;one&quot;&lt;/span&gt;);
listOfStrings.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;two&quot;&lt;/span&gt;);
listOfStrings.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;three&quot;&lt;/span&gt;);
listOfStrings.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;four&quot;&lt;/span&gt;);

&lt;span class=&quot;code-keyword&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; s &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; listOfStrings)
{
    Console.WriteLine(s);
}
&lt;/pre&gt;
Now our objective is to have our own custom collection class and a generic collection class that should implement the &lt;code&gt;IEnumerable &lt;/code&gt;and &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; interface respectively to provide the possibility
of enumerating over them.&lt;br /&gt;


&lt;h3&gt;
Understanding the yield keyword&lt;/h3&gt;
Before jumping into the Implementation of these classes, we need to understand a very important keyword &lt;code&gt;yield &lt;/code&gt;which actually facilitate the enumeration over collection. yield statement is used while returning a value from a function.&lt;br /&gt;


A normal method call like the one shown below will return only the first value no matter how many times it is called. &lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain2&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/474678/A-Beginners-Tutorial-on-Implementing-IEnumerable-I#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre2&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; SimpleReturn()
{
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-digit&quot;&gt;1&lt;/span&gt;;
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;;
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-digit&quot;&gt;3&lt;/span&gt;;
}

&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Main(&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;[] args)
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Lets see how simeple return works
&lt;/span&gt;    Console.WriteLine(SimpleReturn());
    Console.WriteLine(SimpleReturn());
    Console.WriteLine(SimpleReturn());
    Console.WriteLine(SimpleReturn());
}
&lt;/pre&gt;
The reason for this is that the normal return statement does not 
preserve the state of the function while returning. i.e. every call to 
this function is a new call and it will return the first value only.&lt;br /&gt;


Where as if I replace the return keyword by yield return then the 
function will become capable of saving its state while returning the 
value. i.e. when the function is called second time, it will continue 
the processing from where is has returned in the previous call. &lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain3&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/474678/A-Beginners-Tutorial-on-Implementing-IEnumerable-I#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre3&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; IEnumerable&amp;lt;&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt;&amp;gt; YieldReturn()
{
    &lt;span class=&quot;code-keyword&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-digit&quot;&gt;1&lt;/span&gt;;
    &lt;span class=&quot;code-keyword&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;;
    &lt;span class=&quot;code-keyword&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-digit&quot;&gt;3&lt;/span&gt;;
}
&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Main(&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;[] args)
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Lets see how yield return works
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; i &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; YieldReturn())
    {
        Console.WriteLine(i);
    }
}
&lt;/pre&gt;
When we run the above code it will return 1,2 and then 3. The only catch while using the &lt;code&gt;yield &lt;/code&gt;return statement is that the function should return an &lt;code&gt;IEnumerable &lt;/code&gt;and should be called from an iteration block
i.e. &lt;code&gt;foreach &lt;/code&gt;statement.&lt;br /&gt;


&lt;h3&gt;
Implementing IEnumerable in our custom Collection class&lt;/h3&gt;
Now in our custom collection classes, if we define a function that 
will iterate over all the elements in the collection and return then 
using the &lt;code&gt;yield &lt;/code&gt;keyword, we will be able to get hold of all the elements in the the collection.&lt;br /&gt;


So let us define our own &lt;code&gt;MyArrayList &lt;/code&gt;class and implement &lt;code&gt;IEnumerable &lt;/code&gt;interface, which will force us to implement the &lt;code&gt;GetEnumerator &lt;/code&gt;function. This function will iterate over the collection and do a &lt;code&gt;yield &lt;/code&gt;return on all the elements.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain4&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/474678/A-Beginners-Tutorial-on-Implementing-IEnumerable-I#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre4&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; MyArrayList : IEnumerable
{
    &lt;span class=&quot;code-keyword&quot;&gt;object&lt;/span&gt;[] m_Items = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
    &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; freeIndex = &lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; MyArrayList()
    {
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; For the sake of simplicity lets keep them as arrays
&lt;/span&gt;        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; ideally it should be link list
&lt;/span&gt;        m_Items = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;object&lt;/span&gt;[&lt;span class=&quot;code-digit&quot;&gt;100&lt;/span&gt;];
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Add(&lt;span class=&quot;code-keyword&quot;&gt;object&lt;/span&gt; item)
    {
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Let us only worry about adding the item 
&lt;/span&gt;        m_Items[freeIndex] = item;
        freeIndex++;
    }

    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; IEnumerable Member
&lt;/span&gt;    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; IEnumerator GetEnumerator()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;object&lt;/span&gt; o &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; m_Items)
        {
            &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Lets check for end of list (its bad code since we used arrays)
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt;(o == &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;)
            {
                &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
            }

            &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Return the current element and then on next function call 
&lt;/span&gt;            &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; resume from next element rather than starting all over again;
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; o;
        }
    }
}
&lt;/pre&gt;
This class will now let us enumerate all the elements using a &lt;code&gt;foreach &lt;/code&gt;stemement.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain5&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre id=&quot;pre5&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Main(&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;[] args)
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt;Let us now go ahead and use our custom MyArrayList with IEnumerable implemented
&lt;/span&gt;    MyArrayList myList = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; MyArrayList();

    myList.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;1&quot;&lt;/span&gt;);
    myList.Add(&lt;span class=&quot;code-digit&quot;&gt;2&lt;/span&gt;);
    myList.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;3&quot;&lt;/span&gt;);
    myList.Add(&lt;span class=&quot;code-string&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;4&#39;&lt;/span&gt;);

    &lt;span class=&quot;code-keyword&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;object&lt;/span&gt; s &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; myList)
    {
        Console.WriteLine(s);
    }
}
&lt;/pre&gt;
&lt;strong&gt;Note:&lt;/strong&gt; This class is neither complete not a very good
 implementation. The only purpose of the sample implementation is to 
demonstrate the implementation of &lt;code&gt;IEnumerable &lt;/code&gt;interface.&lt;br /&gt;


&lt;h3&gt;
Implementing IEnumerable&amp;lt;T&amp;gt; in our custom Generic Collection class&lt;/h3&gt;
Let us now take this approach a little further and define a generic 
collection class capable of being enumerated. To do this we need to 
implement &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; interface.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain6&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/474678/A-Beginners-Tutorial-on-Implementing-IEnumerable-I#&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;pre id=&quot;pre6&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;class&lt;/span&gt; MyList&amp;lt;T&amp;gt; : IEnumerable&amp;lt;T&amp;gt;
{
    T[] m_Items = &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;;
    &lt;span class=&quot;code-keyword&quot;&gt;int&lt;/span&gt; freeIndex = &lt;span class=&quot;code-digit&quot;&gt;0&lt;/span&gt;;

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; MyList()
    {
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; For the sake of simplicity lets keep them as arrays
&lt;/span&gt;        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; ideally it should be link list
&lt;/span&gt;        m_Items = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; T[&lt;span class=&quot;code-digit&quot;&gt;100&lt;/span&gt;];
    }

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Add(T item)
    {
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Let us only worry about adding the item 
&lt;/span&gt;        m_Items[freeIndex] = item;
        freeIndex++;
    }

    &lt;span class=&quot;code-preprocessor&quot;&gt;#region&lt;/span&gt; IEnumerable&amp;lt;T&amp;gt; Members

    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; IEnumerator&amp;lt;T&amp;gt; GetEnumerator()
    {
        &lt;span class=&quot;code-keyword&quot;&gt;foreach&lt;/span&gt; (T t &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; m_Items)
        {
            &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Lets check for end of list (its bad code since we used arrays)
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (t == &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt;) &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; this wont work is T is not a nullable type
&lt;/span&gt;            {
                &lt;span class=&quot;code-keyword&quot;&gt;break&lt;/span&gt;;
            }

            &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Return the current element and then on next function call 
&lt;/span&gt;            &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; resume from next element rather than starting all over again;
&lt;/span&gt;            &lt;span class=&quot;code-keyword&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; t;
        }
    }

    &lt;span class=&quot;code-preprocessor&quot;&gt;#endregion&lt;/span&gt;

    &lt;span class=&quot;code-preprocessor&quot;&gt;#region&lt;/span&gt; IEnumerable Members

    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
    {
        &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Lets call the generic version here
&lt;/span&gt;        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt;.GetEnumerator();
    }

    &lt;span class=&quot;code-preprocessor&quot;&gt;#endregion&lt;/span&gt;
}

&lt;/pre&gt;
This class will now let us enumrate all the elements using a &lt;code&gt;foreach &lt;/code&gt;stemement.&lt;br /&gt;


&lt;div class=&quot;pre-action-link&quot; id=&quot;premain7&quot; style=&quot;display: block;&quot; width=&quot;100%&quot;&gt;
&lt;span&gt;|&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;pre id=&quot;pre7&quot; lang=&quot;cs&quot; style=&quot;margin-top: 0px;&quot;&gt;&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;void&lt;/span&gt; Main(&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;[] args)
{
    &lt;span class=&quot;code-comment&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot;&gt; Let us first see how we can enumerate an custom MyList&amp;lt;t&amp;gt; class implementing IEnumerable&amp;lt;T&amp;gt;
&lt;/span&gt;    MyList&amp;lt;&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;&amp;gt; myListOfStrings = &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; MyList&amp;lt;&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt;&amp;gt;();

    myListOfStrings.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;one&quot;&lt;/span&gt;);
    myListOfStrings.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;two&quot;&lt;/span&gt;);
    myListOfStrings.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;three&quot;&lt;/span&gt;);
    myListOfStrings.Add(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;four&quot;&lt;/span&gt;);

    &lt;span class=&quot;code-keyword&quot;&gt;foreach&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;string&lt;/span&gt; s &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; myListOfStrings)
    {
        Console.WriteLine(s);
    }
}
&lt;span class=&quot;code-keyword&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
So now we have a collection class and a generic collectio class that implement &lt;code&gt;IEnumerable &lt;/code&gt;and
&lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; respectively. Althogh These class is neither complete not a very good implementation but
they do serve the purpose of the article i.e. to demonstrate the implementation of &lt;code&gt;IEnumerable &lt;/code&gt;interface.&lt;br /&gt;


&lt;h2&gt;
Point of interest&lt;/h2&gt;
What we have tried to do in this article is see how can we implement the &lt;code&gt;IEnumerable&lt;/code&gt; and&lt;code&gt; IEnumberable&amp;lt;T&amp;gt;&lt;/code&gt;
 
interface. We have looked into the significance of yield keyword. This 
stuff is known to most experienced C# programmers but the beginners 
might find it useful. I hope this has been informative.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/4129824603214412221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2013/10/explain-about-ienumerable-interface-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/4129824603214412221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/4129824603214412221'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2013/10/explain-about-ienumerable-interface-and.html' title='Explain  about IEnumerable Interface  and yield Keyword'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-1850025490159771106</id><published>2013-10-08T00:22:00.004-07:00</published><updated>2013-10-08T00:22:55.101-07:00</updated><title type='text'>Explain about CTE and Temp Table and Table Variable</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Temp Table or Table variable or CTE are commonly 
used for storing data temporarily in SQL Server. In this article, you 
will learn the differences among these three.

&lt;br /&gt;
&lt;h2&gt;
CTE&lt;/h2&gt;
CTE stands for Common Table expressions. It was introduced with SQL 
Server 2005. It is a temporary result set and typically it may be a 
result of complex sub-query. Unlike temporary table its life is limited 
to the current query. It is defined by using WITH statement. CTE 
improves readability and ease in maintenance of complex queries and 
sub-queries. Always begin CTE with semicolon.&lt;br /&gt;

&lt;h3&gt;
A sub query without CTE is given below :&lt;/h3&gt;
&lt;pre class=&quot;prettyprint lang-sql linenums&quot;&gt;&lt;ol class=&quot;linenums&quot;&gt;
&lt;li class=&quot;L0&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Addr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Address&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Emp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Emp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Age &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;From&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Address Addr&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Inner&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Employee Emp &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Emp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;EID &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Addr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;EID&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Temp&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;WHERE&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Temp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Age &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;ORDER&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;BY&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Temp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;NAME&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;h3&gt;
By using CTE above query can be re-written as follows :&lt;/h3&gt;
&lt;pre class=&quot;prettyprint lang-sql linenums&quot;&gt;&lt;ol class=&quot;linenums&quot;&gt;
&lt;li class=&quot;L0&quot;&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;With&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; CTE1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Address&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Age&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;--Column names for CTE, which are optional&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;AS&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot;&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Addr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Address&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Emp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Emp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Age &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Address Addr&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;INNER&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;JOIN&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; EMP Emp &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ON&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Emp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;EID &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Addr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;EID&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot;&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; CTE1 &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;--Using CTE &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L7&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;WHERE&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; CTE1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Age &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L8&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;ORDER&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;BY&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; CTE1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;NAME&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;h3&gt;
When to use CTE&lt;/h3&gt;
&lt;ol class=&quot;orderlist&quot;&gt;
&lt;li&gt;This is used to store result of a complex sub query for further use.&lt;/li&gt;
&lt;li&gt;This is also used to create a recursive query.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
Temporary Tables&lt;/h2&gt;
In SQL Server, temporary tables are created at run-time and you can 
do all the operations which you can do on a normal table. These tables 
are created inside Tempdb database. Based on the scope and behavior 
temporary tables are of two types as given below-&lt;br /&gt;

&lt;ol class=&quot;orderlist&quot;&gt;
&lt;li&gt;&lt;h3&gt;
Local Temp Table&lt;/h3&gt;
Local temp tables are only available to the SQL Server session or 
connection (means single user) that created the tables. These are 
automatically deleted when the session that created the tables has been 
closed. Local temporary table name is stared with single hash (&quot;#&quot;) 
sign.&lt;br /&gt;

&lt;pre class=&quot;prettyprint lang-sql linenums&quot;&gt;&lt;ol class=&quot;linenums&quot;&gt;
&lt;li class=&quot;L0&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;CREATE&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;TABLE&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;LocalTemp&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot;&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot;&gt;&lt;span class=&quot;pln&quot;&gt; UserID int&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot;&gt;&lt;span class=&quot;pln&quot;&gt; Name varchar&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot;&gt;&lt;span class=&quot;pln&quot;&gt; Address varchar&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot;&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot;&gt;&lt;span class=&quot;pln&quot;&gt;GO&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L7&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;into&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;LocalTemp &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Shailendra&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Noida&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L8&quot;&gt;&lt;span class=&quot;pln&quot;&gt;GO&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L9&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;LocalTemp&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/sqlserver/cte.png&quot; /&gt;
&lt;/div&gt;
The scope of Local temp table exist to the current session of current
 user means to the current query window. If you will close the current 
query window or open a new query window and will try to find above 
created temp table, it will give you the error.&lt;br /&gt;

&lt;/li&gt;
&lt;li&gt;&lt;h3&gt;
Global Temp Table&lt;/h3&gt;
Global temp tables are available to all SQL Server sessions or 
connections (means all the user). These can be created by any SQL Server
 connection user and these are automatically deleted when all the SQL 
Server connections have been closed. Global temporary table name is 
stared with double hash (&quot;##&quot;) sign.&lt;br /&gt;

&lt;pre class=&quot;prettyprint lang-sql linenums&quot;&gt;&lt;ol class=&quot;linenums&quot;&gt;
&lt;li class=&quot;L0&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;CREATE&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;TABLE&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;##&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;GlobalTemp&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot;&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot;&gt;&lt;span class=&quot;pln&quot;&gt; UserID int&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot;&gt;&lt;span class=&quot;pln&quot;&gt; Name varchar&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot;&gt;&lt;span class=&quot;pln&quot;&gt; Address varchar&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;150&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot;&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot;&gt;&lt;span class=&quot;pln&quot;&gt;GO&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L7&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;into&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;##&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;GlobalTemp &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Shailendra&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;Noida&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L8&quot;&gt;&lt;span class=&quot;pln&quot;&gt;GO&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L9&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;##&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;GlobalTemp&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L0&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;img class=&quot;img&quot; contextmenu=&quot;return false;&quot; src=&quot;http://www.dotnet-tricks.com/Content/images/sqlserver/cte.png&quot; /&gt;
&lt;/div&gt;
Global temporary tables are visible to all SQL Server connections 
while Local temporary tables are visible to only current SQL Server 
connection.&lt;br /&gt;

&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
Table Variable&lt;/h2&gt;
This acts like a variable and exists for a particular batch of query 
execution. It gets dropped once it comes out of batch. This is also 
created in the Tempdb database but not the memory. This also allows you 
to create primary key, identity at the time of Table variable 
declaration but not non-clustered index.&lt;br /&gt;

&lt;pre class=&quot;prettyprint lang-sql linenums&quot;&gt;&lt;ol class=&quot;linenums&quot;&gt;
&lt;li class=&quot;L0&quot;&gt;&lt;span class=&quot;pln&quot;&gt; GO&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;DECLARE&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;TProduct &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;TABLE&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot;&gt;&lt;span class=&quot;pln&quot;&gt; SNo INT &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;IDENTITY&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;),&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot;&gt;&lt;span class=&quot;pln&quot;&gt; ProductID INT&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot;&gt;&lt;span class=&quot;pln&quot;&gt; Qty INT&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L7&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;--Insert data to Table variable @Product &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L8&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;INSERT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;INTO&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;TProduct&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;ProductID&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Qty&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L9&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;SELECT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;DISTINCT&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ProductID&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Qty &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;FROM&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ProductsSales &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ORDER&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;BY&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; ProductID &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;ASC&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L0&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;--Select data&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;TProduct&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;--Next batch&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L4&quot;&gt;&lt;span class=&quot;pln&quot;&gt; GO&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L5&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Select&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;TProduct &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;--gives error in next batch&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L6&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/pre&gt;
&lt;h4&gt;
Note&lt;/h4&gt;
&lt;ol class=&quot;notelist&quot;&gt;
&lt;li&gt;Temp Tables are physically created in the Tempdb database. These 
tables act as the normal table and also can have constraints, index like
 normal tables.&lt;/li&gt;
&lt;li&gt;CTE is a named temporary result set which is used to manipulate 
the complex sub-queries data. This exists for the scope of statement. 
This is created in memory rather than Tempdb database. You cannot create
 any index on CTE.&lt;/li&gt;
&lt;li&gt;Table Variable acts like a variable and exists for a particular 
batch of query execution. It gets dropped once it comes out of batch. 
This is also created in the Tempdb database but not the memory.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/1850025490159771106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2013/10/explain-about-cte-and-temp-table-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/1850025490159771106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/1850025490159771106'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2013/10/explain-about-cte-and-temp-table-and.html' title='Explain about CTE and Temp Table and Table Variable'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8121178714299976765.post-8922433885596438148</id><published>2013-09-20T01:08:00.002-07:00</published><updated>2013-09-20T01:19:03.207-07:00</updated><title type='text'>Explain about COM and Interoperability in DotNet</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;
Introduction&lt;/h2&gt;
Component Object Model is a method to facilitate communication 
between different applications and languages. There are many other ways 
to structure software components. What makes COM interesting is that it 
is a widely accepted interoperability standard. In addition, the 
standard explains the way the memory should be organized for all the 
objects. &lt;br /&gt;
Interfaces are the contract between the client and the server, i.e. 
an interface is the way in which an object exposes its functionality to 
the outside world. In COM, an interface is a table of pointers to 
functions implemented by the object. The table represents the interface,
 and the functions to which it points are the methods of that interface.
 &lt;br /&gt;
&lt;h2&gt;
Creating COM components in .NET&lt;/h2&gt;
Creating COM components in .NET is not that difficult as in C++. The 
following steps explain the way to create the COM server in C#: &lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Create a new Class Library project. &lt;/li&gt;
&lt;li&gt;Create a new interface, say &lt;code&gt;IManagedInterface&lt;/code&gt;, and declare the methods required. Then provide the &lt;code&gt;Guid&lt;/code&gt; (this is the &lt;code&gt;IID&lt;/code&gt;) for the interface using the &lt;code&gt;GuidAttribute&lt;/code&gt; defined in &lt;code&gt;System.Runtime.InteropServices&lt;/code&gt;. The &lt;code&gt;Guid&lt;/code&gt; can be created using the &lt;i&gt;Guidgen.exe&lt;/i&gt;. &lt;code&gt;[Guid(&lt;span class=&quot;code-string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot;&gt;3B515E51-0860-48ae-B49C-05DF356CDF4B&quot;&lt;/span&gt;)]&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;Define a class that implements this interface. Again provide the &lt;code&gt;Guid&lt;/code&gt; (this is the &lt;code&gt;CLSID&lt;/code&gt;) for this class also. &lt;/li&gt;
&lt;li&gt;Mark the assembly as &lt;code&gt;ComVisible&lt;/code&gt;. For this go to &lt;i&gt;AssemblyInfo.cs&lt;/i&gt; file and add the following statement &lt;code&gt;[assembly: ComVisible (&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;)]&lt;/code&gt;. This gives the accessibility of all types within the assembly to COM. &lt;/li&gt;
&lt;li&gt;Build the project. This will generate an assembly in the output path. Now register the assembly using &lt;i&gt;regasm.exe&lt;/i&gt; (a tool provided with the .NET Framework)- &lt;i&gt;regasm \bin\debug\ComInDotNet.dll \tlb:ComInDotNet.tlb&lt;/i&gt; This will create a TLB file after registration. &lt;/li&gt;
&lt;li&gt;Alternatively this can be done in the Project properties -&amp;gt; Build -&amp;gt; check the Register for COM interop. &lt;/li&gt;
&lt;/ol&gt;
The COM server is ready. Now a client has to be created. It can be in
 any language. If the client is .NET, just add the above created COM 
assembly as reference and use it.&lt;br /&gt;
&lt;br /&gt;
The following steps explain the method to create an unmanaged client. Here the client is in VC++ 6.0. &lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Create an MFC AppWizard EXE using the wizard in MSDEV 6.0. &lt;/li&gt;
&lt;li&gt;Import the COM server (TLB file generated by &lt;i&gt;regasm.exe&lt;/i&gt;) using the &lt;code&gt;&lt;span class=&quot;code-preprocessor&quot;&gt;#import&lt;/span&gt;&lt;/code&gt; directive. &lt;code&gt;&lt;span class=&quot;code-preprocessor&quot;&gt;#import&lt;/span&gt; “ComInDotNet.tlb” no_namespace named_guids raw_interfaces_only&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;Now the COM library should be loaded using the &lt;code&gt;CoInitialize&lt;/code&gt; and component can be created using &lt;code&gt;CoCreateInstance&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;Next the methods defined in the COM Server can be invoked. &lt;code&gt;pInterface-&lt;span class=&quot;code-keyword&quot;&gt;&amp;gt;&lt;/span&gt;Execute(“blah blah blah”); &amp;nbsp; &amp;nbsp;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;u&gt;&lt;b&gt;What is COM?&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;Microsoft COM (Component Object Model) technology in the Microsoft 
Windows-family of Operating Systems enables software components to 
communicate. COM is used by developers to create re-usable software 
components, link components together to build applications, and take 
advantage of Windows services. COM objects can be created with a variety
 of programming languages. Object-oriented languages, such as C++, 
provide programming mechanisms that simplify the implementation of COM 
objects. The family of COM technologies includes COM+, Distributed COM 
(DCOM) and ActiveX® Controls.&lt;br /&gt;
&lt;br /&gt;
Microsoft provides COM interfaces for many Windows application 
programming interfaces such as Direct Show, Media Foundation, Packaging 
API, Windows Animation Manager, Windows Portable Devices, and Microsoft 
Active Directory (AD).&lt;br /&gt;
&lt;br /&gt;
COM is used in applications such as the Microsoft Office Family of 
products. For example COM OLE technology allows Word documents to 
dynamically link to data in Excel spreadsheets and COM Automation allows
 users to build scripts in their applications to perform repetitive 
tasks or control one application from another.&lt;br /&gt;
What&#39;s new in .NET Framework 3.5 SP1?&lt;br /&gt;
SP1 advances the art of application development &lt;br /&gt;
The new ADO.NET Entity Framework feature in SP1 offers developers a 
model-based paradigm and a rich, standards-based framework for creating 
data-oriented applications shared across multiple applications and 
platforms. The separation of presentation, data, and business logic used
 in concert with a single data model will enable developers to spend 
less time writing plumbing code and more time refining business logic. &lt;br /&gt;
&lt;br /&gt;
SP1 makes data-driven programming easier &lt;br /&gt;
SP1 offers developers support for ASP.NET Dynamic Data, which provides a
 rich scaffolding framework that enables rapid data-driven development. 
Since ASP.NET takes care of creating the presentation layer, a fully 
functional Website is output and ready for customization without the 
developer writing a single line of code. Further, with ADO.NET Data 
Services, Web developers can create RESTful Web 2.0-style applications 
that have better server scalability and improved caching support. &lt;br /&gt;
&lt;br /&gt;
SP1 is the fastest and easiest way to deploy Windows applications &lt;br /&gt;
With the .NET Framework Client Profile, a small subset of the Framework 
that powers client applications, developers can offer their end users a 
dramatically streamlined and rapid application download experience. In 
addition, improvements in SP1 result in dramatic reductions in cold 
start times, allowing developers to serve a broader set of customers 
with varying hardware profiles&lt;h2&gt;
Summary&lt;/h2&gt;
This paper provides the technical overview of .NET and COM 
interoperability. It describes how .NET components can communicate with 
existing COM components without migrating those COM components into .NET
 components, thus helping the migration cost and business systems. This 
paper also provides an overview of marshalling. The intended audience is
 a development team that wishes to interact with COM and .NET 
applications. (This paper assumes that the reader has the fundamental 
knowledge of COM and .NET) &lt;br /&gt;

&lt;h2&gt;
Introduction&lt;/h2&gt;
From the time Microsoft engineers started working on the ideas behind
 COM in 1998, COM went through quite an evolution. Once .NET was 
released everything&amp;nbsp;was about&amp;nbsp;the CLR. Those business systems made lot 
of investments on those COM developments and they may not be willing to 
invest more money to build their components into .NET. Also this will 
make a severe impact in productivity. &lt;br /&gt;

Fortunately, switching from COM to .NET involves no such radical loss
 of productivity. The concept of providing bridge between .NET and COM 
components is .NET-COM interoperability. Microsoft .NET Framework 
provides system, tools, and strategies that enable strong integration 
with past technologies and allow legacy code to be integrated with new 
.NET components. It provides a bridge between the .NET and COM and vice 
versa. &lt;br /&gt;

There are two key concepts that make it much easier to move from COM 
development to .NET development, without any loss of code base or 
productivity.&lt;br /&gt;

&lt;/li&gt;
&lt;li&gt;Interaction with COM components from .NET 
&lt;/li&gt;
&lt;li&gt;Interaction with .NET components from COM &lt;/li&gt;
&lt;/ol&gt;
Before going further, this paper will describe about the basic communication fundamentals of COM and .NET components.&lt;br /&gt;
&lt;h2&gt;
Communication between Object and Client&lt;/h2&gt;
COM is a binary reusable object which exposes its functionality to 
other components. When a client object asks for instances of server 
object, the server instantiates those objects and handout references to 
the client. So, a COM component can act as a binary contract between 
caller and callee. This binary contract is defined in a document known 
as Type library. The Type library describes to a potential client the 
services available from a particular server. Each COM components will 
expose a set of interfaces through which the communication between COM 
components will occurs.&lt;br /&gt;
The following diagram shows the communication between a client and a COM object.&lt;br /&gt;
&lt;img height=&quot;256&quot; src=&quot;http://www.codeproject.com/KB/COM/COM_DOTNET_INTEROP/image001.jpg&quot; width=&quot;576&quot; /&gt;&lt;br /&gt;
&lt;i&gt;Fig.1 Communication between client and a COM object &lt;/i&gt;&lt;br /&gt;
In the above figure the &lt;code&gt;IUnknown &lt;/code&gt;and &lt;code&gt;IDispatch &lt;/code&gt;are the interfaces and &lt;code&gt;QueryInterface&lt;/code&gt;, &lt;code&gt;AddRef&lt;/code&gt;, &lt;code&gt;Release&lt;/code&gt;, etc., are the methods exposed by those interfaces.&lt;br /&gt;
The communication between the .NET objects occurs through Objects, 
there are no such interfaces for communication. So, in .NET component, 
there is no type libraries, instead they deal with assemblies. Assembly 
is a collection of types and resources that are built to work together 
and form a logical unit of functionality. All the information related to
 the assembly will be held in assembly metadata. Unlike the 
communication between COM components, the communication between .NET 
components is Object based.&lt;br /&gt;
&lt;h2&gt;
Calling COM components from .NET Client &lt;/h2&gt;
Generally COM components will expose interfaces to communicate with 
other objects. A .NET client cannot directly communicate with a COM 
component because the interfaces exposed by a COM component may not be 
read by the .NET application. So, to communicate with a COM component, 
the COM component should be wrapped in such a way that the.NET client 
application can understand the COM component. This wrapper is known as 
Runtime Callable Wrapper (RCW). &lt;br /&gt;
The .NET SDK provides Runtime Callable Wrapper (RCW) which wraps the 
COM components and exposes it into to the .NET client application.&lt;br /&gt;
&lt;img height=&quot;298&quot; src=&quot;http://www.codeproject.com/KB/COM/COM_DOTNET_INTEROP/image002.jpg&quot; width=&quot;576&quot; /&gt;&lt;br /&gt;
&lt;i&gt;Fig.2 calling a COM component from .NET client&lt;/i&gt;&lt;br /&gt;
To communicate with a COM component, there should be Runtime Callable
 Wrapper (RCW). RCW can be generated by using VS.NET or by the use of &lt;i&gt;TlbImp.exe&lt;/i&gt; utility. Both the ways will read the type library and uses &lt;code&gt;System.Runtime.InteropServices.TypeLibConverter &lt;/code&gt;class
 to generate the RCW. This class reads the type library and converts 
those descriptions into a wrapper (RCW). After generating the RCW, the 
.NET client should import its namespace. Now the client application can 
call the RCW object as native calls. &lt;br /&gt;
When a client calls a function, the call is transferred to the RCW. 
The RCW internally calls the native COM function coCreateInstance there 
by creating the COM object that it wraps. The RCW converts each call to 
the COM calling convention. Once the object has been created 
successfully, the .NET client application can access the COM objects as 
like native object calls.&lt;br /&gt;
&lt;h2&gt;
Calling .NET components from COM Client&lt;/h2&gt;
When a COM client requests a server, first it searches in the 
registry entry and then the communication starts. Calling a .NET 
component from a COM component is not a trivial exercise. The .NET 
objects communicate through Objects. But the Object based communication 
may not be recognized by the COM clients. So, to communicate with the 
.NET component from the COM component, the .NET component should be 
wrapped in such a way that the COM client can identify this .NET 
component. This wrapper is known as COM Callable Wrapper (CCW). The COM 
Callable Wrapper (CCW) will be used to wrap the .NET components and used
 to interact with the COM clients. &lt;br /&gt;
CCW will be created by the .NET utility &lt;i&gt;RegAsm.exe&lt;/i&gt;. This reads metadata of the .NET component and generates the CCW. This tool will make a registry entry for the .NET components.&lt;br /&gt;
&lt;img height=&quot;267&quot; src=&quot;http://www.codeproject.com/KB/COM/COM_DOTNET_INTEROP/image003.jpg&quot; width=&quot;575&quot; /&gt;&lt;br /&gt;
&lt;i&gt;Fig.3 calling a .NET component from COM client&lt;/i&gt;&lt;br /&gt;
Generally COM client instantiates objects through its native method &lt;code&gt;coCreateInstance&lt;/code&gt;. While interacting with .NET objects, the COM client creates .NET objects by &lt;code&gt;coCreateInstance &lt;/code&gt;through CCW. &lt;br /&gt;
Internally, when &lt;code&gt;coCreateInstance &lt;/code&gt;is called, the call will redirect to the registry entry and the registry will redirect the call to the registered server, &lt;i&gt;mscoree.dll&lt;/i&gt;.
 This mscoree.dll will inspect the requested CLSID and reads the 
registry to find the .NET class and the assembly that contains the class
 and rolls a CCW on that .NET class.&lt;br /&gt;
When a client makes a call to the .NET object, first the call will go
 to CCW. The CCW converts all the native COM types to their .NET 
equivalents and also converts the results back from the .NET to COM.&lt;br /&gt;
&lt;h2&gt;
Programming model comparison of .NET-COM interoperability&lt;/h2&gt;
The following table compares the .NET and COM based component programming models.&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-bottom: medium none; border-collapse: collapse; border-left: medium none; border-right: medium none; border-top: medium none;&quot;&gt;
&lt;tbody&gt;
&lt;tr style=&quot;height: 17.5pt;&quot;&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 190.3pt;&quot; valign=&quot;top&quot; width=&quot;254&quot;&gt;&lt;b&gt;.NET&lt;/b&gt;&lt;/td&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: medium none; border-right: windowtext 1pt solid; border-top: windowtext 1pt solid; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 187.7pt;&quot; valign=&quot;top&quot; width=&quot;250&quot;&gt;&lt;b&gt;COM&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 17.5pt;&quot;&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 190.3pt;&quot; valign=&quot;top&quot; width=&quot;254&quot;&gt;Object based communication&lt;/td&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: medium none; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 187.7pt;&quot; valign=&quot;top&quot; width=&quot;250&quot;&gt;Interface based communication&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 17.5pt;&quot;&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 190.3pt;&quot; valign=&quot;top&quot; width=&quot;254&quot;&gt;Garbage Collector to manage memory&lt;/td&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: medium none; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 187.7pt;&quot; valign=&quot;top&quot; width=&quot;250&quot;&gt;Reference count will be used to manage memory&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 17.5pt;&quot;&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 190.3pt;&quot; valign=&quot;top&quot; width=&quot;254&quot;&gt;Type Standard objects&lt;/td&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: medium none; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 187.7pt;&quot; valign=&quot;top&quot; width=&quot;250&quot;&gt;Binary Standard objects&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 17.5pt;&quot;&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 190.3pt;&quot; valign=&quot;top&quot; width=&quot;254&quot;&gt;Objects are created by normal new operator&lt;/td&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: medium none; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 187.7pt;&quot; valign=&quot;top&quot; width=&quot;250&quot;&gt;Objects are created by &lt;code&gt;coCreateInstance&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 17.5pt;&quot;&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 190.3pt;&quot; valign=&quot;top&quot; width=&quot;254&quot;&gt;Exceptions will be returned&lt;/td&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: medium none; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 187.7pt;&quot; valign=&quot;top&quot; width=&quot;250&quot;&gt;&lt;code&gt;HRESULT&lt;/code&gt; will be returned&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 17.5pt;&quot;&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: windowtext 1pt solid; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 190.3pt;&quot; valign=&quot;top&quot; width=&quot;254&quot;&gt;Object info resides in assembly files &lt;/td&gt;
&lt;td style=&quot;border-bottom: windowtext 1pt solid; border-left: medium none; border-right: windowtext 1pt solid; border-top: medium none; height: 17.5pt; padding-bottom: 0in; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; width: 187.7pt;&quot; valign=&quot;top&quot; width=&quot;250&quot;&gt;Object info resides in Type library&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Before the application starts to communicate, there are some 
technical constraints associated with this. When an object is 
transmitted to a receiver which is in a separate machine/process 
(managed/unmanaged) space, the object may need to undergo a 
transformation according to the native type to make it suitable for use 
by the recipient. That is the object will be converted into a recipient 
readable form. This process of converting an object between types when 
sending it across contexts is known as marshaling. The next section of 
the paper will gives an overview of marshalling in .NET.&lt;br /&gt;
&lt;h2&gt;
.NET Marshalling &lt;/h2&gt;
Thus .NET runtime automatically generates code to translate calls 
between managed code and unmanaged code. While transferring calls 
between these two codes, .NET handles the data type conversion also. 
This technique of automatically binding with the server data type to the
 client data type is known as marshalling. Marshaling occurs between 
managed heap and unmanaged heap. For example, Fig.4 shows a call from 
the .NET client to a COM component. This sample call passes a .NET 
string from the client. The RCW converts this .NET data type into the 
COM compatible data type. In this case COM compatible data type is &lt;code&gt;BSTR&lt;/code&gt;. Thus the RCW converts the .NET string into COM compatible &lt;code&gt;BSTR&lt;/code&gt;. This &lt;code&gt;BSTR &lt;/code&gt;will
 be passed to the object and the required calls will be made. The 
results will be returned to back to the RCW. The RCW converts this COM 
compatible result to .NET native data type.&lt;br /&gt;
&lt;img height=&quot;184&quot; src=&quot;http://www.codeproject.com/KB/COM/COM_DOTNET_INTEROP/image004.jpg&quot; width=&quot;459&quot; /&gt;&lt;br /&gt;
&lt;i&gt;Fig.4 Sample diagram for marshalling&lt;/i&gt;&lt;br /&gt;
Logically the marshalling can be classified into 2 types. &lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Interop marshalling 
&lt;/li&gt;
&lt;li&gt;COM marshalling &lt;/li&gt;
&lt;/ol&gt;
If a call occurs between managed code and unmanaged code with in the 
same apartment, Interop marshaler will play the role. It marshals data 
between managed code and unmanaged code. &lt;br /&gt;
In some scenarios COM component may be running in different apartment
 threads. In those cases i.e., calling between managed code and 
unmanaged code in different apartments or process, both Interop 
marshaler and COM marshaler are involved.&lt;br /&gt;
&lt;h2&gt;
Interop marshaler &lt;/h2&gt;
When the server object is created in the same apartment of client, all data marshaling is handled by Interop marshaling. &lt;br /&gt;
&lt;img height=&quot;152&quot; src=&quot;http://www.codeproject.com/KB/COM/COM_DOTNET_INTEROP/image005.jpg&quot; width=&quot;483&quot; /&gt;&lt;br /&gt;
&lt;i&gt;Fig.5 Sample diagram for same apartment marshalling&lt;/i&gt;&lt;br /&gt;
&lt;h2&gt;
COM marshaler &lt;/h2&gt;
COM marshaling involved whenever the calls between managed code and 
unmanaged code are in different apartments. For eg., when a .NET client 
(with the default apartment settings) communicates with a COM component 
(whichever developed in VB6.0), the communication occurs through proxy 
and stub because both the objects will be running in different apartment
 threads. (The default apartment settings of .NET objects are STA and 
the components which&amp;nbsp;are developed by VB6.0 are STA). Between these two 
different apartments COM marshaling will occurs and with in the 
apartment Interop marshaling will occurs. Fig.6 shows this kind of 
marshaling.&lt;br /&gt;
This kind of different apartment communication will impact the 
performance. The apartment settings of the managed client can be changed
 by changing the STAThreadAttribute / MTAThreadAttribute / 
Thread.ApartmentState property. Both the codes can run in a same 
apartment, by making the managed code’s thread to STA. (If the COM 
component is set as MTA, then cross marshaling will occurs.) &lt;br /&gt;
&lt;h2&gt;
&lt;b&gt;&lt;img height=&quot;131&quot; src=&quot;http://www.codeproject.com/KB/COM/COM_DOTNET_INTEROP/image006.jpg&quot; width=&quot;576&quot; /&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;i&gt;Fig.6 Sample diagram for cross apartment marshalling&lt;/i&gt;&lt;br /&gt;
In the above scenario, the call with in different apartments will 
occur by COM marshaling and the call between managed and unmanaged code 
will occur by Interop marshaling. &lt;br /&gt;
&lt;h2&gt;
Conclusion&lt;/h2&gt;
Thus the communication between .NET applications and COM applications occurs through RCW and CCW.&lt;br /&gt;
As you have seen, COM applications can implement .NET types to 
achieve type compatibility or a .NET type can implement COM interfaces 
to achieve binary compatibility with related coclasses. &lt;br /&gt;
Although the managed clients can interact with the unmanaged objects,
 the managed client expects that the unmanaged object should act exactly
 the same as managed object. &lt;br /&gt;
When developing against the unmanaged component through COM 
interoperability, managed code developers will not be able to use some 
features of .NET like parameterized constructors, static methods, 
inheritance, etc., migrating an existing component or writing a managed 
wrapper will make the component easier to use for managed code 
developers. In some cases, the developer wants to migrate parts of the 
application to .NET so that application can take advantage of the new 
features that the .NET Framework offers. For example, ASP .NET provides 
advanced data binding, browser-dependent user interface generation, and 
improved configuration and deployment. The designer should evaluate when
 the value of bringing these new features in to the application outweigh
 the cost of code migration.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://challlengebrains.blogspot.com/feeds/8922433885596438148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://challlengebrains.blogspot.com/2013/09/explain-about-com-and-interoperability.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/8922433885596438148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8121178714299976765/posts/default/8922433885596438148'/><link rel='alternate' type='text/html' href='http://challlengebrains.blogspot.com/2013/09/explain-about-com-and-interoperability.html' title='Explain about COM and Interoperability in DotNet'/><author><name>Information</name><uri>http://www.blogger.com/profile/18248000776773994915</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry></feed>