<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="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" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-5835690682756737122</atom:id><lastBuildDate>Wed, 04 Sep 2024 10:07:27 +0000</lastBuildDate><category>Header fix in .net</category><category>How to fix header in repeater control</category><category>asp.net</category><category>c#</category><category>child popup window in asp.net</category><category>databse driven Menu</category><category>delegate</category><category>dynamic menu in asp.net</category><category>fixed header in asp.net</category><category>flip</category><category>flip text</category><category>flip text with CSS</category><category>get control of parent window from child window</category><category>get parent control from child popup</category><category>how to get textbox in jquery</category><category>how to set textbox in jquery</category><category>jquery</category><category>jquery delegate</category><category>jquery live</category><category>live</category><category>menu</category><category>textbox</category><category>textbox jquery</category><category>xml</category><category>xml node</category><title>Technology Curiosity</title><description>all about technology</description><link>http://dynamicsunil.blogspot.com/</link><managingEditor>noreply@blogger.com (Anonymous)</managingEditor><generator>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-2191264773296479328</guid><pubDate>Thu, 07 Mar 2013 11:12:00 +0000</pubDate><atom:updated>2013-03-07T16:43:47.593+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">child popup window in asp.net</category><category domain="http://www.blogger.com/atom/ns#">get control of parent window from child window</category><category domain="http://www.blogger.com/atom/ns#">get parent control from child popup</category><title>How to get parent control id from child popup box in jquery with .net ?</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Today I have got a case study in which I need to open a pop-up box on click of link from my asp.net web page and then I need to close that pop-up window after submit button get clicked.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Isn&#39;t it very simple case and I am sure most of developers definetly gone through this situation once.If you google then you will see lots of ways available to do this.I did the same and found some of options in which only few worked for me which I want to share with you guys.&lt;br /&gt;
Ok, now lets dive into it.&lt;br /&gt;
My web page is using master page and for opening pop-up , I have used &lt;b&gt;IFrame&lt;/b&gt;&amp;nbsp;in &amp;lt;div&amp;gt; tag and for open this pop-up on button click I have used jquery code.&lt;br /&gt;
&lt;br /&gt;
Pop-up window code on web page is :&lt;br /&gt;
&lt;br /&gt;
1.&amp;lt;div id=&quot;divPopup&quot; &amp;nbsp;class=&quot;popupReqCall&quot;&amp;gt;&lt;br /&gt;
2. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;div class=&quot;Close&quot;&amp;nbsp;style=&quot;display: none;&quot;&amp;gt;&lt;br /&gt;
3. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;img src=&quot;images/close.png&quot; border=&quot;none&quot; onclick=&quot;Close()&quot; &amp;nbsp;alt=&quot;X&quot; /&amp;gt;&lt;br /&gt;
4. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/div&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
5. &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;iframe id=&quot;ITestPopup&quot; frameborder=&quot;0&quot; scrolling=&quot;no&quot; align=&quot;top&quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
6.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here , line 1 is used as container of form control page (which contains textboxs and button) and line 2-4 is used as container of close button image with CSS and close() function which will fire on image click.Last but not the least, line 5 is used for holding user control page which will be add dynamically on click of link.&lt;br /&gt;
&lt;br /&gt;
For getting id of parent &amp;lt;div&amp;gt; id and image control , I need to write jquery code which would be -&lt;br /&gt;
&lt;b&gt;var frame = $(&#39;[id$=ITestPopup]&#39;, window.parent.document);&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;var imgClose = $(&#39;.Close&#39;, window.parent.document);&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
That&#39;s it !!&lt;br /&gt;
These are the key lines which we can use in any function which would be called on submit button click.&lt;br /&gt;
Noticiable part in this line is that first parameter is used as id of control,CSS class or any thing which represent that control and second parameter is defined that id of control is on called page i.e, parent page.&lt;br /&gt;
Hope this will help !! Happy Coding..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://dynamicsunil.blogspot.com/2013/03/how-to-get-parent-control-id-from-child.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-2242466357078498803</guid><pubDate>Tue, 05 Mar 2013 07:35:00 +0000</pubDate><atom:updated>2013-03-05T13:06:34.159+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">fixed header in asp.net</category><category domain="http://www.blogger.com/atom/ns#">Header fix in .net</category><category domain="http://www.blogger.com/atom/ns#">How to fix header in repeater control</category><title>How to fix header in repeater control in asp.net ?</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Some time developers need a feature of fixed header to show thousands of data on the web pages.So, this tutorial will show how to fix header of control.Here, control can be repeater , gridview or any control which is using for showing data in asp.net.&lt;br /&gt;
&lt;br /&gt;
For showing data , I am using repeater control and code will be like -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;asp:repeater id=&quot;Repeater1&quot; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;HeaderTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;table id=&quot;table12&quot; width=&quot;505&quot; style=&quot;table-layout: fixed; border:solid 1px black&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;thead&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;tr id=&quot;thead&quot; style=&quot;width: 505px; background-color:#BEBEBE&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td&amp;gt;Name&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td&amp;gt;Mobile No&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td&amp;gt;Address&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/thead&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/HeaderTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;%#DataBinder.Eval(Container.DataItem, &quot;Name&quot;)%&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;td&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;%#DataBinder.Eval(Container.DataItem,&quot;MobileNo&quot;)%&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;%#DataBinder.Eval(Container.DataItem,&quot;Address&quot;)%&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;FooterTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;/FooterTemplate&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;/asp:repeater&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In repeater control, I have design a HTML table which will be used for containing bind data.Thing which should be noticed here is style which is defined in &amp;lt;table&amp;gt; with id &#39;table12&#39;.&lt;br /&gt;
In style , &#39;&lt;b&gt;table-layout&lt;/b&gt;&#39; property is fixed due to which&amp;nbsp;the horizontal layout only depends on the table&#39;s width and the width of the columns, not the contents of the cells.&lt;br /&gt;
Now,give boundry to repeater control , so that,fixed header effect can be noticed.&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;lt;div style=&quot;overflow: scroll; height: 100px; width: 505px&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:repeater id=&quot;Repeater1&quot; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...............&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/asp:repeater&amp;gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Create another &amp;lt;div&amp;gt; tag which will hold header column names dynamically.&lt;br /&gt;
&lt;b&gt;&amp;lt;div id=&quot;tableHeader&quot;&amp;gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;lt;/div&amp;gt;&lt;/b&gt;&lt;br /&gt;
Now finally the magic part, a javascript code -&lt;br /&gt;
&lt;br /&gt;
function fixHeader()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp;//get the id of table used in repeater control&lt;br /&gt;
&amp;nbsp; &amp;nbsp;var t = document.getElementById(&quot;table12&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;var thead = t.getElementsByTagName(&quot;thead&quot;)[0];&lt;br /&gt;
&amp;nbsp; &amp;nbsp;var t1 = t.cloneNode(false);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;t1.appendChild(thead);&lt;br /&gt;
&amp;nbsp; &amp;nbsp;tableHeader.appendChild(t1)&lt;br /&gt;
}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//call fixHeader() function on page load&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; window.onload = fixHeader&lt;br /&gt;
&lt;br /&gt;
put this code in &amp;lt;script&amp;gt; tag in &amp;lt;head&amp;gt; section of web page.&lt;br /&gt;
Output will be something like -&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://4.bp.blogspot.com/-cxxVuJZN0w8/UTWfUiO-C8I/AAAAAAAAB5k/7WW-GMBBFR8/s1600/FixedHeader.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;83&quot; src=&quot;http://4.bp.blogspot.com/-cxxVuJZN0w8/UTWfUiO-C8I/AAAAAAAAB5k/7WW-GMBBFR8/s320/FixedHeader.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I hope that this tutorial will help you somewhere.&lt;br /&gt;
Happy Coding !!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://dynamicsunil.blogspot.com/2013/03/how-to-fix-header-in-repeater-control.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-cxxVuJZN0w8/UTWfUiO-C8I/AAAAAAAAB5k/7WW-GMBBFR8/s72-c/FixedHeader.png" height="72" width="72"/><thr:total>8</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-4177182319475868105</guid><pubDate>Mon, 25 Feb 2013 09:16:00 +0000</pubDate><atom:updated>2013-03-05T13:13:22.340+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">flip</category><category domain="http://www.blogger.com/atom/ns#">flip text</category><category domain="http://www.blogger.com/atom/ns#">flip text with CSS</category><title>How to flip text or image vertical on mouse over in CSS ?</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This tutorial is about flip any text or image verticaly by using CSS class.&lt;br /&gt;
In .aspx page , write a &amp;lt;div&amp;gt; container in &amp;lt;body&amp;gt; tag which contains text which need to be flip.&lt;br /&gt;
Like -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;!-- container would have your background image --&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;h3&amp;gt; Hello There!&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;p&amp;gt; Here is some text&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
after that , create CSS class which will do the magic of flip&lt;br /&gt;
&lt;br /&gt;
&amp;lt;style type=&quot;text/css&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
.flip-vertical :hover&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -moz-transform: scaleY(-1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -webkit-transform: scaleY(-1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -o-transform: scaleY(-1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; transform: scaleY(-1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -ms-filter: flipv;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; filter: flipv;&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and use this class in &amp;lt;div&amp;gt; tag , so that text written in it will start flip on mouse over.&lt;br /&gt;
The complete code would be like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head runat=&quot;server&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;style type=&quot;text/css&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
.flip-vertical :hover&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -moz-transform: scaleY(-1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -webkit-transform: scaleY(-1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -o-transform: scaleY(-1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; transform: scaleY(-1);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -ms-filter: flipv;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; filter: flipv;&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&amp;lt;body&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;form id=&quot;form1&quot; runat=&quot;server&quot;&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;div class=&quot;flip-vertical&quot;&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;!-- container would have your background image --&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;h3&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Hello There!&amp;lt;/h3&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;p&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Here is some text&amp;lt;/p&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&amp;lt;/form&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;lt;/body&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;lt;/html&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
That&#39;s it !!! Copy this code and see the magic.&lt;/div&gt;
&lt;div&gt;
For flipping image, just change text part with any image and this CSS will do the same magic.&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Note :&lt;/b&gt;&lt;/span&gt; &lt;span style=&quot;color: #e06666;&quot;&gt;This CSS is tested on Crome,Mozilla and IE 10.It&#39;s not supported by IE 9 or less version.&lt;/span&gt;&lt;br /&gt;
Output will be -&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://2.bp.blogspot.com/-uPSAAJi7Rjo/UTWhmpx93GI/AAAAAAAAB50/KaIKcLIu7I0/s1600/SampleText.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://2.bp.blogspot.com/-uPSAAJi7Rjo/UTWhmpx93GI/AAAAAAAAB50/KaIKcLIu7I0/s1600/SampleText.png&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-uPSAAJi7Rjo/UTWhmpx93GI/AAAAAAAAB50/KaIKcLIu7I0/s1600/SampleText.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
on mouse over text will be like -&lt;br /&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-fsGYBMS0u-E/UTWh6c2sEgI/AAAAAAAAB58/QEdJOP1qHg0/s1600/FlipText.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-fsGYBMS0u-E/UTWh6c2sEgI/AAAAAAAAB58/QEdJOP1qHg0/s1600/FlipText.png&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Happy Coding ..&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://dynamicsunil.blogspot.com/2013/02/how-to-flip-text-or-image-vertical-on.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-uPSAAJi7Rjo/UTWhmpx93GI/AAAAAAAAB50/KaIKcLIu7I0/s72-c/SampleText.png" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-5926069199247676946</guid><pubDate>Mon, 04 Feb 2013 05:35:00 +0000</pubDate><atom:updated>2013-02-04T11:06:39.355+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">how to get textbox in jquery</category><category domain="http://www.blogger.com/atom/ns#">how to set textbox in jquery</category><category domain="http://www.blogger.com/atom/ns#">textbox</category><category domain="http://www.blogger.com/atom/ns#">textbox jquery</category><title>How to get and set textbox value in jquery with asp.net</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In this tutorial , I will explain how to get and set textbox value in jquery.&lt;br /&gt;
Firstly , add a latest reference of jquery library file in your page which you can either download from&lt;br /&gt;
&lt;a href=&quot;http://www.jquery.com/&quot;&gt;http://www.jquery.com&lt;/a&gt;&lt;br /&gt;
or you can add CDN link like :&lt;br /&gt;
//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js.&lt;br /&gt;
&lt;br /&gt;
Now, define one textbox control on page like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;asp:TextBox ID=&quot;txtName&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For getting value of textbox in jquery, simply write :&lt;br /&gt;
&lt;b&gt;$(&#39;#&amp;lt;textbox ID&amp;gt;&#39;).val();&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
like in above example :&lt;br /&gt;
&lt;b&gt;$(&#39;#txtName&#39;).val();&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
For setting value of textbox control :&lt;br /&gt;
&lt;b&gt;$(&#39;#txtName&#39;).val(&#39;Test&#39;);&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
That&#39;s it. Isn&#39;t it so simple !!! :-)&lt;br /&gt;
&lt;br /&gt;
But one point I want to mention here that if you are using page in Master page, then it&#39;s possible that you will not be able to get and set control value like this because after rendering page, control id gets change like something &#39;&lt;b&gt;ctl00$MainContent$Pending$txtName&lt;/b&gt;&#39;.&lt;br /&gt;
So, by using&amp;nbsp;&lt;b&gt;$(&#39;#txtName&#39;) &lt;/b&gt;you will not get or set any thing.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; For getting id of textbox used in master page, you have to change code like :&lt;br /&gt;
&lt;b&gt;$(&#39;[id$=&lt;/b&gt;&lt;b&gt;txtName&lt;/b&gt;&lt;b&gt;]&#39;).val();&lt;/b&gt;&lt;br /&gt;
here &#39;$=&#39; is basically used as one of attributes filter and syntax is :&lt;br /&gt;
&lt;b&gt;[attribute$=value]&lt;/b&gt;&lt;br /&gt;
it matches elements that have the specified attribute and it ends with a certain 
value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://dynamicsunil.blogspot.com/2013/02/how-to-get-and-set-textbox-value-in.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-2849463698744159958</guid><pubDate>Fri, 01 Feb 2013 11:35:00 +0000</pubDate><atom:updated>2013-02-01T17:07:11.578+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">asp.net</category><category domain="http://www.blogger.com/atom/ns#">c#</category><category domain="http://www.blogger.com/atom/ns#">databse driven Menu</category><category domain="http://www.blogger.com/atom/ns#">dynamic menu in asp.net</category><category domain="http://www.blogger.com/atom/ns#">menu</category><title>How to create database driven role base menu in asp.net with c#</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
For my new task, I wanted to create role based menu where menu options will be change as per user role.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The only condition was the first menu option &#39;&lt;b&gt;Home&lt;/b&gt;&#39; will remain same for all users with different page url. Like if user is admin then &#39;&lt;b&gt;Home&lt;/b&gt;&#39; link contain default admin page but if user is normal user then on the same &#39;&lt;b&gt;Home&lt;/b&gt;&#39; link default page will be show as per user need.&lt;br /&gt;
&lt;br /&gt;
I have google and found many links but didn&#39;t get any role base menu link. So finally, with little trick and twist, I have created this menu which I wanted to share with you guys.&lt;br /&gt;
&lt;br /&gt;
Firstly, create a method &lt;b&gt;GetRolebaseMenuDetail(int UserID)&lt;/b&gt; to read data from database to dataset.For reading data , I have used stored procedure which return menu data.Pass &lt;b&gt;User ID&lt;/b&gt; as parameter in stored procedure.&lt;br /&gt;
&lt;br /&gt;
public DataSet GetRolebaseMenuDetail(int UserID)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataSet dsTemp = new DataSet();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataRelation relation;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; using (SqlConnection conn = new SqlConnection(connectionString))&lt;br /&gt;
&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; using (SqlCommand comm = new SqlCommand())&lt;br /&gt;
&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; &amp;nbsp; comm.Connection = conn;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; comm.CommandText = &quot;spMenuDetailsRoleWise&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; comm.CommandType = CommandType.StoredProcedure;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; comm.Parameters.AddWithValue(&quot;@UserID&quot;, UserID.ToString());&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SqlDataAdapter da = new SqlDataAdapter(comm);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; da.Fill(dsTemp);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; da.Dispose();&lt;br /&gt;
&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; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dsTemp.DataSetName = &quot;Menus&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dsTemp.Tables[0].TableName = &quot;Menu&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dsTemp.Tables[1].TableName = &quot;RoleDetail&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;//set parent and child relationship between menu data&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; relation = new DataRelation(&quot;ParentChild&quot;, dsTemp.Tables[&quot;Menu&quot;].Columns[&quot;MenuID&quot;], dsTemp.Tables[&quot;Menu&quot;].Columns[&quot;ParentID&quot;], false);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; relation.Nested = true;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dsTemp.Relations.Add(relation);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return dsTemp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
After reading data in dataset , now bind Menu control&lt;br /&gt;
&lt;br /&gt;
public void PopulateRolebaseMenu(int UserID,string HomePageURL)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DataSet dsMenu = GetRolebaseMenuDetail(UserID);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (DataRow masterRow in dsMenu.Tables[&quot;Menu&quot;].Rows)&lt;br /&gt;
&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; MenuItem masterItem = null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (Convert.ToInt32(masterRow[&quot;ParentID&quot;]) == 0)&lt;br /&gt;
&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; &amp;nbsp; masterItem = new MenuItem((string)masterRow[&quot;Menu_Name&quot;]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; masterItem.ToolTip = masterRow[&quot;Tooltip&quot;].ToString();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (masterRow[&quot;Menu_Name&quot;].ToString() == &quot;Home&quot;)&lt;br /&gt;
&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; masterItem.NavigateUrl = HomePageURL;&lt;br /&gt;
&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; &amp;nbsp; else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; masterItem.NavigateUrl = masterRow[&quot;URL&quot;].ToString();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Menu1.Items.Add(masterItem);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (DataRow childRow in masterRow.GetChildRows(&quot;ParentChild&quot;))&lt;br /&gt;
&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; &amp;nbsp; MenuItem childItem = new MenuItem((string)childRow[&quot;Menu_Name&quot;]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; childItem.NavigateUrl = childRow[&quot;URL&quot;].ToString();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; childItem.ToolTip = childRow[&quot;Tooltip&quot;].ToString();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; masterItem.ChildItems.Add(childItem);&lt;br /&gt;
&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; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here , first parameter is the User&#39;s Id who just login and second is the default page url which should be open on default &#39;Home&#39; option , as per User role.&lt;br /&gt;
Happy Coding !!!! :-)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://dynamicsunil.blogspot.com/2013/02/how-to-create-database-driven-role-base.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-709193375413857765</guid><pubDate>Wed, 08 Aug 2012 16:26:00 +0000</pubDate><atom:updated>2013-02-25T12:42:37.835+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">xml</category><category domain="http://www.blogger.com/atom/ns#">xml node</category><title>How to add xml node in existing XML file ?</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;Let&#39;s say a XML file having format like :&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;XML file format :
-------------------------------
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;
&amp;lt;items&amp;gt;
  &amp;lt;item id=&quot;1&quot;&amp;gt;
    &amp;lt;content&amp;gt;Get groceries&amp;lt;/content&amp;gt;
    &amp;lt;status&amp;gt;false&amp;lt;/status&amp;gt;
  &amp;lt;/item&amp;gt;
  &amp;lt;item id=&quot;2&quot;&amp;gt;
    &amp;lt;content&amp;gt;Wash your car&amp;lt;/content&amp;gt;
    &amp;lt;status&amp;gt;true&amp;lt;/status&amp;gt;
  &amp;lt;/item&amp;gt;  
&amp;lt;/items&amp;gt;
&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;Now we want to add new element in existing XML file. &lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;Add new Node to existing XML file:
-------------------------------------
 using System.Xml;
 using System.IO;
&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;//call this method from page load
 private void AddNodeXML(string strFilePath)
 {&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;//get the existing xml file full path
 string XMLFile = Path.GetFullPath(strFilePath);&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;//create object of XML Document
 XmlDocument xDoc = new XmlDocument();&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;//load XML document from given URL
 xDoc.Load(XMLFile);&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;//get the root node in which you want to add new node
 XmlNode menu = xDoc.SelectSingleNode(&quot;//items&quot;);&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;//now,create new node with name,id and value
 XmlNode newNode = xDoc.CreateNode(XmlNodeType.Element, &quot;item&quot;, null);
 XmlAttribute xa = xDoc.CreateAttribute(&quot;id&quot;);
 xa.Value = &quot;3&quot;;
 newNode.Attributes.Append(xa);
//append new node as child node&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt; menu.AppendChild(newNode);&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;//create new element
 XmlNode newContent = xDoc.CreateElement(&quot;content&quot;);
 newContent.InnerText = &quot;Clean Table&quot;;
 newNode.AppendChild(newContent);
 XmlNode newStatus = xDoc.CreateElement(&quot;status&quot;);
 newStatus.InnerText = &quot;true&quot;;&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;//append new created element in node
 newNode.AppendChild(newStatus);&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;//save xml file 
 xDoc.Save(XMLFile);
 }&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;/pre&gt;
&lt;/div&gt;
</description><link>http://dynamicsunil.blogspot.com/2012/08/how-to-add-xml-node-in-existing-xml-file.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-1604259264537360637</guid><pubDate>Mon, 09 Jul 2012 12:05:00 +0000</pubDate><atom:updated>2012-07-09T17:35:34.742+05:30</atom:updated><title>How to create simple jquery tooltip in .net ?</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
This article will show how to create tooltip in .net based on jQuery and CSS.&lt;br /&gt;
For creating jquery tooltip, first you need to add reference of jQuery library :&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;script&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text/javascript&quot;&amp;gt;&amp;lt;&lt;/span&gt;/script&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then after, on &lt;span style=&quot;color: #6aa84f;&quot;&gt;&lt;b&gt;*.aspx&lt;/b&gt;&lt;/span&gt; , add &amp;lt;div&amp;gt; tag in &amp;lt;body&amp;gt; for&amp;nbsp;containing tooltip text in hidden form :&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;tooltip&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;divPaid&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;asp&lt;/span&gt;:&lt;span style=&quot;color: purple;&quot;&gt;Label&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;lblTooltipText&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;This is just a sample text for showing tooltip content.&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;asp:Label&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
after that create &amp;lt;a&amp;gt; tag which will show tooltip on mouseover :&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;a&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;href&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&#39;javascript:void(0)&#39;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;lnkTip&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;onmouseover&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;simple_tooltip(&#39;lnkTip&#39;, &#39;tooltip&#39;,&#39;lblTooltipText&#39;);&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;img&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;~/images/tooltip_blue.png&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;alt&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;text-decoration: none;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; border: 0px; height: 15px;&quot; /&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: purple;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
now write simple CSS class which would be responsible for look of tooltip :&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;.tooltip&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;position&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;absolute;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;z-index&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;999;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;left&lt;/span&gt;:&lt;span style=&quot;color: blue;&quot;&gt; -9999px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;width&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;250px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt; background-color&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;#62A2DA;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;padding&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;5px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;border&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;1px solid #828282;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;font-family&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;Arial;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;font-size&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;12px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;color&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;#fff;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;border-top-left-radius&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;5px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;border-bottom-left-radius&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;5px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;border-bottom-right-radius&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;5px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;border-top-right-radius&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;5px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt; -moz-border-radius-bottomleft&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;5px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;-moz-border-radius-bottomright&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;5px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt; -moz-border-radius-topright&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;5px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;-moz-border-radius-topleft&lt;/span&gt;: &lt;span style=&quot;color: blue;&quot;&gt;5px;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
Finally , jQuery magic method :&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;function&lt;/span&gt; simple_tooltip(target_items, name, content) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var i = 0;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var temp = &lt;span style=&quot;color: purple;&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; temp = &lt;span style=&quot;color: purple;&quot;&gt;&quot;&amp;lt;div class=&#39;&quot;&lt;/span&gt; + name + &lt;span style=&quot;color: purple;&quot;&gt;&quot;&#39; id=&#39;&quot;&lt;/span&gt; + target_items + i + &lt;span style=&quot;color: purple;&quot;&gt;&quot;&#39;&amp;gt;&amp;lt;p&amp;gt;&quot;&lt;/span&gt; + $(&lt;span style=&quot;color: purple;&quot;&gt;&quot;[id$=&quot;&lt;/span&gt; + content + &lt;span style=&quot;color: purple;&quot;&gt;&quot;]&quot;&lt;/span&gt;).text() + &lt;span style=&quot;color: purple;&quot;&gt;&quot;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&quot;&lt;/span&gt;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&lt;span style=&quot;color: purple;&quot;&gt;&quot;body &amp;gt; div&quot;&lt;/span&gt;).remove();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&lt;span style=&quot;color: purple;&quot;&gt;&quot;body&quot;&lt;/span&gt;).append(temp);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var my_tooltip = $(&lt;span style=&quot;color: purple;&quot;&gt;&quot;[id$=&quot;&lt;/span&gt; + target_items + i + &lt;span style=&quot;color: purple;&quot;&gt;&quot;]&quot;&lt;/span&gt;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(&lt;span style=&quot;color: purple;&quot;&gt;&#39;[id$=&#39;&lt;/span&gt; + target_items + &lt;span style=&quot;color: purple;&quot;&gt;&#39;]&#39;&lt;/span&gt;).mouseover(function () {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; my_tooltip.css({ display: &lt;span style=&quot;color: purple;&quot;&gt;&quot;none&quot;&lt;/span&gt; }).fadeIn(400);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }).mousemove(function (kmouse) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; my_tooltip.css({ left: kmouse.pageX + 15, top: kmouse.pageY + 15 });&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }).mouseout(function () {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; my_tooltip.fadeOut(400);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Here is output :&amp;nbsp;&lt;/span&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/AVvXsEihkkLDBc8D_SspI182_EvU3no-Qj_Ve9g09IiV70b0d__6MuPZqSxbCApIurB1zadzwmdnmMj5bSYIEvOFxwp1S-HTyiZwnaFaUJdzx9oWZ9yW3u-D9-8RfsNLQ5ox22dBcRzUY8hoq2g/s1600/tooltip_sample.png&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/AVvXsEihkkLDBc8D_SspI182_EvU3no-Qj_Ve9g09IiV70b0d__6MuPZqSxbCApIurB1zadzwmdnmMj5bSYIEvOFxwp1S-HTyiZwnaFaUJdzx9oWZ9yW3u-D9-8RfsNLQ5ox22dBcRzUY8hoq2g/s1600/tooltip_sample.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Happy Coding !!!!&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</description><link>http://dynamicsunil.blogspot.com/2012/07/how-to-create-simple-jquery-tooltip-in.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihkkLDBc8D_SspI182_EvU3no-Qj_Ve9g09IiV70b0d__6MuPZqSxbCApIurB1zadzwmdnmMj5bSYIEvOFxwp1S-HTyiZwnaFaUJdzx9oWZ9yW3u-D9-8RfsNLQ5ox22dBcRzUY8hoq2g/s72-c/tooltip_sample.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-6241766620586148125</guid><pubDate>Fri, 29 Jun 2012 07:22:00 +0000</pubDate><atom:updated>2013-02-01T16:09:55.441+05:30</atom:updated><title>Delegate and Events in C#</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
A delegate is a .NET class that encapsulates a method, but not in the same way other classes encapsulate methods. A delegate actually stores the address of a method that is contained in some other class. So, a delegate is really the equivalent of a function pointer in C++. However, they are also far more than that.&lt;/div&gt;
&lt;br /&gt;
&amp;lt;from MSDN&amp;gt;&lt;br /&gt;
Delegates enable you to call a synchronous method in an asynchronous manner. When you call a delegate synchronously, the &lt;b&gt;Invoke&lt;/b&gt; method calls the target method directly on the current thread. If the &lt;b&gt;BeginInvoke&lt;/b&gt; method is called, the common language runtime (CLR) queues the request and returns immediately to the caller. The target method is called asynchronously on a thread from the thread pool. The original thread, which submitted the request, is free to continue executing in parallel with the target method. If a callback method has been specified in the call to the &lt;b&gt;BeginInvoke&lt;/b&gt; method, the callback method is called when the target method ends. In the callback method, the &lt;b&gt;EndInvoke&lt;/b&gt; method obtains the return value and any input/output or output-only parameters. If no callback method is specified when calling &lt;b&gt;BeginInvoke&lt;/b&gt;, &lt;b&gt;EndInvoke&lt;/b&gt; can be called from the thread that called &lt;b&gt;BeginInvoke&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
    Declaring and using delegates&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/h3&gt;
You declare a delegate in a class or namespace using the &lt;span style=&quot;color: #3d85c6;&quot;&gt;delegate&lt;/span&gt; keyword and by specifying the signature of the method it will call. The following line declares a delegate named &lt;span style=&quot;color: #3d85c6;&quot;&gt;TestDelegate&lt;/span&gt; which will reference a method that returns void and accepts a string as the argument.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;color: #0600ff;&quot;&gt;delegate&lt;/span&gt; &lt;span style=&quot;color: #0600ff;&quot;&gt;void&lt;/span&gt; TestDelegate(&lt;span style=&quot;color: #0600ff;&quot;&gt;string&lt;/span&gt; s);&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;Now that we have declared the TestDelegate, we can instantiate it to encapsulate a method of that signature.&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt; Then, we can invoke the method through the delegate, just as if we invoked the method itself. 
The next code sample creates an instance of TestDelegate and uses it to invoke the TestFun method.&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;color: #0600ff;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;color: #0600ff;&quot;&gt;class&lt;/span&gt; DelegateDemo {    
&lt;pre class=&quot;csharp&quot;&gt;TestDelegate td = &lt;span style=&quot;color: #0600ff;&quot;&gt;new&lt;/span&gt; TestDelegate(TestFun);&lt;/pre&gt;
protected void Page_Load(object sender, EventArgs e)
{
    td(&quot;Hello World&quot;);          
} 
&lt;span style=&quot;background-color: white; color: #0600ff;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #0600ff;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt; TestFun&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #0600ff;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt; s&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;{&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(s);
      }
}
&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;Delegates only depend on the signature of the method, not on the class or object containing the method.&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;A&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;delegate can reference an instance method as well. The above example uses the &lt;span style=&quot;color: #3d85c6;&quot;&gt;TestDelegate&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt; to invoke an&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;method.&lt;/span&gt;&lt;/pre&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
  &lt;span style=&quot;background-color: white;&quot;&gt;Events&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
One of the most common uses of delegates in .NET is event handling. Events are useful for notifying objects&lt;br /&gt;
of user interface events or state changes. The following example creates a &lt;code&gt;Timer&lt;/code&gt; object that will fire an event&lt;br /&gt;
every second. The &lt;code&gt;Timer&lt;/code&gt; class is defined in the &lt;code&gt;System.Timers&lt;/code&gt; namespace.&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;color: #0600ff;&quot;&gt;class&lt;/span&gt; DelegateDemo {
   &lt;span style=&quot;color: #0600ff;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0600ff;&quot;&gt;void&lt;/span&gt; Main(&lt;span style=&quot;color: #0600ff;&quot;&gt;string&lt;/span&gt;[] args) {
      &lt;span style=&quot;color: #2b91af;&quot;&gt;Timer&lt;/span&gt; t = &lt;span style=&quot;color: #0600ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Timer&lt;/span&gt;(&lt;span style=&quot;color: red;&quot;&gt;1000&lt;/span&gt;);
      t.Elapsed += 
         &lt;span style=&quot;color: #0600ff;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;ElapsedEventHandler&lt;/span&gt;(Timer_Elapsed);
      t.Enabled = &lt;span style=&quot;color: #0600ff;&quot;&gt;true&lt;/span&gt;;
      &lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Press enter to exit&quot;&lt;/span&gt;);
      &lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.ReadLine();
      }
 
   &lt;span style=&quot;color: #0600ff;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0600ff;&quot;&gt;void&lt;/span&gt; Timer_Elapsed(&lt;span style=&quot;color: #0600ff;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: #2b91af;&quot;&gt;ElapsedEventArgs&lt;/span&gt; e) {
      &lt;span style=&quot;color: #2b91af;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;tick&quot;&lt;/span&gt;);   
      }
   }&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;The &lt;code&gt;&lt;span style=&quot;color: blue;&quot;&gt;Timer&lt;/span&gt;&lt;/code&gt; class contains the &lt;code&gt;&lt;span style=&quot;color: blue;&quot;&gt;Elapsed&lt;/span&gt;&lt;/code&gt; event and fires it whenever its interval expires. In this example the&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: blue;&quot;&gt;Main&lt;/span&gt;&lt;/code&gt; method instantiates a &lt;code&gt;&lt;span style=&quot;color: blue;&quot;&gt;Timer&lt;/span&gt;&lt;/code&gt; and registers an &lt;code&gt;&lt;span style=&quot;color: #45818e;&quot;&gt;ElapsedEventHandler&lt;/span&gt;&lt;/code&gt; delegate with its &lt;code&gt;&lt;span style=&quot;color: blue;&quot;&gt;Elapsed&lt;/span&gt;&lt;/code&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;event. &lt;/span&gt;

&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;In this example, the method invoked by the &lt;code&gt;&lt;span style=&quot;color: #45818e;&quot;&gt;ElapsedEventHandler&lt;/span&gt;&lt;/code&gt; delegate is the &lt;code&gt;&lt;span style=&quot;color: blue;&quot;&gt;Timer_Elapsed&lt;/span&gt;&lt;/code&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;method. Following the convention of all event handling delegates, the &lt;code&gt;&lt;span style=&quot;color: #45818e;&quot;&gt;ElapsedEventHandler&lt;/span&gt;&lt;/code&gt; delegate&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;returns &lt;code&gt;void&lt;/code&gt; and accepts two parameters. The first is a reference to the object that signaled the event and&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;csharp&quot;&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;the second is a argument derived of &lt;code&gt;&lt;span style=&quot;color: #45818e;&quot;&gt;EventArgs&lt;/span&gt;&lt;/code&gt; which stores pertinent information about the event.&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><link>http://dynamicsunil.blogspot.com/2012/06/delegate-and-events-in-c.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-7438246828219700061</guid><pubDate>Mon, 11 Jun 2012 11:44:00 +0000</pubDate><atom:updated>2012-06-11T17:18:19.354+05:30</atom:updated><title>How to post form data from HTML to ASP.Net page</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;For sending form data from HTML page to ASP.Net page , &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;In HTML page , do the &lt;strong&gt;method&lt;/strong&gt; type&amp;nbsp;as&amp;nbsp;&lt;strong&gt;POST&lt;/strong&gt; and &lt;strong&gt;action&lt;/strong&gt; should be full path of .aspx page.Like&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;u&gt;Test.html page&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;form id=&quot;form1&quot; action=&quot;../MailerTest.aspx&quot; method=&quot;post&quot;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&quot;text&quot; name=&quot;txtName&quot; id=&quot;Name&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&quot;text&quot; name=&quot;txtEmail&quot; id=&quot;Email&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;br/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;&amp;lt;input type=&quot;submit&quot; name=&quot;btnPost&quot; value=&quot;Submit&quot; id=&quot;btnPost&quot; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;/html&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;u&gt;Default.aspx page&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;On aspx page , get html controls data on page_load event&amp;nbsp;as &lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;strName = Request.Form[&quot;txtName&quot;].ToString();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;strEmail = Request.Form[&quot;txtEmail&quot;].ToString();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Thing which we need to take care of that &lt;strong&gt;Key&lt;/strong&gt; value in &lt;strong&gt;Request.Form&lt;/strong&gt; should be name&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;in &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;input&amp;gt;&lt;/span&gt; tag besides of id.After clicking on &#39;Submit&#39; button HTML page will post data to &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial;&quot;&gt;aspx page.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</description><link>http://dynamicsunil.blogspot.com/2012/06/how-to-post-form-data-from-html-to.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-1749107050436561166</guid><pubDate>Mon, 11 Jun 2012 09:15:00 +0000</pubDate><atom:updated>2013-02-01T15:42:45.460+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">delegate</category><category domain="http://www.blogger.com/atom/ns#">jquery</category><category domain="http://www.blogger.com/atom/ns#">jquery delegate</category><category domain="http://www.blogger.com/atom/ns#">jquery live</category><category domain="http://www.blogger.com/atom/ns#">live</category><title>Difference between live() and delegate() in jQuery</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;b&gt;.live()&lt;/b&gt; requires you run the selector immediately, unless you&#39;re using the result it&#39;s very wasteful. The event handler here is attached to document, so all event of that type from any elements bubbling must be checked. Here&#39;s a usage example:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #666666;&quot;&gt;$(&quot;.myClass&quot;).live(&quot;click&quot;, function() { alert(&quot;Hello World&quot;); });&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Note that the statement &lt;span style=&quot;color: #666666;&quot;&gt;$(&quot;.myClass&quot;)&lt;/span&gt; ran that selector to find all elements with that class even though we don&#39;t care about them, all we wanted was the string &quot;.myClass&quot; to match later when click events bubble up to document.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #666666;&quot;&gt;.delegate()&lt;/span&gt; actually uses &lt;span style=&quot;color: #666666;&quot;&gt;.live()&lt;/span&gt; internally, but with a context. The selector is not run immediately, so it&#39;s more efficient already, and it doesn&#39;t attach to document (though it can) it&#39;s much more local...and all those other events from other element trees you don&#39;t care about are never even checked when bubbled...again more efficient. Here&#39;s a usage example:&lt;br /&gt;
&lt;span style=&quot;color: #666666;&quot;&gt;$(&quot;#table&quot;).delegate(&quot;td&quot;, &quot;click&quot;, function() { alert(&quot;Hello World&quot;); });&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Now what happened here? We ran &lt;span style=&quot;color: #666666;&quot;&gt;$(&quot;#table&quot;)&lt;/span&gt; to get the element to attach to ,admittedly more expensive than document, but we&#39;re using the result). Then we attach an event handler to that (or those in other cases) elements. Only clicks from within that element are checked against the &quot;td&quot; selector when they happen, not from everywhere like .live() does (since everything is inside document).&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://dynamicsunil.blogspot.com/2012/06/difference-between-live-and-delegate-in.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-4079599767287551268</guid><pubDate>Mon, 11 Jun 2012 08:52:00 +0000</pubDate><atom:updated>2012-06-11T14:32:44.783+05:30</atom:updated><title>What is the difference between the .bind() and .live() methods in jQuery?</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;b&gt;.bind()&lt;/b&gt; will only apply to the items you currently have selected in your jQuery object. &lt;b&gt;.live()&lt;/b&gt; will apply to all current matching elements, as well as any you might add in the future.&lt;br /&gt;
&lt;br /&gt;
The underlying difference between them is that &lt;b&gt;live()&lt;/b&gt; makes use of event bubbling. That is, when you click on a button, that button might exist in a &amp;lt;p&amp;gt;, in a &amp;lt;div&amp;gt;, in a &amp;lt;body&amp;gt; element; so in effect, you&#39;re actually clicking on all of those elements at the same time.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;live()&lt;/b&gt; works by attaching your event handler to the document, not to the element. When you click on that button, as illustrated before, the document receives the same click event. It then looks back up the line of elements targeted by the event and checks to see if any of them match your query.&lt;br /&gt;
&lt;br /&gt;
The outcome of this is twofold: firstly, it means that you don&#39;t have to continue reapplying events to new elements, since they&#39;ll be implicitly added when the event happens. However, more importantly (depending on your situation), it means that your code is much much lighter! If you have 50 &amp;lt;img&amp;gt; tags on the page and you run this code:&lt;br /&gt;
$(&#39;img&#39;).click(function() { /* doSomething */ });&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;...then that function is copied into each of those elements. However, if you had this code:&lt;br /&gt;
$(&#39;img&#39;).live(&#39;click&#39;, function() { /* doSomething */ });&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;...then that function is stored only in one place (on the document), and is applied to whatever matches your query at event time.&lt;br /&gt;
&lt;br /&gt;
Because of this bubbling behaviour though, not all events can be handled this way.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;default prettyprint&quot;&gt;&lt;code&gt;&lt;span class=&quot;com&quot;&gt;// BIND example&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;div&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;mouseover&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; doSomething&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// this new div WILL NOT HAVE mouseover event handler registered&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div/&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;appendTo&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;div:last&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
 
&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// LIVE example&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;div&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;live&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;mouseover&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; doSomething&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
&lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// this new appended div WILL HAVE mouseover event handler registered&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; 
$&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;&amp;lt;div/&amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;appendTo&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;div:last&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://dynamicsunil.blogspot.com/2012/06/what-is-difference-between-bind-and.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-4734034950967728396</guid><pubDate>Fri, 08 Jun 2012 04:58:00 +0000</pubDate><atom:updated>2012-06-08T10:54:25.491+05:30</atom:updated><title>Sending form submissions to email using &#39;mailto:&#39;</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;The simplest method to get the form submissions posted to you via email is by using &quot;mailto:&quot; in the action field of the form. However, this method has many drawbacks.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;First let us see how we can use &#39;mailto&#39; in a form.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: small;&quot;&gt;&lt;b&gt;
How to set up &#39;mailto&#39; in your HTML form&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;In the action field of the form, set the action as &quot;mailto:&amp;lt;youremailaddress&amp;gt;&quot; for example:&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter nogutter formcode xml&quot; id=&quot;highlighter_296606&quot;&gt;
&lt;div class=&quot;lines&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;content&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;form&lt;/code&gt; &lt;code class=&quot;xml color1&quot;&gt;action&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;mailto:myforms@mydomain.com&quot;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;code&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;The sad part is that the behavior of such a form will be different in different browsers.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: small;&quot;&gt;&lt;b&gt;
How to get the form data in plain text&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;We can make the form data sent to be in readable form by making a small change in the form.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;Add &#39;enctype=text/plain&#39; in the form attributes. The form code becomes:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter nogutter formcode xml&quot; id=&quot;highlighter_158529&quot;&gt;
&lt;div class=&quot;lines&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;content&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;form&lt;/code&gt; &lt;code class=&quot;xml color1&quot;&gt;action&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;mailto:myforms@mydomain.com&quot;&lt;/code&gt; &lt;code class=&quot;xml color1&quot;&gt;enctype&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;text/plain&quot;&lt;/code&gt; &lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;code&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;When this form is submitted, you will get the email in readable form. Like this:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter nogutter formcode xml&quot; id=&quot;highlighter_953798&quot;&gt;
&lt;div class=&quot;lines&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;Name=john&lt;/span&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;Email=john@yahoo.com&lt;/span&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;Address=&lt;/span&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;Submit=Submit&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: small;&quot;&gt;&lt;b&gt;
How to show a &#39;Thank You&#39; page&lt;/b&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small; text-align: left;&quot;&gt;You have successfully submitted the form. Now you want to show a confirmation page to the visitor that the form is submitted. Here is how to do it:&lt;/span&gt;&lt;br /&gt;
&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;
Suppose the name of the confirmation page is thanks.html Update the code for the form tag to:&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter nogutter formcode xml&quot; id=&quot;highlighter_99702&quot;&gt;
&lt;div class=&quot;lines&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;form&lt;/code&gt; &lt;code class=&quot;xml color1&quot;&gt;action&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;mailto:myforms@mydomain.com&quot;&lt;/code&gt; &lt;code class=&quot;xml color1&quot;&gt;enctype&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;text/plain&quot;&lt;/code&gt;&lt;code class=&quot;xml color1&quot;&gt;onsubmit&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;location.href=&#39;thanks.html&#39;;&quot;&lt;/code&gt; &lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;code class=&quot;xml plain&quot;&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;
How to customize the subject of the email&lt;/b&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;
By default, the subject of the email that you receive from such a form will read something like: &quot;Form posted from Microsoft Internet Explorer&quot;&lt;br /&gt; The following code shows the change:&lt;br /&gt;
&lt;/span&gt;&lt;code&gt;&lt;/code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter nogutter formcode xml&quot; id=&quot;highlighter_393988&quot;&gt;
&lt;div class=&quot;lines&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;content&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;form&lt;/code&gt; &lt;code class=&quot;xml color1&quot;&gt;action&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;mailto:myforms@mydomain.com?subject=myform_submission&quot;&lt;/code&gt; &lt;code class=&quot;xml color1&quot;&gt;enctype&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;text/plain&quot;&lt;/code&gt; &lt;code class=&quot;xml color1&quot;&gt;onsubmit&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;location.href=&#39;thanks.html&#39;;&quot;&lt;/code&gt; &lt;/span&gt;&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;
Drawbacks of &#39;mailto&#39; email form&lt;/b&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;
We have seen that using mailto is simplest way to get your HTML form submissions via email.&lt;br /&gt; However, there are many disadvantages for this method.&lt;br /&gt;
&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;
&lt;ol&gt;&lt;code class=&quot;xml plain&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;Your visitor must have Internet Explorer as the browser and Outlook Express as the default client for this to work correctly.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;Even if your visitor is using Internet Explorer, but the default mail client is different, your mailto form will not work.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;Even if your visitors have IE and has configured Outlook Express as default mail client, they may press cancel on the warning dialog that pops up.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;According to the HTML specifications, the action field of the form should be a correctly formed HTTP URL. So &#39;mailto:&#39; is not valid for the action field.&lt;/span&gt;&lt;/li&gt;
&lt;/code&gt;&lt;/ol&gt;
&lt;code class=&quot;xml plain&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;
Use a form mail script&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;

&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;
The only consistent alternative to ensure that you get the email form the form submissions is to use a form mail script.&lt;/span&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;code class=&quot;xml plain&quot;&gt;&lt;code&gt;
&lt;/code&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;code class=&quot;xml plain&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;code&gt;
&lt;/code&gt;&lt;/span&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;code&gt;
&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://dynamicsunil.blogspot.com/2012/06/sending-form-submissions-to-email-using.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-7292702917432592753</guid><pubDate>Thu, 07 Jun 2012 05:50:00 +0000</pubDate><atom:updated>2012-06-07T11:42:39.256+05:30</atom:updated><title>Difference between GROUP BY and PARTITION BY</title><description>&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: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;GROUP BY&lt;/b&gt;&amp;nbsp;modifies the entire query, like:&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;lang-sql prettyprint&quot;&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;Select&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; customerId&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;count&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;(&lt;/span&gt;*&lt;span style=&quot;color: #999999;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; orderCount 
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Orders 
&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;by&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; customerId 
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint&quot;&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;But &lt;/span&gt;&lt;code style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;b&gt;PARTITION BY&lt;/b&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; just works on a window function, like &lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: magenta;&quot;&gt;row_number&lt;/span&gt;&lt;/code&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;pre class=&quot;lang-sql prettyprint&quot;&gt;&lt;code&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;font-size: x-small;&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;row_number&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;font-size: x-small;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;over&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;font-size: x-small;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;PARTITION BY&lt;/span&gt; customerId &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;font-size: x-small;&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;font-size: x-small;&quot;&gt;by&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;font-size: x-small;&quot;&gt; orderId&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;font-size: x-small;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;font-size: x-small;&quot;&gt; 
    &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;font-size: x-small;&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;font-size: x-small;&quot;&gt; OrderNumberForThisCustomer 
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;font-size: x-small;&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;font-size: x-small;&quot;&gt; Orders &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;A &lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;code&gt;Group By&lt;/code&gt; &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;normally reduces the number of rows returned by rolling them up and&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;calculating averages or sums for each row.  &lt;/span&gt;&lt;code&gt;Partition By&lt;/code&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; does not affect the number of rows&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;returned, but it changes how a window function&#39;s result is calculated.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;lang-sql prettyprint&quot;&gt;&lt;code&gt;&lt;span class=&quot;pln&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description><link>http://dynamicsunil.blogspot.com/2012/06/difference-between-group-by-and.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5835690682756737122.post-4031649931915638706</guid><pubDate>Wed, 06 Jun 2012 10:05:00 +0000</pubDate><atom:updated>2012-06-06T15:38:32.651+05:30</atom:updated><title>SQL SERVER - APPLY</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;ol class=&quot;commentlist&quot;&gt;
&lt;li class=&quot;comment odd alt thread-odd thread-alt depth-1 highlander-comment&quot; id=&quot;comment-199261&quot;&gt;&lt;div id=&quot;div-comment-199261&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;An &lt;b&gt;APPLY&lt;/b&gt; is used to join a table-valued-function with a table. APPLY are of two types: &lt;b&gt;CROSS APPLY&lt;/b&gt; and &lt;b&gt;OUTER APPLY&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;A &lt;b&gt;CROSS APPLY&lt;/b&gt; is used when you want to return only those records from your table where a value is returned by your table valued function.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;Whereas, an &lt;b&gt;OUTER APPLY&lt;/b&gt; is used to return all records from your table regardless of the values returned by your table valued function.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt; &lt;/span&gt;name.User_Id,name.UserName,name.Email,name.MobileNo,name.VisitedDate&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;FROM&lt;/span&gt; allocate_site lead&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;outer apply&lt;/span&gt; dbo.fn_get_latest_response_userwise(lead.User_ID) sales&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;cross apply&lt;/span&gt; dbo.fn_get_user_details(lead.User_ID) name&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #999999;&quot;&gt;inner join&lt;/span&gt; UserDetails users &lt;span style=&quot;color: #3d85c6;&quot;&gt;on&lt;/span&gt; users.ID = lead.User_ID&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;WHERE&lt;/span&gt; lead.ProductId = name.ProductID&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description><link>http://dynamicsunil.blogspot.com/2012/06/sql-server-apply.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item></channel></rss>