<?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-6003197117929244646</id><updated>2025-03-06T05:50:02.629+05:30</updated><category term="JQuery"/><category term="C"/><category term="C#"/><category term="UI Design Best Practices"/><category term="Ajax"/><category term="CSS"/><category term="Database"/><category term="Iframe flash Issue"/><category term="Javascript"/><category term="MVC"/><category term="MYSQL"/><category term="Visual Studio"/><category term="iPad"/><title type='text'>Sharing Info...</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6003197117929244646.post-4132479780204798813</id><published>2013-03-20T09:56:00.000+05:30</published><updated>2013-03-30T15:48:26.354+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="iPad"/><title type='text'>Solution for Jquery click event not working on iPad</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;iPad has a different behavior for non-anchor elements click event.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;It&amp;nbsp;recognizes&amp;nbsp;their&amp;nbsp;first click event as hover. Thus though you have a working click event code, it will look like failing on&amp;nbsp;iPad&amp;nbsp;and it will take your day to find out the solution :)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The solution for this to work is either adding onclick=&quot;&quot; attribute to that element or &quot;cursor:pointer&quot; css property.&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Either of this solution will tell&amp;nbsp;iPad&amp;nbsp;that this element is a clickable area.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Lets check with a sample code:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;So say for an example I have a div element&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;div id=&quot;myDiv&quot; class=&quot;myClass&quot; &amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;I have attached click event to it&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;$(&#39;#myDiv&#39;).live(&#39;click&#39;, onMyDivClicked);&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;and I have below CSS:&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;.myClass&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;{&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;/*some X css properties except cursor:pointer*/&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;.myClass:hover&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;{&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;/*some Y css properties along with cursor:pointer*/&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;}&lt;/span&gt;

&lt;/pre&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b&gt;Solution 1&lt;/b&gt;: Adding onclick=&quot;&quot; to div&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;lt;div id=&quot;myDiv&quot; class=&quot;myClass&quot; onclick=&quot;&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;b&gt;Solution 2&lt;/b&gt;: Adding &quot;cursor:pointer&quot; css property&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Now don&#39;t get confused as you may say that I already have this css&amp;nbsp;property&amp;nbsp;inside my &quot;.myClass:hover&quot; class(which most developers follow)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;But the thing is if you want to fix the iPad problem, you will have to add this property inside &quot;.myClass&quot; as shown below&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;.myClass&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;{&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;/*some X css properties along with cursor:pointer*/&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;.myClass:hover&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;{&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;/*some Y css properties along with cursor:pointer*/&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Georgia, Times New Roman, serif;&quot;&gt;Note: We can not point this behavior as a BUG.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;iPad&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6; font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;nbsp;has introduced it to support websites designed with hover effects.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Georgia, Times New Roman, serif;&quot;&gt;Say for example, there is a website on which you have to hover to navigate to pages. For&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;iPad&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6; font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6; font-family: Georgia, Times New Roman, serif;&quot;&gt;there is no hover effect in&amp;nbsp;reality, as user has to touch/click the element.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6; font-family: Georgia, Times New Roman, serif;&quot;&gt;Thus for non-anchor elements which may require hover effects,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;iPad&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6; font-family: Georgia, Times New Roman, serif;&quot;&gt;&amp;nbsp;t&lt;/span&gt;&lt;span style=&quot;color: #3d85c6; font-family: Georgia, Times New Roman, serif;&quot;&gt;reats the first touch/click as hover.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif; font-size: large;&quot;&gt;Hope to see smile on your face after fixing this issue! :)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/4132479780204798813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2013/03/solution-for-click-event-issue-on-ipad.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/4132479780204798813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/4132479780204798813'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2013/03/solution-for-click-event-issue-on-ipad.html' title='Solution for Jquery click event not working on iPad'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6003197117929244646.post-5943237573216716239</id><published>2012-11-19T09:50:00.001+05:30</published><updated>2013-03-23T21:00:07.887+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><title type='text'>Capturing ‘Lost focus’ or ‘blur’ event for div, li or other non-input elements in Jquery</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: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;I was working on ‘ul-li’ structure in which I wanted to&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;show
2&lt;/span&gt;&lt;sup style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;nd&lt;/sup&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt; li when 1&lt;/span&gt;&lt;sup style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;st&lt;/sup&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt; li is focused and&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;hide it when 1&lt;/span&gt;&lt;sup style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;st&lt;/sup&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
lose focus.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;I tried with ‘focus’ and ‘blur’
events, but ‘blur’ event was not being called for li element. Searching for
answer on internet, I came to know that blur or lost focus event is fired when it’s
an input element!&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;So I went for a work around that uses ‘mouseenter’ and ‘mouseleave’
events for ‘focus’ and ‘blur’ events respectively. This events can be used for ‘li’,
‘a’ as well as ‘div’ elements. IE7, 8, 9, Chrome and Firefox support these
events. Below is the code that I have used.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre&gt;$(&quot;#myFirstLiElement&quot;).mouseenter(function () {
              $(&quot;#mySecondLiElement&quot;).show();
       }).mouseleave(function () {      
              $(&quot;#mySecondLiElement&quot;).hide();
 });
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/5943237573216716239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2012/11/capturing-lost-focus-or-blur-event-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/5943237573216716239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/5943237573216716239'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2012/11/capturing-lost-focus-or-blur-event-for.html' title='Capturing ‘Lost focus’ or ‘blur’ event for div, li or other non-input elements in Jquery'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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-6003197117929244646.post-1561971651082602523</id><published>2012-11-18T12:16:00.000+05:30</published><updated>2013-03-23T21:06:24.707+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><title type='text'>Solution for JQuery dialogs being cached when loading partial views</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #222222; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Yesterday, I was working on Jquery dialog that provides an
application form to edit user details.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #222222; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The issue I was facing was, when I posted updated form and
reopened it, it was still showing the previous details. When I checked
database, the updated details were present!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #222222; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;This was happening with IE versions. Chrome and Firefox were
able to show me updated data on form.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;color: #222222;&quot;&gt;Below is the&amp;nbsp;Jquery&amp;nbsp;code that I was using to render a partial
view in a dialog box.&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre&gt;var requestUrl = &quot;/MyAction/PartialViewResult/&quot;;

$.get(requestUrl, function(){
$(&quot;#dialog-edit-profile&quot;).dialog({
        title: &quot;Edit Profile&quot;,
        autoOpen: false,
        height: 300,
        width: 500,
        modal: true
    });
        $(&#39;# dialog-edit-profile).dialog(&quot;open&quot;);
});
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #222222; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;I looked at the code and was confused why IE is behaving
strange when code is syntactically correct.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #222222; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;I went for solution search on
internet and found a fact that &lt;b&gt;&lt;i&gt;default behavior of IE is to cache the Jquery
dialog content&lt;/i&gt;&lt;/b&gt;!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #222222; font-size: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Considering this fact, I rewrite my code so that each request
for dialog will be a new request. The solution was pretty simple, i.e. to make an &lt;st1:city w:st=&quot;on&quot;&gt;&lt;st1:place w:st=&quot;on&quot;&gt;ajax&lt;/st1:place&gt;&lt;/st1:city&gt; call with “&lt;b&gt;cache: false” &lt;/b&gt;property.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;pre&gt;var requestUrl = &quot;/MyAction/PartialViewResult/&quot;;

$.ajax({
              url: requestUrl,
             &lt;b&gt; cache: false,  &lt;/b&gt; 
              success: function(result) {
                   $(&quot;#dialog-edit-profile&quot;).dialog({
                      title: &quot;Edit Profile&quot;,
                      autoOpen: false,
                      height: 300,
                      width: 500,
                      modal: true
                  });

                  $(&#39;# dialog-edit-profile).dialog(&quot;open&quot;);
              }
});
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; color: #222222; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Post this fix, I tested it on IE &amp;nbsp;7,8,9&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 10pt;&quot;&gt;as well as Chrome and Firefox and all were rendering dialog correctly!&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/1561971651082602523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2012/11/solution-for-jquery-dialogs-being.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/1561971651082602523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/1561971651082602523'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2012/11/solution-for-jquery-dialogs-being.html' title='Solution for JQuery dialogs being cached when loading partial views'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6003197117929244646.post-7553822067817518775</id><published>2012-03-28T11:15:00.000+05:30</published><updated>2012-04-28T20:38:38.957+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MVC"/><title type='text'>Tutorial for Donut Hole Caching - Partial View Caching in MVC</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp;&lt;o:p style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/o:p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7zOKJ3Ypi5bwQTCdNpS08MhZGMQSnykOF6Hb-YUm-BaXsrlA6PoMam8vrCzIE4Ul22d80PMvapWoSRp2hW5wfUeRI8JMgAwr2Wu1nL33fqxdBXhaP27afSOMCkhmqHuYBOuT5_BbJGnw/s1600/Donut.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7zOKJ3Ypi5bwQTCdNpS08MhZGMQSnykOF6Hb-YUm-BaXsrlA6PoMam8vrCzIE4Ul22d80PMvapWoSRp2hW5wfUeRI8JMgAwr2Wu1nL33fqxdBXhaP27afSOMCkhmqHuYBOuT5_BbJGnw/s1600/Donut.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;MVC3 has come up with a great concept of Partial page
caching, also known as ‘Donut Hole Caching’ where entire donut represents your
Main View and the donut hole represents partial view that you would like to
cache.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Most of you might have faced the scenario of rendering HTML
as a partial view. The HTML may be static or dynamic and say you are pulling it
from third party or database. Now, each time going to database or third party
is not feasible considering performance. So the option of caching comes into
picture.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;But, you may have some content on Main View you do not want
to cache. So here is the approach to cache partial content of your main view.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Let me illustrate this with a simple example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGqDvFsUNbk0i6v8-QURCunTGTdC2TKO3nzgARIVjw1VJN19apvfN5fDMO8FN_LAmCmdxesv3pwZSBs134RAauH9WAvxuZz4whj0j4fPIa5q2ErFD3Et_Hjhy4aCAm22Yl1wO8eudxOYU/s1600/DonutCachingUI.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGqDvFsUNbk0i6v8-QURCunTGTdC2TKO3nzgARIVjw1VJN19apvfN5fDMO8FN_LAmCmdxesv3pwZSBs134RAauH9WAvxuZz4whj0j4fPIa5q2ErFD3Et_Hjhy4aCAm22Yl1wO8eudxOYU/s1600/DonutCachingUI.jpg&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;See
above screenshot showing my MVC view. On high level, I have created one view
i.e. ‘Index’ and a partial view i.e. ‘&lt;/span&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;ChildView&lt;/span&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;‘. ChildView
has a content that need to be cached and it is rendered within Index view.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Basic steps of partial caching:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; text-indent: -0.25in;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;move content that need to be cached in a partial
view&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; text-indent: -0.25in;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Create a child action in controller that will
return partial view and attach &lt;/span&gt;&lt;b style=&quot;text-indent: -0.25in;&quot;&gt;OutputCache&lt;/b&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;
attribute to it.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;Write Content (that is going to be cached) &lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;text-indent: -0.25in;&quot;&gt;logic in child action&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;Call this child action from Main View using &lt;/span&gt;&lt;b style=&quot;line-height: 115%;&quot;&gt;Html.Action&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;line-height: 17px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;In my sample example, I created a
Main View a Label with current date time. Refer below image&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibcmZzyHnqjJW2ooR9IwDb8A9bOSQMnbVuyH9dAoEiH43RFRkzB9K5YZAT9oKsJVrSpBa7xjn3QqJSyk2vPY78DabVP0dyDeMT96ZcDDZvF9PrsEBrWdzRqNAQiPP21mStbtiL08RbEbg/s1600/IndexView.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibcmZzyHnqjJW2ooR9IwDb8A9bOSQMnbVuyH9dAoEiH43RFRkzB9K5YZAT9oKsJVrSpBa7xjn3QqJSyk2vPY78DabVP0dyDeMT96ZcDDZvF9PrsEBrWdzRqNAQiPP21mStbtiL08RbEbg/s1600/IndexView.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&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: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/b&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: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;ViewBag.Message&lt;/b&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;in this view will contain Current Date time.&lt;/span&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Also note that I have
added a call to my child action using &amp;nbsp;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: yellow; background-image: initial; background-origin: initial;&quot;&gt;@&lt;/span&gt;Html.Action(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;ChildView&quot;&lt;/span&gt;).&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Then I created a Child View also having a current date time
as shown in below image.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZuYKAoBTKt3FSpMp3Rk0NXgSAq2OWf12HbmiMIClnr4lgSeVCrGpXWmcYOFfA_6M5txCd4zU4kGu7c0kzqyz0yYbcnxsWFMeda0_xMmLTMBJoaqdhqaRm3OAqpB87Hp4dIIfuBuBiLk8/s1600/ChildView.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZuYKAoBTKt3FSpMp3Rk0NXgSAq2OWf12HbmiMIClnr4lgSeVCrGpXWmcYOFfA_6M5txCd4zU4kGu7c0kzqyz0yYbcnxsWFMeda0_xMmLTMBJoaqdhqaRm3OAqpB87Hp4dIIfuBuBiLk8/s1600/ChildView.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .25in;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;ViewBag.Message&lt;/b&gt; in this view will contain Current
Date time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Note that you can use &lt;b&gt;Html.Raw&lt;/b&gt;
if you are returning Html content inside &lt;span style=&quot;line-height: 115%;&quot;&gt;ViewBag.Message&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Then I created two
actions Index and ChildView
for retuning Index View and Child View respectively.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrTVJS1ZuO2zsA2hEJKOWv9R0cLCJhEwhKCio5w6JE9ZWQFaMaoVKhMfCz0OZnq3b05OZVx_Wcz4Rl5QtcSGxvLYMolvntjuLkEacr6M5nFdBWArXjosnjp0JHFSUnDtpAmQBLAoLmN00/s1600/HomeController.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrTVJS1ZuO2zsA2hEJKOWv9R0cLCJhEwhKCio5w6JE9ZWQFaMaoVKhMfCz0OZnq3b05OZVx_Wcz4Rl5QtcSGxvLYMolvntjuLkEacr6M5nFdBWArXjosnjp0JHFSUnDtpAmQBLAoLmN00/s1600/HomeController.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;I have attached &lt;b&gt;ChildActionOnly
&lt;/b&gt;attribute so that action will be available only for internal calls. Also to
cache Child View content, I have attached &lt;b&gt;OutputCache
&lt;/b&gt;attribute with 10 seconds duration.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Now when I will hit the Index view from browser, for the first
time it will internally call ChildView Action and will display Current Date
Time. But within 10 seconds, if I try to re-hit the Index view, then the Current
Date Time in Index view will be updated for each hit (as I have not attached &lt;b&gt;OutputCache &lt;/b&gt;attribute to Index action)
and Current Date Time on Child View will be constant for 10 seconds.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;First hit screenshot&lt;o:p&gt;&lt;/o:p&gt;(Note:Parent and Child Date times are same)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9MxeMGJtgGolrK3shc0UhNc8JMzVEPwxKT-cBPMk_g4zjQN4NJZ4ywTCDsMGEB8Ts502Jns3T_z5_5TAPs1dJBvx6Tdqudxv3AVsHi5iaF-j2pGgZB3S61prnA4aRScGiTfXaqWq8oAI/s1600/FirstHit.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHF54GtI3GgJEs57eRLO6WJkOqcAxoqKNhbER-NiJ-rOpTw-Ywm8OJiKEK239EPJYwnMldK4pYzPOaOVT9x4C4Gy63pNFHcY_HxVqZknB_o40NvzzwwrqcORMDqIBwvjg02FcU4N-S-yg/s1600/FirstHit.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHF54GtI3GgJEs57eRLO6WJkOqcAxoqKNhbER-NiJ-rOpTw-Ywm8OJiKEK239EPJYwnMldK4pYzPOaOVT9x4C4Gy63pNFHcY_HxVqZknB_o40NvzzwwrqcORMDqIBwvjg02FcU4N-S-yg/s1600/FirstHit.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;Second hit screenshot(Note:Parent and Child Date times are different and&amp;nbsp;Child Date time is same as that of First hit&amp;nbsp;Child Date time)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&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;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsVCrvWcYhMSe-jfPb0UXApbR6EBwi9wR3oPaPrA5l99LdhcXeo6xTQWquFA9plcg0GURA853VeRMk0WDxyUC0yCO3vGqM0jSekmj8fcScnhLQHL8SB86Wo9z8QDSVh2V8jX61EUzpUvg/s1600/SecondHit.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsVCrvWcYhMSe-jfPb0UXApbR6EBwi9wR3oPaPrA5l99LdhcXeo6xTQWquFA9plcg0GURA853VeRMk0WDxyUC0yCO3vGqM0jSekmj8fcScnhLQHL8SB86Wo9z8QDSVh2V8jX61EUzpUvg/s1600/SecondHit.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOlYAt3-HYXbeLkV3ALriYYSCyo_tgFHwPvn_0NtcFNjUCGJJ2BkYCpXhj-YedI1iaVubpQ5sKqEmcMjD3I6ianD-Dx3frYXxJz1xYhLhL4FIWMxy_a2As1DMBlRwT-6KTINvyhu63J8I/s1600/SecondHit.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/7553822067817518775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2012/03/donut-hole-caching-partial-view-caching.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/7553822067817518775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/7553822067817518775'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2012/03/donut-hole-caching-partial-view-caching.html' title='Tutorial for Donut Hole Caching - Partial View Caching in MVC'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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/AVvXsEg7zOKJ3Ypi5bwQTCdNpS08MhZGMQSnykOF6Hb-YUm-BaXsrlA6PoMam8vrCzIE4Ul22d80PMvapWoSRp2hW5wfUeRI8JMgAwr2Wu1nL33fqxdBXhaP27afSOMCkhmqHuYBOuT5_BbJGnw/s72-c/Donut.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6003197117929244646.post-3980085831049195189</id><published>2012-03-08T08:11:00.000+05:30</published><updated>2012-04-29T10:46:40.611+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio"/><title type='text'>How to Regenerate Designer file in Visual Studio? Here is the solution-</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Missing or corrupted designer file causes Visual studio
(VS) to fail the build. This is because without designer file VS is unable to
find the declarations of controls. Also most of the time&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;controls are not added to designer.cs giving build errors.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;To fix this issue,&amp;nbsp;Below is the simplest solution I know:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Delete your designer file if it is corrupted else start from step2.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Go to your aspx markup (source) page and find below line of
code. &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; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #fff2cc;&quot;&gt;&amp;lt;%@ Page
Language=&quot;C#&quot; AutoEventWireup=&quot;false&quot; CodeFile=&quot;SamplePage.aspx.cs&quot;
Inherits=&quot; SamplePageClass&quot; %&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-weight: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;Now change &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;CodeFile&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;
tag to &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;CodeBehind.&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;Save the file.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-weight: normal;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: normal;&quot;&gt;Rebuild your project (This will create designer
file for your page)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Revert your change (Step3).&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/3980085831049195189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2012/03/regenerate-designer-file-in-visual.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/3980085831049195189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/3980085831049195189'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2012/03/regenerate-designer-file-in-visual.html' title='How to Regenerate Designer file in Visual Studio? Here is the solution-'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6003197117929244646.post-8225772553856564362</id><published>2011-11-26T13:35:00.001+05:30</published><updated>2011-11-30T07:47:58.567+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Iframe flash Issue"/><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><title type='text'>Prevent iframe white flash issue while loading</title><content type='html'>I had a link on my website. I had written a click event for link to load iframe. But every time I was clicking the link, iframe was taking time to load and thus displaying white flash.&lt;br /&gt;
&lt;br /&gt;
I tried to get help from internet, found many solutions with css and javascript, but they were either complex to implement or unable to solve this problem.&lt;br /&gt;
&lt;br /&gt;
I wonder why I didn&#39;t try&amp;nbsp;anything&amp;nbsp;with JQuery and when I tried, the issue was solved!&lt;br /&gt;
Below is the logic that I followed:&lt;br /&gt;
&lt;br /&gt;
To explain the&amp;nbsp;solution&amp;nbsp;let&#39;s take below as my link and iframe ids.&lt;br /&gt;
my link id: dwnloadDoc&lt;br /&gt;
my iframe id: myiframe&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step1: Write iframe load event in jquery as given below.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
$(&#39;#myiframe&#39;).load(function(){&lt;br /&gt;
$(this).show();&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step2: Hide iframe on link click&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
$(&#39;#dwnloadDoc&#39;).click(function(){
&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
$(&#39;#myiframe&#39;).hide();&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
//link click logic&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
});&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;b&gt;How It worked:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
When I will click the link, my iframe will get hidden. I &amp;nbsp;will bring data from server and will load it in iframe.&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
My iframe load event will get called after iframe is loaded which will show the iframe.&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
That means iframe will be hidden in its loading period, avoiding white flash.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/8225772553856564362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/avoid-iframe-white-flash-issue-while.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/8225772553856564362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/8225772553856564362'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/avoid-iframe-white-flash-issue-while.html' title='Prevent iframe white flash issue while loading'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6003197117929244646.post-8969159491498438565</id><published>2011-11-19T20:30:00.001+05:30</published><updated>2012-04-28T20:19:34.419+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Understanding Boxing and Unboxing in C#</title><content type='html'>&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Boxing is the process of converting a&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;value type&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;to the &lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;type&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;input&quot;&gt;&lt;i&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;object&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;input&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt; Unboxing extracts the &lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;value
type&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt; from the &lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;object&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;. Let’s see how boxing and unboxing works.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;Boxing:&lt;/b&gt; This is an implicit process. That
means developer doesn’t need do any type casting.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;See below line of code:&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #3366ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;int boxingInteger =
123;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;This will create a block on stack memory area
for variable of type int.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;SW1&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 480;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;height: 16.95pt; mso-yfti-firstrow: yes; mso-yfti-irow: -1;&quot;&gt;
  &lt;td style=&quot;background: #D4E799; border: solid windowtext 1.0pt; height: 16.95pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 73.7pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;mso-yfti-cnfc: 5; tab-stops: .25in; text-align: center;&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #993366;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Stack&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 16.9pt; mso-yfti-irow: 0;&quot;&gt;
  &lt;td style=&quot;background: #D4E799; border-top: none; border: solid windowtext 1.0pt; height: 16.9pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 73.7pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 16.9pt; mso-yfti-irow: 1; mso-yfti-lastrow: yes;&quot;&gt;
  &lt;td style=&quot;background: #D4E799; border-top: none; border: solid windowtext 1.0pt; height: 16.9pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 73.7pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;boxingInteger&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Now see below line of code:&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #3366ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;object myObject = boxingInteger;
// boxing&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;This is the step where boxing is occurring.
When above line is executed, two things will occur at backend.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;1.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;An object will be created on heap area that will hold value of &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;i&gt;boxingInteger&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in; mso-list: l0 level1 lfo1; tab-stops: list .5in; text-indent: -.25in;&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;2.&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Reference type &lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;myObject&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt; will
get created that will point to memory area allocate in above step.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Note:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt; It will not affect &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;i&gt;boxingInteger&lt;/i&gt; variable on stack.
The entry on stack will be there after boxing.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyB5XY0Y5F6fBWsSrrI7H3shU6m5XEY_uYMWpRHoi111IF5T_z7X_vMOvG_Ky4sKj-nHKWsa2x-0ILLKem6V9TsUYaO6sDhwRvhJ4Y6INmJDUx-VU5bYY5RAbD9AcBEtYbK68e2FTqLAc/s1600/Heap+Memory+Allocation.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyB5XY0Y5F6fBWsSrrI7H3shU6m5XEY_uYMWpRHoi111IF5T_z7X_vMOvG_Ky4sKj-nHKWsa2x-0ILLKem6V9TsUYaO6sDhwRvhJ4Y6INmJDUx-VU5bYY5RAbD9AcBEtYbK68e2FTqLAc/s400/Heap+Memory+Allocation.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;b&gt;Unboxing:&lt;/b&gt; It is reversing of boxing. But it is
explicit. Developer need to do type casting explicitly. It will type case
object on heap to the value type.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;From above example, &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #3366ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;int unboxingInteger =
(int)myObject;&amp;nbsp; // unboxing&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;It will convert value at my object from object
type to type int and it will assign this value to variable unboxingInteger
which will get created on stack area.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;SW1&quot; style=&quot;border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 480;&quot;&gt;
 &lt;tbody&gt;
&lt;tr style=&quot;height: 16.95pt; mso-yfti-firstrow: yes; mso-yfti-irow: -1;&quot;&gt;
  &lt;td style=&quot;background: #D4E799; border: solid windowtext 1.0pt; height: 16.95pt; mso-border-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 73.7pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;mso-yfti-cnfc: 5; tab-stops: .25in; text-align: center;&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #993366;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Stack&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 16.9pt; mso-yfti-irow: 0;&quot;&gt;
  &lt;td style=&quot;background: #D4E799; border-top: none; border: solid windowtext 1.0pt; height: 16.9pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 73.7pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 16.9pt; mso-yfti-irow: 1;&quot;&gt;
  &lt;td style=&quot;background: #D4E799; border-top: none; border: solid windowtext 1.0pt; height: 16.9pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 73.7pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;unboxingInteger&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr style=&quot;height: 16.9pt; mso-yfti-irow: 2; mso-yfti-lastrow: yes;&quot;&gt;
  &lt;td style=&quot;background: #D4E799; border-top: none; border: solid windowtext 1.0pt; height: 16.9pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 0in 5.4pt 0in 5.4pt; width: 73.7pt;&quot; valign=&quot;top&quot; width=&quot;98&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;boxingInteger&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Myth about Boxing:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Myth&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;: Below code does boxing.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #3366ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;string sMyString = “Box”;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #3366ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;object myObject = &amp;nbsp;&amp;nbsp;sMyString
&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Truth&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;: string is not a value type variable. It is a reference type variable.
So when you are assigning sMyString to myObject, you are just copying
reference. There is no value type to object type conversion is happening here.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;To get depth knowledge check this:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;a href=&quot;http://www.codeguru.com/Csharp/Csharp/cs_syntax/article.php/c5883&quot;&gt;http://www.codeguru.com/Csharp/Csharp/cs_syntax/article.php/c5883&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/8969159491498438565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/boxing-and-unboxing-in-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/8969159491498438565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/8969159491498438565'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/boxing-and-unboxing-in-c.html' title='Understanding Boxing and Unboxing in C#'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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/AVvXsEhyB5XY0Y5F6fBWsSrrI7H3shU6m5XEY_uYMWpRHoi111IF5T_z7X_vMOvG_Ky4sKj-nHKWsa2x-0ILLKem6V9TsUYaO6sDhwRvhJ4Y6INmJDUx-VU5bYY5RAbD9AcBEtYbK68e2FTqLAc/s72-c/Heap+Memory+Allocation.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6003197117929244646.post-5145598110953014974</id><published>2011-11-17T21:28:00.001+05:30</published><updated>2012-03-16T20:14:28.089+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><title type='text'>Difference between const char *p and char *const p</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;const char *p and char *const p &amp;nbsp;both look similar, but are different!&lt;br /&gt;
const char *p -- It is a non constant pointer to constant data. That means the data to which it is pointing can never be changed.&lt;br /&gt;
For example,&lt;br /&gt;
char mychar = &#39;a&#39;;&lt;br /&gt;
const char *p = &amp;amp; mychar;&lt;br /&gt;
*p = &#39;b&#39;; //not possible as value at pointer is constant i.e. &#39;a&#39;&lt;br /&gt;
&lt;br /&gt;
char *const p &amp;nbsp;-- It is a constant pointer to non constant data. That means, this pointer points to address that is constant and thus pointer cannot point to other address.&lt;br /&gt;
For example,&lt;br /&gt;
char mychar = &#39;a&#39;;&lt;br /&gt;
char mychar2 = &#39;z&#39;;&lt;br /&gt;
const char *p = &amp;amp;mychar;&lt;br /&gt;
*p = &#39;b&#39;;&lt;br /&gt;
p = &amp;amp;mychar2; //not possible as you cannot change address value of pointer&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/5145598110953014974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/cdifference-between-const-char-p-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/5145598110953014974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/5145598110953014974'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/cdifference-between-const-char-p-and.html' title='Difference between const char *p and char *const p'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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-6003197117929244646.post-4727896571315366076</id><published>2011-11-12T07:31:00.001+05:30</published><updated>2012-03-16T20:15:10.755+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>What is location.search in javascript?</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;location is an object that provides information about current url.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&quot;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;search&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&quot; is a &lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;property of location object&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt; that gives query portion of the url.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;For example,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;if url is : &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;http://www.sample.com?id=1&amp;amp;qs=5&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;then window.location.search will return &quot;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;?id=1&amp;amp;qs=5&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;You can apply regular expression on this result to get query string&amp;nbsp;parameters in javascript/jquery&amp;nbsp;in case if you don&#39;t want to go with any plugin that reads these values.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/4727896571315366076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/what-is-locationsearch-in-javascript.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/4727896571315366076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/4727896571315366076'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/what-is-locationsearch-in-javascript.html' title='What is location.search in javascript?'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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-6003197117929244646.post-6396213774066138227</id><published>2011-11-05T18:07:00.002+05:30</published><updated>2013-05-04T12:51:27.352+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Update value against the same key in hashtable using C# code</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: Georgia, Times New Roman, serif;&quot;&gt;There are two ways you can add data to your Hashtable as shown below:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;ohashtable[Key1] = Value1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;ohashtable[Key2] =&amp;nbsp;&amp;nbsp;Value2;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;ohashtable[Key3] =&amp;nbsp;Value3;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Or like this:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;ohashtable.Add(Key1,&amp;nbsp;Value1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;ohashtable.Add(Key2,&amp;nbsp;Value2);&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;ohashtable.Add(Key3,&amp;nbsp;Value3);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;There is a difference between these two ways.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Using Add method, you can&#39;t have update the value against existing Key. But you can, if you use the square brackets.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;For example,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;ohashtable.Add(&lt;b&gt;Key1&lt;/b&gt;,&amp;nbsp;Value1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;ohashtable.Add(&lt;b&gt;Key1&lt;/b&gt;,&amp;nbsp;Value2); //this will throw exception at run time&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Whereas,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;ohashtable[&lt;b&gt;Key1&lt;/b&gt;] = Value1;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;ohashtable[&lt;b&gt;Key1&lt;/b&gt;] =&amp;nbsp;&amp;nbsp;Value2; // this will allow the entry in hashtable&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;background-color: white; color: #222222;&quot;&gt;It won&#39;t add a new key but will update the value against the existing key.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/6396213774066138227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/cadd-duplicate-keys-in-hashtable-c-code.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/6396213774066138227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/6396213774066138227'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/cadd-duplicate-keys-in-hashtable-c-code.html' title='Update value against the same key in hashtable using C# code'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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-6003197117929244646.post-3515549575583826545</id><published>2011-11-05T17:28:00.002+05:30</published><updated>2012-03-16T20:15:38.126+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><title type='text'>Difference between malloc and calloc in C</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #222222; font-family: Georgia, &#39;Times New Roman&#39;, serif; font-size: 13px; line-height: 18px;&quot;&gt;Malloc and Calloc are functions provided to allocate memory at run time.Both of these functions return pointer to first block of &amp;nbsp;allocated memory in success and return null in case of failure.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Though their purpose is same,&amp;nbsp;there are few differences between them.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;1.&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;No. of Arguments:&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Both these functions vary in number of arguments they accept.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;void *malloc(size_t size);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;void *calloc(size_t n, size_t size);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;Malloc takes only one argument that describes size of block to be allocated in memory.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;e.g.&amp;nbsp;oPointer = (int *)malloc(sizeof(int) * 2); will allocate size of 4 bytes(size of int is 2 bytes).&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Whereas, Calloc takes two arguments&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;number of blocks and&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;size of each block.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;e.g.&amp;nbsp;oPointer = (int *)calloc(2 ,sizeof(int));&amp;nbsp;will allocate size of 4 bytes(size of int is 2 bytes).&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;2.&amp;nbsp;Default Initialization:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Malloc does not initialize the memory allocated whereas calloc&amp;nbsp;initializes the allocated memory to default (e.g. Zero).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;3. Calculation of memory reuired:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Malloc function does not calculate total memory to be allocated, the argument itself describes the total memory whereas, calloc accepts two argument and internally calculates their product to find total memory to be allocated.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/3515549575583826545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/difference-between-malloc-and-calloc-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/3515549575583826545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/3515549575583826545'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/11/difference-between-malloc-and-calloc-in.html' title='Difference between malloc and calloc in C'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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-6003197117929244646.post-6711671391256831551</id><published>2011-10-30T08:57:00.000+05:30</published><updated>2012-04-28T20:20:25.965+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ajax"/><title type='text'>Script to check error message from ajax call</title><content type='html'>Ajax call captures error message/exception that are thrown on its failure. Below is the way to get that error message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table style=&quot;border: 1 solid black; padding: 10; width: 80%;&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
$.ajax({&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type: &quot;POST&quot;,&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;url: &quot;Sample/Method&quot;,&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dataType:&quot;html&quot;,&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;success:function(response){&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//process response object&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(&quot;Success!!!&quot;);&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;error:function (xhr, ajaxOptions, thrownError){ &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;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(xhr.status); //get error status code &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(thrownError); //get error message&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(xhr.responseText); //get error details&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;});&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
Below is the breif description of these error terms:&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;xhr.status&lt;/b&gt; -- Use this when you have to deal with the error status code, for example session expiration.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;thrownError&lt;/b&gt; -- Use this when you want to display/use error message as it is.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;xhr.responseText&lt;/b&gt; -- Gives you details of error message like cause of error, source of error, etc. Helpful for coders as they come to know cause of error at early stage.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/6711671391256831551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/10/ajaxget-error-message-in-ajax-call.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/6711671391256831551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/6711671391256831551'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/10/ajaxget-error-message-in-ajax-call.html' title='Script to check error message from ajax call'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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-6003197117929244646.post-367298065566094448</id><published>2011-10-27T19:02:00.001+05:30</published><updated>2012-03-16T20:16:09.199+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><title type='text'>Links for learning JQuery</title><content type='html'>Hi...found some good links that will be helpful to learn JQuery and also to&amp;nbsp;improve&amp;nbsp;it. Please have a look at them...&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://jqueryui.com/&quot;&gt;http://jqueryui.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://coding.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/&quot;&gt;http://coding.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/14-helpful-jquery-tricks-notes-and-best-practices/&quot;&gt;http://net.tutsplus.com/tutorials/javascript-ajax/14-helpful-jquery-tricks-notes-and-best-practices/&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/367298065566094448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/10/jquerylinks-for-learning-jquery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/367298065566094448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/367298065566094448'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/10/jquerylinks-for-learning-jquery.html' title='Links for learning JQuery'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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-6003197117929244646.post-7003529537825669477</id><published>2011-10-19T08:26:00.003+05:30</published><updated>2012-03-16T20:18:08.745+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="UI Design Best Practices"/><title type='text'>Best practice for using Html Spacing</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
I was confused with the difference between&amp;nbsp;&lt;code style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-family: Consolas; font-size: 10.5pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;&quot;&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-family: Consolas; font-size: 10.5pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;&quot;&gt;&amp;amp;#160;.&lt;/span&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-size: 10.5pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Calibri, sans-serif; font-size: 15px;&quot;&gt;Found one good point of UI designing. So sharing with you. Please have a look.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
You &amp;nbsp;might have tried to add spaces between two controllers using either&amp;nbsp;&lt;code style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-family: Consolas; font-size: 10.5pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;&quot;&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;or&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-family: Consolas; font-size: 10.5pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;&quot;&gt;&amp;amp;#160;&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;. If you are confused with what to use, here is the difference between two:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;code style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-family: Consolas; font-size: 10.5pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;&quot;&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;is the character entity reference while&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-family: Consolas; font-size: 10.5pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;&quot;&gt;&amp;amp;#160;&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;is the numeric entity reference.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;They are the same except for the fact that the latter does not need another lookup table to find its actual value.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; margin-bottom: 0.0001pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;span class=&quot;apple-style-span&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;So, it’s better if you use&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code style=&quot;font-family: &#39;Courier New&#39;;&quot;&gt;&lt;span style=&quot;background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-color: windowtext; border-bottom-style: none; border-bottom-width: 1pt; border-left-color: windowtext; border-left-style: none; border-left-width: 1pt; border-right-color: windowtext; border-right-style: none; border-right-width: 1pt; border-top-color: windowtext; border-top-style: none; border-top-width: 1pt; color: black; font-family: Consolas; font-size: 10.5pt; padding-bottom: 0in; padding-left: 0in; padding-right: 0in; padding-top: 0in;&quot;&gt;&amp;amp;#160;&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black; font-family: Arial, sans-serif; font-size: 10.5pt;&quot;&gt;. to improve performance!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/7003529537825669477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/10/ui-design-best-practices-difference.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/7003529537825669477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/7003529537825669477'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/10/ui-design-best-practices-difference.html' title='Best practice for using Html Spacing'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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-6003197117929244646.post-4867325392395043059</id><published>2011-09-11T08:57:00.000+05:30</published><updated>2012-03-16T20:18:23.659+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><title type='text'>jquery parseInt() without radix may cause a problem!</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;b&gt;Background:&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;The parseInt() function parses a string and returns an integer.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 12px;&quot;&gt;&lt;b&gt;Syntax:&amp;nbsp;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: 13px;&quot;&gt;parseInt(string, radix)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;reference&quot; style=&quot;background-color: white; border-bottom-color: rgb(195, 195, 195); border-bottom-style: solid; border-bottom-width: 1px; border-collapse: collapse; border-left-color: rgb(195, 195, 195); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(195, 195, 195); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(195, 195, 195); border-top-style: solid; border-top-width: 1px; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th align=&quot;left&quot; style=&quot;background-color: #e5eecc; border-bottom-color: rgb(195, 195, 195); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(195, 195, 195); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(195, 195, 195); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(195, 195, 195); border-top-style: solid; border-top-width: 1px; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px; vertical-align: top;&quot; width=&quot;20%&quot;&gt;Parameter&lt;/th&gt;&lt;th align=&quot;left&quot; style=&quot;background-color: #e5eecc; border-bottom-color: rgb(195, 195, 195); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(195, 195, 195); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(195, 195, 195); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(195, 195, 195); border-top-style: solid; border-top-width: 1px; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px; vertical-align: top;&quot; width=&quot;80%&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(195, 195, 195); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(195, 195, 195); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(195, 195, 195); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(195, 195, 195); border-top-style: solid; border-top-width: 1px; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px; vertical-align: top;&quot;&gt;string&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(195, 195, 195); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(195, 195, 195); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(195, 195, 195); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(195, 195, 195); border-top-style: solid; border-top-width: 1px; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px; vertical-align: top;&quot;&gt;Required. The string to be parsed&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border-bottom-color: rgb(195, 195, 195); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(195, 195, 195); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(195, 195, 195); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(195, 195, 195); border-top-style: solid; border-top-width: 1px; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px; vertical-align: top;&quot;&gt;radix&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(195, 195, 195); border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(195, 195, 195); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(195, 195, 195); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(195, 195, 195); border-top-style: solid; border-top-width: 1px; font-family: verdana, helvetica, arial, sans-serif; font-size: 12px; padding-bottom: 3px; padding-left: 3px; padding-right: 3px; padding-top: 3px; vertical-align: top;&quot;&gt;Optional. A number (from 2 to 36) that represents the numeral system to be used&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;Radix parameter becomes important if your string input starts with 0 or 0x.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;If you are using&amp;nbsp;parseInt(&quot;010&quot;) and expecting output as 10, then you are wrong!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;Because, parseInt at&amp;nbsp;back end&amp;nbsp;will&amp;nbsp;consider any&amp;nbsp;number starting with 0 as octal number so the output of &quot;010&quot; will be 8!&amp;nbsp;Similarly&amp;nbsp;any number starting with 0x will be&amp;nbsp;considered&amp;nbsp;as hex number, e.g.&amp;nbsp;parseInt(&quot;0x10&quot;) will result to 16!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;If you want to get decimal number always then use radix&amp;nbsp;parameter.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;So,&amp;nbsp;parseInt(&quot;010&quot;,10) will tell&amp;nbsp;parseInt to consider &quot;010&quot; as decimal so as to give output as 10.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;Similarly&amp;nbsp;you may use radix as 8 and 16 if you want octal and hex result respectively.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/4867325392395043059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/09/jquery-parseint-without-radix-may-cause.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/4867325392395043059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/4867325392395043059'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/09/jquery-parseint-without-radix-may-cause.html' title='jquery parseInt() without radix may cause a problem!'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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-6003197117929244646.post-34490798324792843</id><published>2011-09-10T09:44:00.000+05:30</published><updated>2012-03-16T20:18:55.372+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database"/><category scheme="http://www.blogger.com/atom/ns#" term="MYSQL"/><title type='text'>Difference between INT and INT(20) in mysql</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; display: block; font-size: 14px; line-height: 25px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 720px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Most of the database coders always have confusion about the difference between INT and INT(20). &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;The &lt;b&gt;&lt;i&gt;myth &lt;/i&gt;&lt;/b&gt;is INT(20) describes the integer of size 20!&lt;br /&gt;
&lt;b&gt;where &lt;/b&gt;the &lt;b&gt;&lt;i&gt;truth &lt;/i&gt;&lt;/b&gt;is, &lt;i&gt;its not the size but the width!&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; display: block; font-size: 14px; line-height: 25px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 720px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;Below article will make it simple to understand.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; display: block; font-size: 14px; line-height: 25px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 720px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;MySQL supports an extension for optionally specifying the display width of integer data types in parentheses following the base keyword for the type.&amp;nbsp;&lt;/span&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;For example,&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #015a84; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; title=&quot;10.2. Numeric Types&quot;&gt;&lt;code class=&quot;literal&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #026789; font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;INT(4)&lt;/span&gt;&lt;/i&gt;&lt;/code&gt;&lt;/a&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;specifies an&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #015a84; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; title=&quot;10.2. Numeric Types&quot;&gt;&lt;code class=&quot;literal&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #026789; font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;INT&lt;/span&gt;&lt;/i&gt;&lt;/code&gt;&lt;/a&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;with a display width of four digits.&lt;/span&gt;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;This optional display width may be used by applications to display integer values having a width less than the width specified for the column by left-padding them with spaces. (That is, this width is present in the metadata returned with result sets. Whether it is used or not is up to the application.)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; display: block; font-size: 14px; line-height: 25px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-width: 720px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;The display width does&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;emphasis&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;em style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #003333; font-size: 14px; font-style: italic; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;not&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;constrain the range of values that can be stored in the column. Nor does it prevent values wider than the column display width from being displayed correctly. For example, a column specified as&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #015a84; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; title=&quot;10.2. Numeric Types&quot;&gt;&lt;code class=&quot;literal&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #026789; font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;SMALLINT(3)&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;has the usual&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.1/en/numeric-types.html&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #015a84; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot; title=&quot;10.2. Numeric Types&quot;&gt;&lt;code class=&quot;literal&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #026789; font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;SMALLINT&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;range of&amp;nbsp;&lt;/span&gt;&lt;code class=&quot;literal&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #026789; font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;-32768&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;to&amp;nbsp;&lt;/span&gt;&lt;code class=&quot;literal&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-repeat: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #026789; font-size: 13px; font-weight: bold; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;32767&lt;/span&gt;&lt;/code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, &#39;Times New Roman&#39;, serif;&quot;&gt;, and values outside the range permitted by three digits are displayed in full using more than three digits.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/34490798324792843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/09/mysql-difference-between-int-and-int20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/34490798324792843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/34490798324792843'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/09/mysql-difference-between-int-and-int20.html' title='Difference between INT and INT(20) in mysql'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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-6003197117929244646.post-5048782489358220987</id><published>2011-09-04T12:51:00.003+05:30</published><updated>2012-03-16T20:20:05.587+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="UI Design Best Practices"/><title type='text'>How To calculate exact width of an element from CSS</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;&lt;b&gt;Background:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;When you specify the width and height properties of an element with CSS, you are just setting the width and height of the content area. In actual case that element is always affected by padding, border and margin.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;b&gt;Example:&amp;nbsp;&lt;/b&gt;Let&#39;s say I have set css for a div as given below:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: red; font-family: &#39;courier new&#39;; font-size: 13px;&quot;&gt;width:250px;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: red; font-family: &#39;courier new&#39;; font-size: 13px;&quot;&gt;padding:10px;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: red; font-family: &#39;courier new&#39;; font-size: 13px;&quot;&gt;border:5px solid gray;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: 13px;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; color: red;&quot;&gt;margin:10px;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;Now,from &lt;i&gt;width&lt;/i&gt; property, it is clear that div consumes 250 pixels. But are we looking at css in a correct way???&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 13px;&quot;&gt;Observe other properties. Padding, border and margin all are consuming few pixels. So what is the full width of a div?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 13px;&quot;&gt;&lt;b&gt;Formula:&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;courier new&#39;; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;b&gt;Total element width = width + left padding + right padding + left border + right border + left margin + right margin&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000; font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;Let&#39;s calculate it in our case:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;b&gt;Total element width = 250 + 10 + 10 + 5 + 5 + 10 + 10 = 300&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000; font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;So in actual case, div will consume 300 pixels and not 250!!!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;Many of us face issues while&amp;nbsp;designing&amp;nbsp;user interface. One of the reason is many times we miss the fact, that we have learned just now.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;Note: You can use below formula to&amp;nbsp;calculate&amp;nbsp;exact height of an element:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, helvetica, arial, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;Total element height = height + top padding + bottom padding + top border + bottom border + top margin + bottom margin&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/5048782489358220987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/09/csshow-to-calculate-exact-width-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/5048782489358220987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/5048782489358220987'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/09/csshow-to-calculate-exact-width-of.html' title='How To calculate exact width of an element from CSS'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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-6003197117929244646.post-1710176461910042974</id><published>2011-09-04T11:59:00.000+05:30</published><updated>2012-04-28T20:21:09.997+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="JQuery"/><title type='text'>Solution to avoid binding Events Multiple times to a particular control using jquery</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Background:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;I created a Popup which is populated when I click a link.Popup has a button&amp;nbsp;to which I have bound a click event that open a new window. I am doing everything using jquery.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Scenario:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;I open Popup 1st time,When I click button a new window gets opened.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;I close and&amp;nbsp;reopen&amp;nbsp;popup(this is 2nd time), now I click button. At this time two window gets opened.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;I close and&amp;nbsp;reopen&amp;nbsp;popup(this is 3rd time), now I click button. At this time three window gets opened.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;What went wrong:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;My code to open popup was correct but what I did wrongly was a minor but a serious mistake.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;I wrote a code of binding event to button, inside the function and I was calling it each time&amp;nbsp;I open a popup!&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;So, basically each time my function was getting called it was binding event to button. That&amp;nbsp;means, button was getting bound multiple times with the same event!&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Solution I applied:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;To handle this case, I moved my event bind function call to the document.ready function.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;That means, each time my button will get rendered, I will bind event as on each rendering &amp;nbsp;button will not retain previous binding.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://swsharinginfo.blogspot.com/feeds/1710176461910042974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://swsharinginfo.blogspot.com/2011/09/jqueryavoid-binding-events-multiple.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/1710176461910042974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6003197117929244646/posts/default/1710176461910042974'/><link rel='alternate' type='text/html' href='http://swsharinginfo.blogspot.com/2011/09/jqueryavoid-binding-events-multiple.html' title='Solution to avoid binding Events Multiple times to a particular control using jquery'/><author><name>Sagar</name><uri>http://www.blogger.com/profile/04480035049725981364</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></feed>