<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6104185749662767834</atom:id><lastBuildDate>Mon, 30 Jan 2012 12:30:11 +0000</lastBuildDate><category>xml</category><category>Positive Change</category><category>Visual Studio</category><category>CSS</category><category>Email</category><category>DropdownList</category><category>SQL Server 2005</category><category>ListBox</category><category>Files</category><category>ASP.NET Control</category><category>ObjectDataSource</category><category>DataTable</category><category>Social Work</category><category>open source</category><category>Nepal</category><category>TOAD</category><category>Oracle Interview Questions</category><category>Error Handling</category><category>Visual Studio 2010</category><category>Ajax</category><category>asp.net membership provider</category><category>Business Logic Layer</category><category>ASP.NET</category><category>ASP.NET Deployment</category><category>ADO.NET</category><category>C#</category><category>XMLHTTP</category><category>ASP.NET Design</category><category>jquery</category><category>Data Access Layer</category><category>Oracle Database</category><category>Oracle Error</category><category>video</category><category>performance</category><category>ASP.NET GridView</category><category>Oracle PL/SQL Programming</category><category>asp.net DetailsView</category><category>User Control</category><category>JavaScript</category><category>database</category><title>dotNETspidor: A dot net programming blog</title><description>Experiences of an C#, asp.net web application developer with SQL, jquery, xml</description><link>http://dotnetspidor.blogspot.com/</link><managingEditor>noreply@blogger.com (Sangam Uprety)</managingEditor><generator>Blogger</generator><openSearch:totalResults>79</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/dotnetspidor" /><feedburner:info uri="dotnetspidor" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>dotnetspidor</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-1190485405906879955</guid><pubDate>Fri, 30 Dec 2011 06:28:00 +0000</pubDate><atom:updated>2011-12-30T12:04:58.767+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Social Work</category><category domain="http://www.blogger.com/atom/ns#">Positive Change</category><title>Prove that programmers too can be social change makers : last day to vote for a social work</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bDOGaVZhm_Npcbo7WhpvbKzQUuY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bDOGaVZhm_Npcbo7WhpvbKzQUuY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bDOGaVZhm_Npcbo7WhpvbKzQUuY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bDOGaVZhm_Npcbo7WhpvbKzQUuY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;A dream to provide solar and computer to a school in rural Nepal! It can be realized by your single vote. Please vote for it at &lt;a href="http://sunsuperdreams.com.au/dream/view/solar-and-computers-to-a-school-in-rural-nepal" target="_blank"&gt;Solar and Computers to a School in Rural Nepal&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
Appeal from the dreamer - read below please. &lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
My dream is to help a school in an extremely remote village of Western 
Nepal to buy and install a solar system, batteries, inverters, computers
 and printers necessary for the school for its computer lab and 
e-library. The school was built with support from local people and some 
of the colleges and students of Kathmandu.&lt;br /&gt;
&lt;br /&gt;
Lalu village where the school is located lacks basic infrastructure, 
however with the local people driving it, the school is a vehicle to 
bring the community into the 21st century.&lt;br /&gt;
&lt;br /&gt;
The school has very innovative ideas that make it unique. Firstly, 
Modern Model Residential School is a rural based purely service oriented
 co-educational English medium primary institution registered as 
Non-profit Distributing Company. Secondly, it strives to be a 
progressive institution that acts as a hub for the community, imparting 
education mixed with modern technology. &lt;br /&gt;
&lt;br /&gt;
Using a pro-rata system the school is able to provide quality education 
to people of the entire community. Orphaned, disadvantaged or disabled 
students and families are admitted free of charge, whilst others 
contribute as little as $3 per month. This shows how even a small amount
 can change not only the students’ lives but their families and the 
entire community.&lt;br /&gt;
&lt;br /&gt;
Kalikot is amongst one of the world's most impoverished areas. “57% of 
people in Kalikot district live under extreme poverty. Per capita income
 lies at Rs. 6000 (around $ 83) per year and average life expectancy 
remains at just 42. Only 57.27% of children are literate where as 
overall literacy rate is at just 38.47%. Still 45.95% of children 
involve in some kinds of economic activity instead of going to school.” 
-Central Bureau of Statistics of Nepal, District Profile, Kalikot 2008 
AD .&lt;/blockquote&gt;
Please don't forget that your single click can make it happen. Time is too short to stop and think. Help to realize the dream and be proud of it! Click &lt;a href="http://sunsuperdreams.com.au/dream/view/solar-and-computers-to-a-school-in-rural-nepal" target="_blank"&gt;Solar and Computers to a School in Rural Nepal&lt;/a&gt; to vote!&lt;br /&gt;
&lt;br /&gt;
Yes, programmers too can be social workers!&lt;br /&gt;
&lt;br /&gt;
Thank you!&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-1190485405906879955?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/Eh0KueT5CDk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/Eh0KueT5CDk/prove-that-programmers-too-can-be.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/12/prove-that-programmers-too-can-be.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-3232553749343811098</guid><pubDate>Tue, 27 Dec 2011 02:57:00 +0000</pubDate><atom:updated>2011-12-30T12:00:30.277+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">video</category><category domain="http://www.blogger.com/atom/ns#">open source</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>CamStudio - Free Streaming Video Desktop Recording Software</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vVFLhWEcA6dz4i667n10GcrHvHw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vVFLhWEcA6dz4i667n10GcrHvHw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vVFLhWEcA6dz4i667n10GcrHvHw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vVFLhWEcA6dz4i667n10GcrHvHw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href="http://camstudio.org/"&gt;CamStudio&lt;/a&gt; a really useful desktop based software that you can use for recording anything that happens with your desktop. And the best part is it is distributed under &lt;a href="http://www.blogger.com/en.wikipedia.org/wiki/GNU_General_Public_License"&gt;GNU General Public License (GPL)&lt;/a&gt; license. Free to use for both commercial and non-commercial uses.

So what are the uses? Let me recite the site itself:

&lt;br /&gt;
&lt;blockquote&gt;
CamStudio is able to record all screen and audio activity on your computer and create industry-standard AVI video files and using its built-in SWF Producer can turn those AVIs into lean, mean, bandwidth-friendly Streaming Flash videos (SWFs)

Here are just a few ways you can use this software:

    You can use it to create demonstration videos for any software program
    Or how about creating a set of videos answering your most frequently asked questions?
    You can create video tutorials for school or college class
    You can use it to record a recurring problem with your computer so you can show technical support people
    You can use it to create video-based information products you can sell
    You can even use it to record new tricks and techniques you discover on your favourite software program, before you forget them&lt;/blockquote&gt;
How to get the software? How to use this? Yes, it is very easy. Watch the video on &lt;a href="http://www.metacafe.com/watch/735296/how_to_record_your_desktop/"&gt;how to capture video from your desktop&lt;/a&gt; and you are easy to begin!

Why this post?
Any open source products like this one is a great contribution to the whole world. So this just a give-back to the great effort. I have just tried to spread the word. Could you please do the same? Thank you!&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-3232553749343811098?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/oVuTXmV3-Xs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/oVuTXmV3-Xs/camstudio-free-streaming-video-desktop.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/12/camstudio-free-streaming-video-desktop.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-7500196072740062299</guid><pubDate>Tue, 22 Nov 2011 10:42:00 +0000</pubDate><atom:updated>2011-11-22T17:54:19.337+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jquery</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Working with dropdownlist or combobox using jquery</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/p1-mBTRvCyDpHDa77TqKqFBLwFU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/p1-mBTRvCyDpHDa77TqKqFBLwFU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/p1-mBTRvCyDpHDa77TqKqFBLwFU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/p1-mBTRvCyDpHDa77TqKqFBLwFU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;More often programmers need to work with dropdownlist or combobox using jquery. We need to manipulate the dropdownlist options using jquery scripting. And it is the case that almost always we don't remember how to implement jquery selector. And for all of my readers, who are enthusiastic programmers and/or designers, and for myself, I am discussing in this post the actions with jquery to manipulate asp.net dropdownlist options.
&lt;pre name="code" class="html"&gt;
&lt;asp:DropdownList runat="server" id="ddlTest"&gt;
&lt;asp:ListItem Text="Nepalese Handicraft Products" Value="Nepal"/&gt;
&lt;asp:ListItem Text="Indian Handicraft Products" Value="India"/&gt;
&lt;/asp:DropdownList&gt;
&lt;/pre&gt;
Now append another option using jquery.
&lt;pre name="code" class="javascript"&gt;
$('[id$=ddlTest]').append('&lt;option value="Others"&gt;Others&lt;/option&gt;');
&lt;/pre&gt;

[Why am I using the selector syntax $('[id$=ddlTest]') instead of $('#ddlTest')?
We use #ControlID to select a control with specified id. $= means 'select a control whose id ends with specified value. If you are using master page, the rendered id of the dropdownlist is preceded with some text.]

Now get the selected value from the dropdownlist.
&lt;pre name="code" class="javascript"&gt;
var selVal=$('[id$=ddlTest]').val();
&lt;/pre&gt;

Now get the selected texct from the dropdownlist.
&lt;pre name="code" class="javascript"&gt;
var selTxt=$('[id$=ddlTest] option:selected').text();
&lt;/pre&gt;

Now, select a value programmatically.
&lt;pre name="code" class="javascript"&gt;
var selTxt=$('[id$=ddlTest]').val('Nepal');
&lt;/pre&gt;
And I hope you are comfortable with detecting through jquery when the use selects an item.
Good luck!&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2011%2f11%2fworking-with-dropdownlist-or-combobox.html"&gt;&lt;img src="http%3A%2F%2Fwww.dotnetkicks.com%2FServices%2FImages%2FKickItImageGenerator.ashx%3Furl%3Dhttp%253a%252f%252fdotnetspidor.blogspot.com%252f2011%252f11%252fworking-with-dropdownlist-or-combobox.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-7500196072740062299?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/tLa18QkeQtQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/tLa18QkeQtQ/working-with-dropdownlist-or-combobox.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/11/working-with-dropdownlist-or-combobox.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-7188870713672225823</guid><pubDate>Tue, 18 Oct 2011 12:36:00 +0000</pubDate><atom:updated>2011-10-18T18:07:00.292+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Visual Studio 2010</category><category domain="http://www.blogger.com/atom/ns#">Visual Studio</category><title>Missing File menu in visual studio 2010</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9pHWAUMwIUhvmBS_zAa738H5au4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9pHWAUMwIUhvmBS_zAa738H5au4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9pHWAUMwIUhvmBS_zAa738H5au4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9pHWAUMwIUhvmBS_zAa738H5au4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;I just got irritated to see the file menu in visual studio 2010 missing. All other items of the menu, e.g. Edit, View, Refactor, Project, Build etc. were showing. Only mischievous was the File item. It would be of no value for me if only I could add new project in an existing project. But I couldn't find any such option. I had to workout to recover my lost menu item back. And the way is as discussed below.
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-C_onknIZrPk/Tp1yqaUwDbI/AAAAAAAAAJQ/PLCctDcIFMw/s1600/File%2Bmenu%2Bmissing%2Bin%2Bvisual%2Bstudio%2B2010.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="133" width="400" src="http://1.bp.blogspot.com/-C_onknIZrPk/Tp1yqaUwDbI/AAAAAAAAAJQ/PLCctDcIFMw/s400/File%2Bmenu%2Bmissing%2Bin%2Bvisual%2Bstudio%2B2010.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;


1. Run Visual Studio Command Prompt for VS2010 as Administrator
2. Navigate to C:\Program Files\Microsoft Visual Studio 10.0\Common 7
3. Run devenv with the option /ResetSettings
4. Press enter 
This will reset the default settings for the visual studio and open it.
Now you see the missing File item. Thanks.&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-7188870713672225823?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/lLE7AEHMrOE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/lLE7AEHMrOE/missing-file-menu-in-visual-studio-2010.html</link><author>noreply@blogger.com (Sangam Uprety)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-C_onknIZrPk/Tp1yqaUwDbI/AAAAAAAAAJQ/PLCctDcIFMw/s72-c/File%2Bmenu%2Bmissing%2Bin%2Bvisual%2Bstudio%2B2010.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/10/missing-file-menu-in-visual-studio-2010.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-6300275390652378471</guid><pubDate>Thu, 29 Sep 2011 08:03:00 +0000</pubDate><atom:updated>2011-09-30T17:28:45.905+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET Control</category><category domain="http://www.blogger.com/atom/ns#">jquery</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Disable button in asp net web page to prevent multiple clicks</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/52baWmaBFjY9nlBCP8sCymMzBmo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/52baWmaBFjY9nlBCP8sCymMzBmo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/52baWmaBFjY9nlBCP8sCymMzBmo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/52baWmaBFjY9nlBCP8sCymMzBmo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span xmlns=""&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span xmlns=""&gt;When a user clicks a button and the response is slow, there are chances that user may click the button again. The scenario may occur both when the button postbacks synchronously or asynchronously. This type of multiple clicks could be prevented if we could just disable the button just after the first click and enable it again when the processing is done. This is quite easy to implement the task in both the cases: synchronous and asynchronous postbacks.&lt;/span&gt;&lt;br /&gt;Before we jump on the topic, you may learn &lt;a href="http://dotnetspidor.blogspot.com/2009/05/click-button-on-keypress-in-aspnet.html"&gt;how to click a button on enter key press in an asp.net textbox control&lt;/a&gt;. Similarly you may be interested in displaying &lt;a href="http://dotnetspidor.blogspot.com/2009/03/watermark-aspnet-textbox-using.html"&gt;google search-like watermark in an asp.net textbox control&lt;/a&gt;. Both the tutorials help you work with asp.net button control more interactively.&lt;br/&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-p03SjeETaxs/ToQl1DVTHZI/AAAAAAAAAJI/jKR06IgLgzc/s1600/how+to+disable+button+in+postback+-+c-sharp-asp.net+-+after+button+click.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-p03SjeETaxs/ToQl1DVTHZI/AAAAAAAAAJI/jKR06IgLgzc/s1600/how+to+disable+button+in+postback+-+c-sharp-asp.net+-+after+button+click.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Fig. 1: Just after clicking asp.net button&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-MoH-5ZFxnD8/ToQlq3mSGbI/AAAAAAAAAJE/2s5nWx-l4yw/s1600/how+to+disable+button+in+postback+-+c-sharp-asp.net+-+after+postback.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-MoH-5ZFxnD8/ToQlq3mSGbI/AAAAAAAAAJE/2s5nWx-l4yw/s1600/how+to+disable+button+in+postback+-+c-sharp-asp.net+-+after+postback.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Fig. 2: After postback occurs&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span xmlns=""&gt;If you are using ajax processing on button click, just disable the button when it is clicked and enable it when the ajax processing is done. If you are using full postback on button click, you may just make the button invisible using client-side-scripting when the click occurs. And you don't need to worry about making it visible since after postback the page will be rendered again, with the button visible as usual. In the snippet below I have shown how to 'disable' (in fact disabling won't work since the server side event is not firing) the asp.net button from client side when it is clicked.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;&lt;span xmlns=""&gt;1. Add reference to jquery file&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;span xmlns=""&gt;&lt;/span&gt;
&lt;pre class="html" name="code"&gt;
&lt;span xmlns=""&gt;&lt;script src="js/jquery.js" type="text/javascript"&gt;
&lt;/script&gt;&lt;/span&gt;
&lt;span xmlns=""&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span xmlns=""&gt;&lt;b style="color: red;"&gt;2. Design the web form&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class="html" name="code"&gt;
&lt;form id="form1" runat="server"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;asp:label id="lblMsg" runat="server"&gt;&lt;/asp:label&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;asp:button id="Button1" onclick="Button1_Click" runat="server" text="Click Me!"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span id="spanMsg" style="display: none;"&gt;Processing..&lt;/span&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/asp:button&gt;&lt;/div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/form&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/pre&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;3. Write the client scripting function with jquery&lt;/b&gt;&lt;/div&gt;
&lt;pre class="javascript" name="code"&gt;
&lt;script type="text/javascript"&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(function(){&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; $('[id$=Button1]').click(function(){&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this).css('display','none');&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('span#spanMsg').show();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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; });
&lt;/script&gt;
&lt;/pre&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;4. The code-behind.&lt;/b&gt;&lt;/div&gt;
&lt;pre class="c-sharp" name="code"&gt;
protected void Button1_Click(object sender, EventArgs e)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lblMsg.Text +="Current time : "+ DateTime.Now.ToLongTimeString()+"
";
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&lt;/pre&gt;
That's all. When you click the button you catch the client side click event and make the button just invisible. Meantime show 'processing' or similar message. If you love &lt;a href="http://www.ajaxload.info/"&gt;ajax loading image&lt;/a&gt;, generate one and show it. From codebehind I have just displayed current time in a label.&lt;br /&gt;
&lt;span xmlns=""&gt;Happy &lt;a href="http://www.visitnepal.com/nepal_information/dashain.php"&gt;Bijaya Dashami&lt;/a&gt; (Dashain - the greatest festival of Hindus)!&lt;/span&gt;&lt;br/&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2010%2f01%2fdisable-button-in-asp-net-web-page-to.html"&gt;&lt;img src="http%3A%2F%2Fwww.dotnetkicks.com%2FServices%2FImages%2FKickItImageGenerator.ashx%3Furl%3Dhttp%253a%252f%252fdotnetspidor.blogspot.com%252f2010%252f01%252fdisable-button-in-asp-net-web-page-to.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-6300275390652378471?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/rjROnAbIYtk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/rjROnAbIYtk/disable-button-in-asp-net-web-page-to.html</link><author>noreply@blogger.com (Sangam Uprety)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-p03SjeETaxs/ToQl1DVTHZI/AAAAAAAAAJI/jKR06IgLgzc/s72-c/how+to+disable+button+in+postback+-+c-sharp-asp.net+-+after+button+click.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2010/01/disable-button-in-asp-net-web-page-to.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-8044384311421082332</guid><pubDate>Mon, 26 Sep 2011 09:32:00 +0000</pubDate><atom:updated>2011-09-26T15:07:03.283+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL Server 2005</category><category domain="http://www.blogger.com/atom/ns#">database</category><title>Exclusive access could not be obtained because database is in use-sql server restore database error</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Mt1Q9__iO53SRGmHfKLzKpDBHNs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Mt1Q9__iO53SRGmHfKLzKpDBHNs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Mt1Q9__iO53SRGmHfKLzKpDBHNs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Mt1Q9__iO53SRGmHfKLzKpDBHNs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;While publishing a website to the web server, I took backup of my database. Now I had abc.backup at my hand. Next step was to create a database in the sql server of my host. I did it. Then I uploaded the backup file to the server. When I tried to restore the database I got following error:
&lt;br /&gt;
&lt;blockquote&gt;
Exclusive access could not be obtained because the database is in use&lt;/blockquote&gt;
This error normally discourages because we wonder what exclusive access is this that we need to successfully restore the database. After searching a while you come to conclusion that the database to which we are restoring our backup is in use by one or some users you have already added. The popular solution is - &lt;b&gt;temporarily isolate the user from the database&lt;/b&gt; Easy, if you run this command at your server:
&lt;br /&gt;
&lt;pre class="Sql" name="code"&gt;Use master
go

Alter Database mydbname
SET SINGLE_USER With ROLLBACK IMMEDIATE

 RESTORE DATABASE mydbname
 FROM DISK = 'C:\abc.bak'
&lt;/pre&gt;
Now you are right if you suspect whether we should the roll back to multi user.
Yes this way:
&lt;br /&gt;
&lt;pre class="Sql" name="code"&gt;Use master;
go

ALTER DATABASE mydbname

SET MULTI_USER;
go
&lt;/pre&gt;
Note that we run the commands against the master database, not the candidate database itself.
And did I do the same last time? Nope. I was just happening with a slight mistake. I had created users for the db before I restored the database. So to save yourself from all those stuffs explained above, just create the database in the server, restore your backup file to it and only then create the database users. Done! Thanks.&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2011%2f09%2fexclusive-access-could-not-be-obtained.html"&gt;&lt;img alt="kick it on DotNetKicks.com" border="0" src="http%3A%2F%2Fwww.dotnetkicks.com%2FServices%2FImages%2FKickItImageGenerator.ashx%3Furl%3Dhttp%253a%252f%252fdotnetspidor.blogspot.com%252f2011%252f09%252fexclusive-access-could-not-be-obtained.html" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-8044384311421082332?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/Pl_3hxPoxu4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/Pl_3hxPoxu4/exclusive-access-could-not-be-obtained.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/09/exclusive-access-could-not-be-obtained.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-6100470859909507558</guid><pubDate>Thu, 22 Sep 2011 13:30:00 +0000</pubDate><atom:updated>2011-09-22T19:37:21.780+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/v03-xQVeiYHXVIea9vC1dwHyGtw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v03-xQVeiYHXVIea9vC1dwHyGtw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/v03-xQVeiYHXVIea9vC1dwHyGtw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/v03-xQVeiYHXVIea9vC1dwHyGtw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Last time I got the following error: 
&lt;br /&gt;
&lt;blockquote&gt;
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.&lt;/blockquote&gt;
See in the image below the follo&lt;i&gt;&lt;/i&gt;wing config error, and also watch the config source.
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-CH1_Uuya6bs/Tns9ERg0IAI/AAAAAAAAAI8/VZpVi4POpIE/s1600/duplicate-system.web.extensions-requested-page-cannot-be-accessed.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="329" src="http://3.bp.blogspot.com/-CH1_Uuya6bs/Tns9ERg0IAI/AAAAAAAAAI8/VZpVi4POpIE/s640/duplicate-system.web.extensions-requested-page-cannot-be-accessed.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;blockquote&gt;
There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined&lt;sectiongroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;&lt;/sectiongroup&gt;&lt;/blockquote&gt;
&lt;b&gt;Root of the error&lt;/b&gt;&lt;br /&gt;
I got the error when I was deploying a web application precompiled in asp.net 2.0 onto the production server with asp.net 4.0.
The simple search reveals that it is known issues with VS 2010 and asp.net 2.0. But my site is asp.net 2.0 enabled. What's the root of the error then?
&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;My conclusion (and please correct me if necessary)&lt;/b&gt;
I have configured asp.net web extension namespaces in my web.config file. You don't see this in asp.net 3.5 and 4.0 enabled sites since servers with asp,net 3.5/4.0 by default server asp.net ajax services. But asp.net 2.0 has to be ajax enabled by installing asp.net ajax extension 1.0 which you can &lt;a href="http://www.google.com.np/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;sqi=2&amp;amp;ved=0CBQQFjAA&amp;amp;url=http%3A%2F%2Fwww.microsoft.com%2Fdownload%2Fen%2Fdetails.aspx%3Fid%3D883&amp;amp;rct=j&amp;amp;q=asp.net%20ajax%20extensions%201.0&amp;amp;ei=YDV7TrbkEIrtrQem5NnCDw&amp;amp;usg=AFQjCNF-npeIEMOtNbaQCQ5b-upxq3n0dw&amp;amp;cad=rja"&gt;download from here&lt;/a&gt;.
Sensed duplicate entry of system.web.extension section group? Yes, don't include the following section group in the config section if your site runs on asp.net 2.0 but published on asp.net 3.5/4.0.
&lt;br /&gt;
&lt;pre class="xhtml" name="code"&gt;    
&lt;configsections&gt;
    &lt;sectiongroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
      &lt;sectiongroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
        &lt;section allowdefinition="MachineToApplication" name="scriptResourceHandler" requirepermission="false" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
        &lt;sectiongroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
          &lt;section allowdefinition="Everywhere" name="jsonSerialization" requirepermission="false" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
          &lt;section allowdefinition="MachineToApplication" name="profileService" requirepermission="false" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
          &lt;section allowdefinition="MachineToApplication" name="authenticationService" requirepermission="false" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&gt;
                                   &lt;/section&gt;
                              &lt;/section&gt;
                         &lt;/section&gt;
                    &lt;/sectiongroup&gt;
               &lt;/section&gt;
           &lt;/sectiongroup&gt;
       &lt;/sectiongroup&gt;
&lt;/configsections&gt;&lt;/pre&gt;
Comment out the config section (or remove it if you like), and you are done.
Good luck!
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2011%2f09%2flast-time-i-got-following-error-http.html"&gt;&lt;img src="http%3A%2F%2Fwww.dotnetkicks.com%2FServices%2FImages%2FKickItImageGenerator.ashx%3Furl%3Dhttp%253a%252f%252fdotnetspidor.blogspot.com%252f2011%252f09%252flast-time-i-got-following-error-http.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-6100470859909507558?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/dHu9IXxdDZo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/dHu9IXxdDZo/last-time-i-got-following-error-http.html</link><author>noreply@blogger.com (Sangam Uprety)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-CH1_Uuya6bs/Tns9ERg0IAI/AAAAAAAAAI8/VZpVi4POpIE/s72-c/duplicate-system.web.extensions-requested-page-cannot-be-accessed.jpg" height="72" width="72" /><thr:total>4</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/09/last-time-i-got-following-error-http.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-490032171265700827</guid><pubDate>Fri, 16 Sep 2011 05:58:00 +0000</pubDate><atom:updated>2011-11-07T13:32:14.742+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">CSS</category><title>How to add favicon in your asp-net site?</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OvIJ5x6HeFG_1JavRZQht34S0YI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OvIJ5x6HeFG_1JavRZQht34S0YI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OvIJ5x6HeFG_1JavRZQht34S0YI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OvIJ5x6HeFG_1JavRZQht34S0YI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Make your site impressive and standard by displaying favicon. This is a practice of branding also. See in the following image the red circled area at the top corner. The black filled square is the favicon of &lt;a href="http://dotnetspidor.blogspot.com"&gt;dotnetspidor: A dot net programming blog&lt;/a&gt;. You can see the favicons in almost all of the popular websites.
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-HkqJc99hkJU/TnLlZsA6sGI/AAAAAAAAAIk/apXB-BeHFU0/s1600/add-favicon-in-asp.net-site-make-site-handsome.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="185" width="400" src="http://1.bp.blogspot.com/-HkqJc99hkJU/TnLlZsA6sGI/AAAAAAAAAIk/apXB-BeHFU0/s400/add-favicon-in-asp.net-site-make-site-handsome.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
So how to achieve this?
First create a favicon image of your own. Visualize a great logo/image for the favicon. Save it as favicon.ico. Drop it at the root folder of your site. Now you are one step away - just put the following two links just below the title of header of your form. If you are using master page, just put these lines in the master page and you are done for all the pages.

&lt;pre class="html" name="code"&gt;
&lt;head id="Head1" runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;link id="Link1" runat="server" rel="shortcut icon" href=favicon.ico type="image/x-icon" //&gt;
    &lt;link id="Link2" runat="server" rel="icon" href="favicon.ico" type="image/ico" //&gt;    
&lt;/head&gt;
&lt;/pre&gt;
So why the two lines? Normally the first link works. But for some tricky and picky browsers the second link will work. All the best!
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2011%2f09%2fmake-your-site-impressive-and-standard.html"&gt;&lt;img src="http%3A%2F%2Fwww.dotnetkicks.com%2FServices%2FImages%2FKickItImageGenerator.ashx%3Furl%3Dhttp%253a%252f%252fdotnetspidor.blogspot.com%252f2011%252f09%252fmake-your-site-impressive-and-standard.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-490032171265700827?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/gwSDHqoqgF4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/gwSDHqoqgF4/make-your-site-impressive-and-standard.html</link><author>noreply@blogger.com (Sangam Uprety)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-HkqJc99hkJU/TnLlZsA6sGI/AAAAAAAAAIk/apXB-BeHFU0/s72-c/add-favicon-in-asp.net-site-make-site-handsome.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/09/make-your-site-impressive-and-standard.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-4477698986625552499</guid><pubDate>Sat, 03 Sep 2011 09:45:00 +0000</pubDate><atom:updated>2011-09-22T19:40:33.843+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL Server 2005</category><title>Delete all stored procedures of a database in sql server</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wVXWoZr8xkYm2dlG1tLjmcRqAS4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wVXWoZr8xkYm2dlG1tLjmcRqAS4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wVXWoZr8xkYm2dlG1tLjmcRqAS4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wVXWoZr8xkYm2dlG1tLjmcRqAS4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Sometimes there arises the need of deleting all stored procedures of a database. I came across the same situation when I was generating CRUD operations stored procedures via third party tool. I once changed a table and then had to regenerate all the stored procedures. So went on to find out the way. And ultimately stumbled at http://ctrlf5.net/?p=164.

Here is how to delete all the stored procedures of a sql server database:

&lt;pre class="sql" name="code"&gt;
USE myDBName
GO
DECLARE @procedureName varchar(500)
DECLARE cur CURSOR
      FOR SELECT [name] FROM sys.objects WHERE type = 'p'
      OPEN cur

      FETCH NEXT FROM cur INTO @procedureName
      WHILE @@fetch_status = 0
      BEGIN
            EXEC('DROP PROCEDURE ' + @procedureName)
            FETCH NEXT FROM cur INTO @procedureName
      END
      CLOSE cur
      DEALLOCATE cur
&lt;/pre&gt;

All the best!
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2011%2f09%2fdelete-all-stored-procedures-of.html"&gt;&lt;img src="http%3A%2F%2Fwww.dotnetkicks.com%2FServices%2FImages%2FKickItImageGenerator.ashx%3Furl%3Dhttp%253a%252f%252fdotnetspidor.blogspot.com%252f2011%252f09%252fdelete-all-stored-procedures-of.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-4477698986625552499?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/wmh66G9LiTQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/wmh66G9LiTQ/delete-all-stored-procedures-of.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/09/delete-all-stored-procedures-of.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-5315076182965356097</guid><pubDate>Thu, 11 Aug 2011 07:05:00 +0000</pubDate><atom:updated>2011-08-11T12:42:47.964+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Frequent question on parent and child page refresh, reload, function call in asp-net using javascript</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VxSfKz98YGlHXtu-I-pxEuSFGMM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VxSfKz98YGlHXtu-I-pxEuSFGMM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VxSfKz98YGlHXtu-I-pxEuSFGMM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VxSfKz98YGlHXtu-I-pxEuSFGMM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;There are ways to call client functions in a parent &lt;a href="http://asp.net"&gt;asp.net&lt;/a&gt; web page from the child window. This is very helpful in many ways:&lt;br /&gt;
1. You can refresh parent page after some updates from child pager&lt;br /&gt;
2. You can partially change parts of the parent page&lt;br /&gt;
3. You can control the behaviour of parent page from its child (even from iframe child page)&lt;br /&gt;
&lt;br /&gt;
Example? See the way you edit a section in your blogger blog site. When you are logged in and browsing your blog, blogger lets you edit sections of your blog page directly from the public page of your blog. When you click the edit icon, a window will pop up and load with the setting of the editable section. Now when you save your changes the pop up window will close itself and the parent page (your public page) will be refreshed. Want to implement the same?&lt;br /&gt;
&lt;br /&gt;
You can follow these steps:&lt;br /&gt;
1. Program your parent page to open new window : You can place a hyperlink in your parent page. There are other &lt;a href="http://dotnetspidor.blogspot.com/2009/01/open-new-window-in-aspnet-web-page_28.html"&gt;several ways to open new window in asp.net web page&lt;/a&gt;.&lt;br /&gt;
2. Call client function in parent page : Now you can call client function in parent page from the child page. I have already posted &lt;a href="http://dotnetspidor.blogspot.com/2011/07/refresh-parent-page-from-child-window.html"&gt;how to call javascript function in parent web page from child page&lt;/a&gt;.&lt;br /&gt;
3. Sometimes your child page is a page loaded in iframe from your parent page. In that case it will be a bit different than what I have mentioned in (2). Learn &lt;a href="http://dotnetspidor.blogspot.com/2011/07/refresh-parent-page-partially-from.html"&gt;how to refresh parent parent from iframe child page&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I hope this will help tackle the mostly asked questions on parent and child page programming in &lt;a href="http://asp.net"&gt;asp.net&lt;/a&gt; using javascript.&lt;br /&gt;
&lt;br /&gt;
Happy programming!&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2011%2f08%2ffrequent-question-on-parent-and-child.html"&gt;&lt;img src="http%3A%2F%2Fwww.dotnetkicks.com%2FServices%2FImages%2FKickItImageGenerator.ashx%3Furl%3Dhttp%253a%252f%252fdotnetspidor.blogspot.com%252f2011%252f08%252ffrequent-question-on-parent-and-child.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-5315076182965356097?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/jyYZK916d5w" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/jyYZK916d5w/frequent-question-on-parent-and-child.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/08/frequent-question-on-parent-and-child.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-4279446810257854208</guid><pubDate>Tue, 19 Jul 2011 07:44:00 +0000</pubDate><atom:updated>2011-08-11T19:08:34.993+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">C#</category><title>Refresh parent page partially from iframe without reloading the iframe using javascript in asp.net</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eON2zsy8LyX1zk3CjrmTvYz1Vuc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eON2zsy8LyX1zk3CjrmTvYz1Vuc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eON2zsy8LyX1zk3CjrmTvYz1Vuc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eON2zsy8LyX1zk3CjrmTvYz1Vuc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Last time we talked about &lt;a href="http://dotnetspidor.blogspot.com/2011/07/refresh-parent-page-from-child-window.html"&gt;Refreshing the parent page from child window in asp.net using javascript&lt;/a&gt;. This technique is useful in many scenarios. (If you haven't been through &lt;a href="http://dotnetspidor.blogspot.com/2009/01/open-new-window-in-aspnet-web-page_28.html"&gt;How to open new window in asp.net using javscript and C-sharp&lt;/a&gt;, I would like to suggest to read the post thoroughly. After this you will clearly see why the stuff we are talking about in this post is important.) But programmers using iframe to load another asp.net web page may wonder if we could only partially refresh the parent page so that iframe keeps itself from reloading. This can by done by calling the parent page javascript function from the child page loaded in the iframe. This way we can even avoid the need of ajax to refresh the parent page without affecting the iframe content. As usual I have presented the simple practical approach to tell you as much clearly as possible - follow please. And before continuing, I would like to inform that there is a post regarding &lt;a href="http://dotnetspidor.blogspot.com/2011/08/frequent-question-on-parent-and-child.html"&gt;Frequent question on parent and child page refresh, reload, function call in asp-net using javascript&lt;/a&gt; that discusses, in aggregate, about some more approaches of parent and child page operations.&lt;br /&gt;
&lt;b&gt;Parent Asp.net Page&lt;/b&gt;&lt;br /&gt;
&lt;pre class="html" name="code"&gt;&lt;form id="form1" runat="server"&gt;&lt;div style="width: 600px;"&gt;&lt;div style="font-weight: bold;"&gt;I am the parent page.&lt;/div&gt;&lt;div id="divChildMessage" style="float: left; width: 290px;"&gt;&lt;/div&gt;&lt;div style="float: right;"&gt;&lt;iframe src="Iframe.aspx" height="200px" width="300px"&gt;&lt;/iframe&gt;
        &lt;/div&gt;&lt;div style="float: none;"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/form&gt;&lt;script src="../jquery-1.4.4.min.js" type="text/javascript"&gt;
&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        function displayMessageFromIframeChild(msg)
        {
            $('#divChildMessage').append(msg+'
');
        }
    
&lt;/script&gt;
&lt;/pre&gt;&lt;b&gt;Page to be loaded in parent page iframe&lt;/b&gt;&lt;br /&gt;
&lt;pre class="csharp" name="code"&gt;&lt;form id="form1" runat="server"&gt;&lt;div&gt;I am content of iframe page.
&lt;input id="btnCallParent" type="button" value="Refresh Parent Partially" /&gt;
    &lt;/div&gt;&lt;/form&gt;&lt;script src="../jquery-1.4.4.min.js" type="text/javascript"&gt;
&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        $('#btnCallParent').click(function(){
            var d=new Date();
            window.parent.displayMessageFromIframeChild('I am your iframe child calling on 
'+d.toString()+"&lt;hr/&gt;");
        });
    
&lt;/script&gt;
&lt;/pre&gt;&lt;b&gt;Visualize the output&lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-HIQG5upr2qc/TiU1b9_6vDI/AAAAAAAAAIc/MpgMm1XTMVM/s1600/refresh-parent-page-partially-without-reloading-child-iframe-page-with-javascript-in-asp-net.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img alt="Image: refresh parent page partially from iframe without reloading the iframe using javascript in asp.net" border="0" height="246" src="http://1.bp.blogspot.com/-HIQG5upr2qc/TiU1b9_6vDI/AAAAAAAAAIc/MpgMm1XTMVM/s400/refresh-parent-page-partially-without-reloading-child-iframe-page-with-javascript-in-asp-net.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;What's in the code?&lt;/b&gt;&lt;br /&gt;
You see a button in the child page that is loaded in the iframe of parent page. On click of the button, the javascript function displayMessageFromIframeChild() of the parent page is called. This function displays the string message from child page in a div of the parent page. That's all. Happy programming!&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2011%2f07%2frefresh-parent-page-partially-from.html"&gt;&lt;img alt="kick it on DotNetKicks.com" border="0" src="http%3A%2F%2Fwww.dotnetkicks.com%2FServices%2FImages%2FKickItImageGenerator.ashx%3Furl%3Dhttp%253a%252f%252fdotnetspidor.blogspot.com%252f2011%252f07%252frefresh-parent-page-partially-from.html" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-4279446810257854208?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/oPLT-dEngjI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/oPLT-dEngjI/refresh-parent-page-partially-from.html</link><author>noreply@blogger.com (Sangam Uprety)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-HIQG5upr2qc/TiU1b9_6vDI/AAAAAAAAAIc/MpgMm1XTMVM/s72-c/refresh-parent-page-partially-without-reloading-child-iframe-page-with-javascript-in-asp-net.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/07/refresh-parent-page-partially-from.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-1159833004301920364</guid><pubDate>Thu, 14 Jul 2011 12:55:00 +0000</pubDate><atom:updated>2011-08-11T19:09:08.444+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><category domain="http://www.blogger.com/atom/ns#">C#</category><title>Refresh parent page from child window using javascript in asp.net web application</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rDcM7zH0Do3DjBgnwYiuIcGc1KI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rDcM7zH0Do3DjBgnwYiuIcGc1KI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rDcM7zH0Do3DjBgnwYiuIcGc1KI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rDcM7zH0Do3DjBgnwYiuIcGc1KI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Much often we &lt;a href="http://dotnetspidor.blogspot.com/2009/01/open-new-window-in-aspnet-web-page_28.html"&gt;open child windows from parent web page&lt;/a&gt;. In the child page we perform some activities, and later close the window. At the very time we may need to refresh the parent page so that changes made in the child window be reflected in the parent window. We can easily accomplish this using javascript in asp.net web page. Let me show the way using code snippets. If it is your iframe page, you still can &lt;a href="http://dotnetspidor.blogspot.com/2011/07/refresh-parent-page-partially-from.html"&gt;refresh the parent page partially from page in iframe&lt;/a&gt; (because this will avoid reloading the iframe itself), which I have discussed in &lt;a href="http://dotnetspidor.blogspot.com/2011/07/refresh-parent-page-partially-from.html"&gt;another &lt;/a&gt;post. And right before following, I would like to inform that there is a post regarding &lt;a href="http://dotnetspidor.blogspot.com/2011/08/frequent-question-on-parent-and-child.html"&gt;Frequent question on parent and child page refresh, reload, function call in asp-net using javascript&lt;/a&gt; that discusses, in aggregate, about some more approaches of parent and child page operations.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Parent asp.net web page&lt;/b&gt;&lt;br /&gt;
&lt;pre name="code" class="html"&gt;&lt;form id="form1" runat="server"&gt;&lt;div&gt;&lt;asp:HyperLink ID="hlink1" runat="server" NavigateUrl="Child.aspx" 
        Target="_blank"&gt;Open child window&lt;/asp:HyperLink&gt;        
    &lt;/div&gt;&lt;/form&gt;&lt;/pre&gt;This is the parent page. Clicking the link will open the child page Child.aspx in a new window. If you wish you can &lt;a href="http://dotnetspidor.blogspot.com/2009/01/open-new-window-in-aspnet-web-page_28.html"&gt;Open the new window in asp.net web page in different ways&lt;/a&gt;, which I have already discussed in a previous post.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Child asp.net web page&lt;/b&gt;&lt;br /&gt;
&lt;pre name="code" class="html"&gt;&lt;form id="form1" runat="server"&gt;&lt;div&gt;&lt;p&gt;This is the child page.&lt;/p&gt;&lt;asp:Button ID="btnOk" runat="server" OnClick="btnOk_Click" Text="OK" /&gt;        
    &lt;/div&gt;&lt;/form&gt;&lt;/pre&gt;&lt;pre name="code" class="c-sharp"&gt;protected void btnOk_Click(object sender, EventArgs e)
    { 
        //Implement Your logic here.....
        //..............................
        //now refresh parent page and close this window
        string script = "this.window.opener.location=this.window.opener.location;this.window.close();";
        if (!ClientScript.IsClientScriptBlockRegistered("REFRESH_PARENT"))
            ClientScript.RegisterClientScriptBlock(typeof(string), "REFRESH_PARENT", script, true);        
    }
&lt;/pre&gt;In the child page, I have just put a button. When the button is clicked, the page logic will be implemented (which I have indicated by the comment lines in the event handler of the button in the asp.net child page).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The asp.net plus javascript logic&lt;/b&gt;&lt;br /&gt;
I have just created the javascript stuff that refreshes the parent page of this child page; see the lines:&lt;br /&gt;
this.window.opener.location=this.window.opener.location;this.window.close();&lt;br /&gt;
This line replaces the url of the parent page with its own url - that causes the parent page to reload. And yes, I have registered the javascript code block with ClientScript so that it is executed when the postback life cycle of this child page completes.&lt;br /&gt;
&lt;br /&gt;
Happy programming!&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2011%2f07%2frefresh-parent-page-from-child-window.html"&gt;&lt;img src="http%3A%2F%2Fwww.dotnetkicks.com%2FServices%2FImages%2FKickItImageGenerator.ashx%3Furl%3Dhttp%253a%252f%252fdotnetspidor.blogspot.com%252f2011%252f07%252frefresh-parent-page-from-child-window.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-1159833004301920364?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/5l0mCU8fioQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/5l0mCU8fioQ/refresh-parent-page-from-child-window.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>4</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/07/refresh-parent-page-from-child-window.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-5887735518338878952</guid><pubDate>Mon, 11 Jul 2011 10:09:00 +0000</pubDate><atom:updated>2011-07-11T15:41:34.300+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">C#</category><title>C# - Copy files and folders recursively from source to destination folder in c-sharp</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/SH9XTLWDeoJTwdxJCmczJjQGKiA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SH9XTLWDeoJTwdxJCmczJjQGKiA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/SH9XTLWDeoJTwdxJCmczJjQGKiA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/SH9XTLWDeoJTwdxJCmczJjQGKiA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In C#, there is no built in function to recursively bulk-copy all files and folders from source to destination folder. So this has to be done manually by the programmer. Being a lover of reusability feature of object oriented programming, I googled and stumbled on the code snippet below:&lt;br /&gt;
&lt;pre name="code" class="csharp"&gt;/// &lt;summary&gt;
    /// Copy folder to another folder recursively
    /// &lt;/summary&gt;
    /// &lt;param name="sourceFolder"&gt;&lt;/param&gt;/// &lt;param name="destFolder"&gt;&lt;/param&gt;public static void CopyFolder(string sourceFolder, string destFolder)
    {
        if (!Directory.Exists(destFolder))
            Directory.CreateDirectory(destFolder);
        string[] files = Directory.GetFiles(sourceFolder);
        foreach (string file in files)
        {
            string name = Path.GetFileName(file);
            string dest = Path.Combine(destFolder, name);
            File.Copy(file, dest);
        }
        string[] folders = Directory.GetDirectories(sourceFolder);
        foreach (string folder in folders)
        {
            string name = Path.GetFileName(folder);
            string dest = Path.Combine(destFolder, name);
            CopyFolder(folder, dest);
        }
    }
&lt;/pre&gt;Note that all files at the source folder have been copied to the destination folder. But folder and files within them have been copied using recursion - see the function of second foreach construct.&lt;br /&gt;
&lt;br /&gt;
Shortcomings? Yes, no exception handling has been done in the snippet. However, the functionality is ok! Thanks to &lt;a href="http://www.csharp411.com/c-copy-folder-recursively/"&gt;csharp411.com&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-5887735518338878952?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/84k-R9Gy3go" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/84k-R9Gy3go/c-copy-files-and-folders-recursively.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/07/c-copy-files-and-folders-recursively.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-6113445646576085479</guid><pubDate>Sat, 18 Jun 2011 08:27:00 +0000</pubDate><atom:updated>2011-08-11T12:37:24.597+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET Control</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Page is null at the c# class library control</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-n2nZkInyF0iAmiPlm3Bau6YzKk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-n2nZkInyF0iAmiPlm3Bau6YzKk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-n2nZkInyF0iAmiPlm3Bau6YzKk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-n2nZkInyF0iAmiPlm3Bau6YzKk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Hi all.&lt;br /&gt;
Just caught up in the mess when I came to see : the parent page of one of my class library control was null at runtime. That means the call:&lt;br /&gt;
Page.ClientScript.GetWebResourceUrl([control-type],[full-resource-url]); &lt;br /&gt;
would fail.&lt;br /&gt;
&lt;br /&gt;
I have been suggested &lt;b&gt;this happens when my parent page is being rendered within an iframe&lt;/b&gt;. But this was &lt;b&gt;not the case for now&lt;/b&gt;. I was just using a placeholder to dynamically add the control. So what&amp;#39;s the solution?&lt;br /&gt;
&lt;br /&gt;
Yes it came around after some googling, try this:&lt;br /&gt;
&lt;br /&gt;
(Page)HttpContext.Current.Handler).ClientScript.GetWebResourceUrl([control-type],[full-resource-url]); &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What&amp;#39;s in here?&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
The Page that refers to the Page control containing this dynamic control is achieved through current request handler. This avoids the problem since the request was generated by the page. But mere Page or this.Page or this.Parent.Page or whatsoever might have been missed due to the hierarchy of the controls or &lt;b&gt;is it due to anything else?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Hope this helps. Sweet programming!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-6113445646576085479?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/UQGGOCUW3U4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/UQGGOCUW3U4/page-is-null-at-c-class-library-control.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2011/06/page-is-null-at-c-class-library-control.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-1599358694869106939</guid><pubDate>Fri, 31 Dec 2010 07:46:00 +0000</pubDate><atom:updated>2011-08-11T12:37:15.024+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Request.Url - Asp.Net Path Details</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ypZ7Em5HCmr0ogMaiBfC1ncJd_I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ypZ7Em5HCmr0ogMaiBfC1ncJd_I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ypZ7Em5HCmr0ogMaiBfC1ncJd_I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ypZ7Em5HCmr0ogMaiBfC1ncJd_I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Hi all. Returned back to the blogging world after nearly a year! Welcome back!&lt;br /&gt;
And Happy New Year 2011.&lt;br /&gt;
Here is my self-note to save my day googling!&lt;br /&gt;
&lt;br /&gt;
Request.Url&lt;br /&gt;
Full URL : http://localhost:2000/virtual_dir/myrep/page.aspx?q=qvalue&lt;br /&gt;
&lt;table cellpadding="1px" cellspacing="1px" rules="all" style="border: 1px solid green;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.ApplicationPath :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;/virtual_dir&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.CurrentExecutionFilePath :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;/virtual_dir/myrep/page.aspx&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.FilePath :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;/virtual_dir/myrep/page.aspx&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.Path :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;/virtual_dir/myrep/page.aspx&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.PhysicalApplicationPath &lt;/td&gt;&lt;td style="padding: 4px;"&gt;d:\Inetpub\wwwroot\Websitename\virtual_dir\&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.QueryString :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;/virtual_dir/myrep/page.aspx?q=qvalue &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.Url.AbsolutePath :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;/virtual_dir/myrep/page.aspx &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.Url.AbsoluteUri :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;&lt;br /&gt;
http://localhost:2000/virtual_dir/myrep/page.aspx?q=qvalue&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.Url.Host :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;localhost &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.Url.Authority :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;localhost:2000&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.Url.LocalPath :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;/virtual_dir/myrep/page.aspx&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.Url.PathAndQuery :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;/virtual_dir/myrep/page.aspx?q=qvalue&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.Url.Port :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;2000&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.Url.Query :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;?q=qvalue&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.Url.Scheme :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;http&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style="padding: 4px;"&gt;Request.Url.Segments :&lt;/td&gt;&lt;td style="padding: 4px;"&gt;/virtual_dir/&lt;br /&gt;
myrep/&lt;br /&gt;
page.aspx&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
Source:  http://www.xcess.info/request_url_parameters_details_asp_net_aen.aspx&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-1599358694869106939?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/sAo8OA0eXjE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/sAo8OA0eXjE/requesturl-aspnet-path-details.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2010/12/requesturl-aspnet-path-details.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-491880799962007309</guid><pubDate>Thu, 31 Dec 2009 12:17:00 +0000</pubDate><atom:updated>2009-12-31T19:33:40.588+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Nepal</category><title>Happy New Year 2010!</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tSDEjdJJwFV9QWkWznrGd9XUKmk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tSDEjdJJwFV9QWkWznrGd9XUKmk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tSDEjdJJwFV9QWkWznrGd9XUKmk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tSDEjdJJwFV9QWkWznrGd9XUKmk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href="http://3.bp.blogspot.com/_1sICTF7VWbI/SzyYiaCL-7I/AAAAAAAAAGg/E4k7HeByBh4/s1600-h/nepal+-+country+of+temples.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 290px;" src="http://3.bp.blogspot.com/_1sICTF7VWbI/SzyYiaCL-7I/AAAAAAAAAGg/E4k7HeByBh4/s400/nepal+-+country+of+temples.jpg" border="0" alt="Nepal: Country of rich culture" id="BLOGGER_PHOTO_ID_5421375768318704562" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Hey World, Happy New Year 2010!&lt;/p&gt;  &lt;p&gt;Enjoy your holidays. Forget all the odds of 2009 and plan meaningful life for 2010!&lt;/p&gt;&lt;p&gt;&lt;p&gt;  &lt;p&gt;Wherever you spend your holidays this year-end, enjoy it with all your heart. And please accept my warm invitation to spend your holidays of New Year 2011 in &lt;a href="http://www.welcomenepal.com/"&gt;Nepal&lt;/a&gt; – a world of its own! We are celebrating 2011 as &lt;a href="http://nepaltourismyear2011.com/"&gt;Nepal Tourism Year – 2011&lt;/a&gt;. My kind request to add this year into your calendar so that your won’t miss what this mysterious country has to offer you – from Natural beauty to the Mt. Everest, from Hindu’s holy Pashupatinath to Buddhist’s holy Lumbini- the birth place of Lord Buddha, from the miraculous flora and fauna to the diversity of social and cultural property!&lt;/p&gt;&lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_1sICTF7VWbI/SzyY3Eq9q5I/AAAAAAAAAGw/i45n7uDonoA/s1600-h/nepal+-+country+of+mountains.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_1sICTF7VWbI/SzyY3Eq9q5I/AAAAAAAAAGw/i45n7uDonoA/s400/nepal+-+country+of+mountains.jpg" border="0" alt="Nepal: Country of Mountains" id="BLOGGER_PHOTO_ID_5421376123361405842" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Source of photos: &lt;a href="http://nepalgallery.wordpress.com"&gt;Nepal Gallery&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Many many happy returns! Happy new year 2010!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-491880799962007309?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/yGW1XRvB-aU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/yGW1XRvB-aU/happy-new-year-2010.html</link><author>noreply@blogger.com (Sangam Uprety)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_1sICTF7VWbI/SzyYiaCL-7I/AAAAAAAAAGg/E4k7HeByBh4/s72-c/nepal+-+country+of+temples.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2009/12/happy-new-year-2010.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-9178389738237797007</guid><pubDate>Fri, 18 Dec 2009 12:28:00 +0000</pubDate><atom:updated>2009-12-18T18:21:35.956+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jquery</category><title>Toggle image using jquery for animated hide show in asp-net</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/nu1rTzmiU-4FL7dYGfVfKJa9wxs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nu1rTzmiU-4FL7dYGfVfKJa9wxs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/nu1rTzmiU-4FL7dYGfVfKJa9wxs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/nu1rTzmiU-4FL7dYGfVfKJa9wxs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span xmlns=''&gt;&lt;p&gt;Web masters find it attractive to mark or indicate some text in a page as special part. For example a featured product in a shopping cart would hold a finished &lt;em&gt;featured &lt;/em&gt;icon image at its side. Similarly we see &lt;em&gt;New &lt;/em&gt;image icon blinking at the side of some product or text. It is sometimes better by far to use such animated images to draw user's attention. How would you do this using jquery? The simple answer is that- &lt;strong&gt;toggle the image based on its display status, in a regular interval&lt;/strong&gt;. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_1sICTF7VWbI/Syt5KPLl9rI/AAAAAAAAAGY/kJL8oJs8-6g/s1600-h/toggle+image+using+jquery+in+asp.net.gif"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 163px;" src="http://3.bp.blogspot.com/_1sICTF7VWbI/Syt5KPLl9rI/AAAAAAAAAGY/kJL8oJs8-6g/s400/toggle+image+using+jquery+in+asp.net.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5416556193623963314" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;There exists a simple method in jquery plugin that accomplished this task: &lt;br /&gt;&lt;/p&gt;&lt;p&gt;$('my-image-selector').toggle();&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Let's look at the simple example.&lt;br /&gt;&lt;/p&gt;&lt;pre name="code" class="html"&gt;&amp;lt;table&amp;gt;&lt;br /&gt;            &amp;lt;tr&amp;gt;&lt;br /&gt;                &amp;lt;td&amp;gt;This is some test news.&amp;lt;/td&amp;gt;&lt;br /&gt;                &amp;lt;td style=&amp;quot;height:45px&amp;quot;&amp;gt;&amp;lt;img id=&amp;quot;newImage&amp;quot; src=&amp;quot;../images/new.jpg&amp;quot;&lt;br /&gt;                 alt=&amp;quot;New!&amp;quot; height=&amp;quot;40px&amp;quot; width=&amp;quot;40px&amp;quot;/&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;            &amp;lt;/tr&amp;gt;&lt;br /&gt;        &amp;lt;/table&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre name="code" class="html"&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;        $(function(){&lt;br /&gt;            setInterval(imageFlickr,300);                        &lt;br /&gt;        });&lt;br /&gt;        &lt;br /&gt;        function imageFlickr()&lt;br /&gt;        {&lt;br /&gt;            $(&amp;quot;#newImage&amp;quot;).toggle(200);            &lt;br /&gt;        }       &lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;br /&gt; &lt;p&gt;In the page, I have added an image in a column of a table. Please use your own image (perhaps some 'New' image, as in the image above). Note the javascript setInterval() method that calls the function imageFlickr() every 300ms. In the method, we have the line:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-family:Courier New; font-size:10pt'&gt;$(&lt;span style='color:#a31515'&gt;"#newImage"&lt;/span&gt;).toggle();&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;The $(selector).toggle(interval) method toggles the show/hide property of the element. In the code, I haven't used the interval argument of toggle method. The interval in milliseconds defines the fade-in or fade-out speed of the element. Try this once and you will see great effect: &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style='font-family:Courier New; font-size:10pt'&gt;$(&lt;span style='color:#a31515'&gt;"#newImage"&lt;/span&gt;).toggle(200);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style='background: white'&gt;&lt;span style='color:black'&gt;You are warmly welcome to share your experiences. You can start discussion by adding comments from the form below. You can help spreading out the words by bookmarking this article to &lt;br/&gt;any of your favourite bookmarking site! &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style='background: white'&gt;&lt;span style='color:black'&gt;Happy Programming!&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2009%2f12%2ftoggle-image-using-jquery-for-animated.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2009%2f12%2ftoggle-image-using-jquery-for-animated.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-9178389738237797007?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/bA4THCpCOSc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/bA4THCpCOSc/toggle-image-using-jquery-for-animated.html</link><author>noreply@blogger.com (Sangam Uprety)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_1sICTF7VWbI/Syt5KPLl9rI/AAAAAAAAAGY/kJL8oJs8-6g/s72-c/toggle+image+using+jquery+in+asp.net.gif" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2009/12/toggle-image-using-jquery-for-animated.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-8277225059629425419</guid><pubDate>Wed, 02 Dec 2009 13:26:00 +0000</pubDate><atom:updated>2009-12-02T19:42:17.590+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Prevent page postback on enter key press in textbox in asp-net web page</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FQMUuqjHoDt9rX9CBTTs8YK02JE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FQMUuqjHoDt9rX9CBTTs8YK02JE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FQMUuqjHoDt9rX9CBTTs8YK02JE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FQMUuqjHoDt9rX9CBTTs8YK02JE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;In an asp.net web page, you may have experienced that pressing enter key postbacks the page. For example, take the following scenario:&lt;/p&gt;&lt;pre name="code" class="html"&gt;&amp;lt;table&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;tr&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;td&amp;gt;Name&amp;lt;/td&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID=&amp;quot;txtName&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;tr&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;td&amp;gt;Email&amp;lt;/td&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID=&amp;quot;txtEmail&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;tr&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;td colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;&lt;br&gt;                    &amp;lt;asp:Button ID=&amp;quot;btnOK&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;OK&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;/td&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br&gt;        &amp;lt;/table&amp;gt;&lt;/pre&gt;  &lt;p&gt;In the page, if you press enter key in any of the textboxes, the page will postback, which is not desired.&lt;/p&gt;&lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_1sICTF7VWbI/SxZu9cdaNHI/AAAAAAAAAFs/-MLHd_meCQU/s1600-h/page-+prevent+postback+on+enter+key+press+in+asp.net+textbox.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 314px; height: 96px;" src="http://4.bp.blogspot.com/_1sICTF7VWbI/SxZu9cdaNHI/AAAAAAAAAFs/-MLHd_meCQU/s400/page-+prevent+postback+on+enter+key+press+in+asp.net+textbox.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5410634004222850162" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;1.0 What’s the reason?&lt;/strong&gt;     &lt;br /&gt;Lets look at the html markup generated for the page:&lt;/p&gt;&lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_1sICTF7VWbI/SxZwtD3B5UI/AAAAAAAAAF0/w2xFCmxx9wc/s1600-h/html+markup-+prevent+postback+in+asp.net+web+page+by+enter+key+press+in+textbox.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 340px;" src="http://2.bp.blogspot.com/_1sICTF7VWbI/SxZwtD3B5UI/AAAAAAAAAF0/w2xFCmxx9wc/s400/html+markup-+prevent+postback+in+asp.net+web+page+by+enter+key+press+in+textbox.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5410635921764771138" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The asp.net button control has been rendered with “submit” type, which is the reason of page postback when enter key is pressed in any of the textboxes. Note the following line in the image above: &lt;pre name="code" class="html"&gt;&amp;lt;input id=&amp;quot;btnOK&amp;quot; type=&amp;quot;submit&amp;quot; value=&amp;quot;OK&amp;quot; name=&amp;quot;btnOK&amp;quot;/&amp;gt;&lt;/pre&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;2.0 The Way Out&lt;/strong&gt;     &lt;br /&gt;We can use two different approaches to prevent postback on enter key-press in any of the textboxes:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;1. Using UseSubmitBehavior=&amp;quot;false&amp;quot; in the asp.net button control’s markup&lt;/strong&gt;&lt;/em&gt;     &lt;br /&gt;We can set UseSubmitBehavior=&amp;quot;false&amp;quot; in the button markup:&lt;/p&gt;&lt;pre name="code" class="html"&gt;&amp;lt;table&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;tr&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;td&amp;gt;Name&amp;lt;/td&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID=&amp;quot;txtName&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;tr&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;td&amp;gt;Email&amp;lt;/td&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;td&amp;gt;&amp;lt;asp:TextBox ID=&amp;quot;txtEmail&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;tr&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;td colspan=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;&lt;br&gt;                    &amp;lt;asp:Button ID=&amp;quot;btnOK&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;OK&amp;quot; UseSubmitBehavior=&amp;quot;false&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br&gt;                &amp;lt;/td&amp;gt;&lt;br /&gt;&lt;br&gt;            &amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br&gt;        &amp;lt;/table&amp;gt;&lt;/pre&gt;  &lt;p&gt;This stops rendering the button as type=”submit”. Now the rendered markup for the button will be:&lt;/p&gt;&lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_1sICTF7VWbI/SxZzMlx7e3I/AAAAAAAAAF8/skq6jjOByV0/s1600-h/html+markup-+prevent+postback+in+asp.net+web+page+by+enter+key+press+in+textbox+after+submit+behaviour.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 187px;" src="http://2.bp.blogspot.com/_1sICTF7VWbI/SxZzMlx7e3I/AAAAAAAAAF8/skq6jjOByV0/s400/html+markup-+prevent+postback+in+asp.net+web+page+by+enter+key+press+in+textbox+after+submit+behaviour.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5410638662469385074" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Not the following line in the image above as captured from firebug:&lt;/p&gt;&lt;pre name="code" class="html"&gt;&amp;lt;input id=&amp;quot;btnOK&amp;quot; type=&amp;quot;button&amp;quot; onclick=&amp;quot;javascript:__doPostBack('btnOK','')&amp;quot; value=&amp;quot;OK&amp;quot; name=&amp;quot;btnOK&amp;quot;/&amp;gt;&lt;/pre&gt; This shows that there is no more type="submit" attribute, rather onclick="javascript:__doPostBack('btnOK','') has been added. &lt;p&gt;So you have successfully stopped the page postback now!&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;2. Prevent enter key press in all the textboxes&lt;/strong&gt;&lt;/em&gt;     &lt;br /&gt;One another way to stop the page postback is to prevent enter key press in any of the textboxes. We can use jquery to easily perform the task. This way:&lt;/p&gt;&lt;pre name="code" class="javascript"&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&lt;br&gt;        $(function(){&lt;br /&gt;&lt;br&gt;            $(':text').bind('keydown',function(e){ //on keydown for all textboxes&lt;br /&gt;&lt;br&gt;                if(e.keyCode==13) //if this is enter key&lt;br /&gt;&lt;br&gt;                    e.preventDefault();                &lt;br /&gt;&lt;br&gt;            });&lt;br /&gt;&lt;br&gt;        });&lt;br /&gt;&lt;br&gt;    &amp;lt;/script&amp;gt;&lt;/pre&gt;  &lt;p&gt;On page load, all the textboxes in the form are bound to the keydown event to a function. In the function we check if the key pressed in the ‘enter key’. If so, we prevent the further bubbling of the event. Hence it prevents the page postback.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Note: You will need to reference the latest jquery file in the page to use the second technique.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;3.0 Conclusion      &lt;br /&gt;&lt;/strong&gt;We looked at two ways to prevent page postback on enter-key press in a textbox in asp.net web page. Both the techniques work well. But I would prefer the first one since this would save the extra client side manipulations in the user’s machine.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;4.0 Looking towards hearing from you!      &lt;br /&gt;&lt;/strong&gt;You are warmly welcome to share your experiences. You can start discussion by adding comments from the form below. You can help spreading out the words by bookmarking this article to any of your favourite bookmarking site! &lt;/p&gt;  &lt;p&gt;Happy Programming!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2009%2f12%2fprevent-page-postback-on-enter-key.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2009%2f12%2fprevent-page-postback-on-enter-key.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-8277225059629425419?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/nbh1UORptAg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/nbh1UORptAg/prevent-page-postback-on-enter-key.html</link><author>noreply@blogger.com (Sangam Uprety)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_1sICTF7VWbI/SxZu9cdaNHI/AAAAAAAAAFs/-MLHd_meCQU/s72-c/page-+prevent+postback+on+enter+key+press+in+asp.net+textbox.JPG" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2009/12/prevent-page-postback-on-enter-key.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-8012312715800361204</guid><pubDate>Wed, 28 Oct 2009 11:26:00 +0000</pubDate><atom:updated>2009-10-28T17:45:39.045+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">jquery</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>jQuery Mutually exclusive checkboxes in asp.net</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BuFzeXcO9Y-xC_yXj3I2-4zEzxI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BuFzeXcO9Y-xC_yXj3I2-4zEzxI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BuFzeXcO9Y-xC_yXj3I2-4zEzxI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BuFzeXcO9Y-xC_yXj3I2-4zEzxI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;We often see radio buttons to implement single choices out of many in web forms. Wouldn’t it be better if we could imply ‘choose one option from many’ using checkboxes? I have implemented such mutually exclusive checkboxes in asp.net using jquery. This certainly is not any new practice. We have already seen such mutually exclusive checkboxes in asp.net ajax, and perhaps there are others also. But achieving this functionality using a lightweight javascript library like jquery would be a benefit. So let’s start the race. &lt;/p&gt;  &lt;p&gt;First of all, let me present the design philosophy of this realization of mutually exclusive checkboxes. &lt;/p&gt;  &lt;p&gt;1. We will have a group of checkboxes with same css class name. We will not need the id of checkboxes besides for associating label to display text and make label clickable.&lt;/p&gt;  &lt;p&gt;2. For our example, initially we will check one of the checkboxes. You may wish not to and this will work.&lt;/p&gt;  &lt;p&gt;3. We can add any number of such groups of checkboxes but each group will have distinct class name. For example, one group of checkboxes can have class name ‘class1’ and other can have ‘class2’ and so on.&lt;/p&gt;  &lt;p&gt;4. When a checkbox is checked, if it is already checked nothing will happen, otherwise this checkbox will be checked and all other checkboxes having the same class name as of this checked one will be unchecked.&lt;/p&gt;  &lt;p&gt;5. If a checkbox is unchecked, we re-check it, since we want at least one checkbox checked. We can let a checkbox get unchecked if our requirement does not demand at least one option checked, but for this tutorial we will not let so.&lt;/p&gt;  &lt;p&gt;By this time we have realized the need and design philosophy of implementing mutually exclusive checkboxes in asp.net using jquery. Now let’s proceed on.&lt;/p&gt;  &lt;p&gt;We need the latest version of jquery which is &lt;a href="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"&gt;available here&lt;/a&gt; [latest version is jquery 1.3.2 till date].&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_1sICTF7VWbI/SugrkwpFgeI/AAAAAAAAAFM/qYWvzXtUCUA/s1600-h/jquery+library+added+in+asp-net+website+project.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 268px; height: 157px;" src="http://3.bp.blogspot.com/_1sICTF7VWbI/SugrkwpFgeI/AAAAAAAAAFM/qYWvzXtUCUA/s400/jquery+library+added+in+asp-net+website+project.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5397612063936053730" /&gt;&lt;/a&gt;&lt;br/&gt;&lt;i&gt;Fig:1 jQuery library added in asp.net website project&lt;/i&gt;&lt;/p&gt;&lt;p&gt;Now reference the jquery library file in the head section of the design page.&lt;/p&gt;&lt;a href="http://3.bp.blogspot.com/_1sICTF7VWbI/SugsL3vl6mI/AAAAAAAAAFU/1o0trG0y4G8/s1600-h/jquery+library+file+referenced+in+head+section+of+asp-net+design+page.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 82px;" src="http://3.bp.blogspot.com/_1sICTF7VWbI/SugsL3vl6mI/AAAAAAAAAFU/1o0trG0y4G8/s400/jquery+library+file+referenced+in+head+section+of+asp-net+design+page.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5397612735857289826" /&gt;&lt;/a&gt;&lt;br/&gt;&lt;i&gt;Fig:2 jQuery libray referenced in the header section of asp.net design page&lt;/i&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Here goes the design markup code in the aspx page.&lt;/p&gt; &lt;pre name="code" class="html"&gt;&amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;asp:Label ID=&amp;quot;lblResult&amp;quot; runat=&amp;quot;server&amp;quot; ForeColor=&amp;quot;Green&amp;quot;&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;    &amp;lt;div id=&amp;quot;toggleContainer&amp;quot;&amp;gt;&lt;br /&gt;        I like to mix  &lt;br /&gt;        &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;aspnet&amp;quot; class=&amp;quot;firstClass&amp;quot; checked=&amp;quot;checked&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;         &amp;lt;label for=&amp;quot;aspnet&amp;quot;&amp;gt;asp.net&amp;lt;/label&amp;gt;&lt;br /&gt;        &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;php&amp;quot; class=&amp;quot;firstClass&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;label for=&amp;quot;php&amp;quot;&amp;gt;php&amp;lt;/label&amp;gt;&lt;br /&gt;        &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;jsp&amp;quot; class=&amp;quot;firstClass&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;label for=&amp;quot;jsp&amp;quot;&amp;gt;jsp&amp;lt;/label&amp;gt;&lt;br /&gt;        &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;asp&amp;quot; class=&amp;quot;firstClass&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;   &lt;br /&gt;        &amp;lt;label for=&amp;quot;asp&amp;quot;&amp;gt;asp&amp;lt;/label&amp;gt;     &lt;br /&gt;        &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt; with  &lt;br /&gt;        &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;jquery&amp;quot; class=&amp;quot;secondClass&amp;quot; checked=&amp;quot;checked&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;label for=&amp;quot;jquery&amp;quot;&amp;gt;jquery&amp;lt;/label&amp;gt;&lt;br /&gt;        &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;javascript&amp;quot; class=&amp;quot;secondClass&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;label for=&amp;quot;javascript&amp;quot;&amp;gt;pure javascript&amp;lt;/label&amp;gt;&lt;br /&gt;        &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;aspnetajax&amp;quot; class=&amp;quot;secondClass&amp;quot; runat=&amp;quot;server&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;label for=&amp;quot;aspnetajax&amp;quot;&amp;gt;asp.net ajax&amp;lt;/label&amp;gt;&lt;br /&gt;        &amp;lt;input type=&amp;quot;checkbox&amp;quot; id=&amp;quot;thirdajax&amp;quot; class=&amp;quot;secondClass&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;label for=&amp;quot;thirdajax&amp;quot;&amp;gt;third party ajax&amp;lt;/label&amp;gt;&lt;br /&gt;        &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;        &amp;lt;asp:Button ID=&amp;quot;btnResult&amp;quot; runat=&amp;quot;server&amp;quot; OnClick=&amp;quot;btnResult_Click&amp;quot; Text=&amp;quot;Show Result!&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;/form&amp;gt;&lt;/pre&gt; &lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_1sICTF7VWbI/SugtD-EGhBI/AAAAAAAAAFc/2lCk1ueorJ0/s1600-h/mutually+exclusive+checkboxes+at+initial+state+in+asp-net+web+page.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 104px;" src="http://4.bp.blogspot.com/_1sICTF7VWbI/SugtD-EGhBI/AAAAAAAAAFc/2lCk1ueorJ0/s400/mutually+exclusive+checkboxes+at+initial+state+in+asp-net+web+page.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5397613699626599442" /&gt;&lt;/a&gt;&lt;br/&gt;&lt;i&gt;Fig:3 Mutually exclusive checkboxes at initial state&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;As shown in the page code above, we have three different groups of checkboxes having class names firstClass and secondClass. Each group has one checkbox checked initially.&lt;/p&gt;  &lt;p&gt;Now is the time to use and understand the jquery script in the page. Here is the complete code in the script block.&lt;/p&gt;  &lt;pre name="code" class="javascript"&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;      $(document).ready(function(){&lt;br /&gt;            //toggle all checkboxes in toggleContainer div&lt;br /&gt;            $('#toggleContainer :checkbox').bind('change',function(){&lt;br /&gt;                var thisClass=$(this).attr('class');&lt;br /&gt;                if($(this).attr('checked'))&lt;br /&gt;                {&lt;br /&gt;                    $('#toggleContainer :checkbox.'+thisClass+&amp;quot;:not(#&amp;quot;+this.id+&amp;quot;)&amp;quot;).removeAttr('checked');    &lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    $(this).attr('checked','checked');                          &lt;br /&gt;                }&lt;br /&gt;            });&lt;br /&gt;        });&lt;br /&gt;    &amp;lt;/script&amp;gt;&lt;/pre&gt;  &lt;p&gt;&lt;b&gt;Explanation of jquery code snippet&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;1. We put all the codes that are required to run at the page load within document’s ready event handler code block, so the first line.&lt;/p&gt;  &lt;p&gt;2. toggleContainer is the div element we put all our checkboxes. We have done this to avoid collision with other checkboxes in the page. For all checkboxes [as by :checkbox selector] within this div element we bind change event. So, the following code block will execute when any checkbox is checked or unchecked.&lt;/p&gt;  &lt;p&gt;3. In the change event, we read the class name of the current checkbox in thisClass variable. Note that we are reading the value of attribute class [as by .attr method, used to get or set value of an attribute]&lt;/p&gt;  &lt;p&gt;4. If this checkbox has attribute ‘checked’, this means we are checking this checkbox exclusive of others in its group. So we uncheck all checkboxes other than itself having class name of this checkbox [stored in variable thisClass]. How we achieve this- uncheck all checkboxes other than this? Answer is: using : not[itself] selector. This selector excludes the matching dom element from the result.&lt;/p&gt;  &lt;p&gt;5. If this class has no ‘checked’ attribute, this means the previously checked chexbox has been tried to uncheck which we prevent by re-checking this checkbox since this violates our design philosophy.&lt;/p&gt;  &lt;p&gt;That’s all.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Reading Result&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Remember the Show Result button in the pages? Yeah, we will publish the result as of user’s selections. Here goes the code-behind code snippet.&lt;/p&gt;  &lt;pre name="code" class="csharp"&gt;//prints your choices in the result label&lt;br /&gt;    protected void btnResult_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        string result = "Oh, you like to mix &lt;b&gt;";&lt;br /&gt;        if (asp.Checked)&lt;br /&gt;            result += "asp";&lt;br /&gt;        else if (aspnet.Checked)&lt;br /&gt;            result += "asp.net";&lt;br /&gt;        else if (php.Checked)&lt;br /&gt;            result += "php";&lt;br /&gt;        else&lt;br /&gt;            result += "jsp";&lt;br /&gt;&lt;br /&gt;        result += "&lt;/b&gt; with &lt;b&gt;";&lt;br /&gt;&lt;br /&gt;        if (jquery.Checked)&lt;br /&gt;            result += "jquery ajax!";&lt;br /&gt;        else if (javascript.Checked)&lt;br /&gt;            result += "pure javascript ajax!";&lt;br /&gt;        else if (aspnetajax.Checked)&lt;br /&gt;            result += "asp.net ajax!";&lt;br /&gt;        else&lt;br /&gt;            result += "other third party ajax!";&lt;br /&gt;&lt;br /&gt;        result += "&lt;/b&gt;";&lt;br /&gt;&lt;br /&gt;        lblResult.Text = result;&lt;br /&gt;    }&lt;/pre&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_1sICTF7VWbI/SuguHJhSTpI/AAAAAAAAAFk/0otZL0pr_jU/s1600-h/mutually+exclusive+checkboxes+in+action+in+asp-net+web+page.JPG"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 108px;" src="http://1.bp.blogspot.com/_1sICTF7VWbI/SuguHJhSTpI/AAAAAAAAAFk/0otZL0pr_jU/s400/mutually+exclusive+checkboxes+in+action+in+asp-net+web+page.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5397614853753032338" /&gt;&lt;/a&gt;&lt;br/&gt;&lt;i&gt;Fig:4 Mutually exclusive checkboxes in action&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;In this simple yet descriptive tutorial we implemented mutually exclusive checkboxes in asp.net using latest javascript jquery library. Since we used class property of checkboxes, we have been able to implement this with any number of distinct groups of checkboxes. If you enjoyed this tutorial, please spread the words: bookmark this, share your opinions via comments or email this article etcetera! Happy programming!&lt;/p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2009%2f10%2fjquery-mutually-exclusive-checkboxes-in.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2009%2f10%2fjquery-mutually-exclusive-checkboxes-in.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-8012312715800361204?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/PSCf-ZD-DW0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/PSCf-ZD-DW0/jquery-mutually-exclusive-checkboxes-in.html</link><author>noreply@blogger.com (Sangam Uprety)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_1sICTF7VWbI/SugrkwpFgeI/AAAAAAAAAFM/qYWvzXtUCUA/s72-c/jquery+library+added+in+asp-net+website+project.JPG" height="72" width="72" /><thr:total>8</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2009/10/jquery-mutually-exclusive-checkboxes-in.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-5497951058413511905</guid><pubDate>Thu, 03 Sep 2009 12:49:00 +0000</pubDate><atom:updated>2009-09-03T18:19:10.887+05:30</atom:updated><title>Programming foa and fop to generate pdf files from xml and xslt</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/x-Ed4MnU7W7jcpoIroDG0AwBHcY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x-Ed4MnU7W7jcpoIroDG0AwBHcY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/x-Ed4MnU7W7jcpoIroDG0AwBHcY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x-Ed4MnU7W7jcpoIroDG0AwBHcY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span xmlns=''&gt;&lt;p&gt;In real world, there is a great deal of demand of pdf files. Programmers often need to generate pdf file from data fed in different formats. One popular format is &lt;a href='http://www.w3.org/XML/'&gt;xml&lt;/a&gt;. There exists lots of ways to generate pdf files in different programming languages. And interestingly most of them are platform and program independent. Sweet!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I am currently programming &lt;a href='http://www.w3.org/TR/xslt'&gt;xslt&lt;/a&gt;. There has been an interesting task. We have xml file as input and &lt;a href='http://xmlgraphics.apache.org/fop/'&gt;fop&lt;/a&gt; batch file which can be run to accept some xml, xslt and pdf files to generate pdf out of the xml and xslt file. With this scenario, all we have to do is write the xslt that styles and maps to the original xml file, which can be then rendered as pdf files.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;We are writing xslt using &lt;a href='http://foa.sourceforge.net/'&gt;foa&lt;/a&gt;. The fop can take this xslt as input. The foa even provides IDE to write xslt. And this free yet significant tool is very programmer-friendly in the sense it provides environment to integrate style and xml at once into the xslt from one place.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This is my first time with fop and foa. They do make great marriage. But there doesn't seem to be updates in foa since long time. The latest foa we get is too old to match the latest version of fop. How would this foa keep with the latest, new, improved fop?&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Anyway, I hope to come up with more issues in using xsl. Keep up warming your programming. Happy programming!&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-5497951058413511905?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/GFbEdNBEMO4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/GFbEdNBEMO4/programming-foa-and-fop-to-generate-pdf.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2009/09/programming-foa-and-fop-to-generate-pdf.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-474312426542918409</guid><pubDate>Wed, 12 Aug 2009 06:24:00 +0000</pubDate><atom:updated>2009-08-12T11:54:38.405+05:30</atom:updated><title>International Youth Day 2009</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ITjVUXB9yzRev0vL8j01-Nsfamo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ITjVUXB9yzRev0vL8j01-Nsfamo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ITjVUXB9yzRev0vL8j01-Nsfamo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ITjVUXB9yzRev0vL8j01-Nsfamo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span xmlns=''&gt;&lt;p&gt;Hi all. Today is August 12, 2009, the &lt;a href='http://www.un.org/esa/socdev/unyin/iyouthday.htm'&gt;International Youth Day&lt;/a&gt;. May this day empower the youth all over the world!&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-474312426542918409?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/FH86Z4H40eQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/FH86Z4H40eQ/international-youth-day-2009.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>2</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2009/08/international-youth-day-2009.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-2206207484070582728</guid><pubDate>Mon, 10 Aug 2009 13:14:00 +0000</pubDate><atom:updated>2009-08-11T18:21:20.415+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">performance</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Smart sorting, paging in asp-net, especially repeater control</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9lmgHcL0bW0C_ufl8iHgu4CkhOA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9lmgHcL0bW0C_ufl8iHgu4CkhOA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9lmgHcL0bW0C_ufl8iHgu4CkhOA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9lmgHcL0bW0C_ufl8iHgu4CkhOA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span xmlns=''&gt;&lt;p&gt;Hi all. There has been little lagging in my presence to you all with new post. Actually these days there are lots of things in my mind. I am looking over the web to know the best asp.net performance practices. But most of the times I do get stuck with the same old strategies you can find everywhere if you search with the keyword – "asp.net performance tips" or so. However, these tips work 90% of the cases, they are intermediate ones. What about the advanced ones? There are some genius guys who have presented advanced and deep asp.net performance improvement techniques, and thanks to them. Good things cannot hide, so you are sure to find them over the web hanging here and there, no problem. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;But here I am going to talk about one thing- paging and sorting in asp.net. From the very beginning I am dissatisfied with the old, easy paging of asp.net gridview that really kills the spirit of web- faster response and scalability. In fact gridview and datagrid both generate heavy markup. The only good way to get rid of all these is to do custom paging, sorting with the gridview and datalist.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Then what about repeater control? Yes, the best option to go is use repeater and use custom sorting/paging with it. Repeater control has always won the heart of programmers- light, efficient and thus effective! I have just been through &lt;a href='http://www.aspdotnetcodes.com/Custom_Sorting_Paging_GridView.aspx'&gt;this better way of paging and sorting with asp.net gridview control&lt;/a&gt;. They have managed an &lt;a href='http://www.aspdotnetcodes.com/GridView_Custom_Sorting_Paging_HeaderTemplate_Example.aspx'&gt;example page&lt;/a&gt; also. I hope following the same pattern would make a good impression with repeater control also. We would certainly go different pattern for sorting- perhaps a dropdownlist populating all the column names and another dropdownlist with "asc" and "desc" for sorting direction.&lt;/p&gt;&lt;p&gt;As alternatives, I have also liked: &lt;a href='http://www.codeproject.com/KB/aspnet/PagingLarge.aspx'&gt;this one from codeproject&lt;/a&gt; and &lt;a href='http://www.asp.net/Learn/Data-Access/tutorial-26-cs.aspx'&gt;this one discussed in asp.net tutorial&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;What you think? I am still looking for the best paging in asp.net- for gridview, datalist or repeater. Your suggestions and referrals are welcome. Please keep in mind that I am fond of performance friendly options. Thank you. Happy Programming!&lt;/p&gt;&lt;/span&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2009%2f08%2fsmart-sorting-paging-in-asp-net.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2009%2f08%2fsmart-sorting-paging-in-asp-net.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-2206207484070582728?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/cyaQFCkR3bA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/cyaQFCkR3bA/smart-sorting-paging-in-asp-net.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2009/08/smart-sorting-paging-in-asp-net.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-5603859121301665697</guid><pubDate>Fri, 03 Jul 2009 12:47:00 +0000</pubDate><atom:updated>2009-07-03T18:41:32.485+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><category domain="http://www.blogger.com/atom/ns#">Ajax</category><title>How to change second textbox text when the first textbox date of AJAX CalendarExtender changes?</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jmwor06Ogbj9ShN8xMq1RI5cp34/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jmwor06Ogbj9ShN8xMq1RI5cp34/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jmwor06Ogbj9ShN8xMq1RI5cp34/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jmwor06Ogbj9ShN8xMq1RI5cp34/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span xmlns=""&gt;&lt;p&gt;Sometime ago I saw an interesting question in &lt;a href="http://forums.asp.net/t/1382766.aspx"&gt;asp.net forum&lt;/a&gt;. It raised my enthusiasm. I started to code the requirement. And I found one. Here goes the requirement:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;color:#1f497d;"&gt;Hi!&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;color:#1f497d;"&gt;I have two text boxes inside my aspx page: a) the "txt1" and b) the "txt2". Both text boxes have CalendarExtender controls attached:&lt;br /&gt;a) the txt1 has the "CalendarExtender1"&lt;br /&gt;b) the txt2 has the"CalendarExtender2".&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;color:#1f497d;"&gt;All I want is this:&lt;br /&gt;Using client-side script (or other method without postbacks), I want when the user chooses a date from CalendarExtender1, the same date plus a day front to go to the txt2.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;If the user chooses 03/28/2009 in the CalendarExtender1, I want the value of the txt2 to be the 03/29/2009....&lt;br /&gt;Also, if the month reaches the end, I want the txt2 to take the new moth.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;color:#1f497d;"&gt;For example:&lt;br /&gt;If the user chooses 03/31/2009 in the CalendarExtender1, I want the value of the txt2 to be the 04/01/2009....&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;color:#1f497d;"&gt;That behavior I want to exists only to the CalendarExtender1 like I describe it. I don't want the user to be able to do this with CalendarExtender2 (the CalendarExtender2 has the default behavior)... &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;color:#1f497d;"&gt;How can I accomplish that? Thank you very much!&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;There are two solutions provided to this requirement. Let me put them here.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;Solution1: (By &lt;a href="http://forums.asp.net/members/kinjalin.aspx"&gt;Kinjalin&lt;/a&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;Here you have to add it in Javascript.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class="xhtml" name="code"&gt;&amp;lt;cc1:CalendarExtender ID=&amp;quot;ClExFromDt&amp;quot;                     runat=&amp;quot;server&amp;quot;                     TargetControlID=&amp;quot;TxtFromDate&amp;quot;                     PopupButtonID=&amp;quot;BtnFromCal&amp;quot;                     Format=&amp;quot;dd/MM/yyyy&amp;quot;                     OnClientDateSelectionChanged=&amp;quot;AddDate&amp;quot;                     CssClass=&amp;quot;calExt_Theme1&amp;quot;&amp;gt;&amp;lt;/cc1:CalendarExtender&amp;gt;&lt;/pre&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;Here on OnBlur, write a Javascript function &lt;strong&gt;addDate&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;on Page_Load write the line " Text1.Attributes.Add("onblur", "javascript:addDate();")&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;&amp;amp; in Javascript Fetch the Value using document.getElementByID("TextBox1").value&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;add it using below Javascript &amp;amp; bit of ur Logic&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10;"&gt;//create the date&lt;br /&gt;var myDate = new Date();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//add a day to the date&lt;br /&gt;myDate.setDate(myDate.getDate() + 1);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//add a week&lt;br /&gt;myDate.setDate(myDate.getDate() + 7);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;After  adding Show it in your TextBox2&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;$get(TextBox2).value = myDate&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;Thats it.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;Solution2: (By &lt;a href="http://forums.asp.net/members/sangam100.aspx"&gt;sangam100&lt;/a&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Hi &lt;a href="http://forums.asp.net/members/MinimalTech.aspx"&gt;&lt;span style="color:#034efa;"&gt;MinimalTech&lt;/span&gt;&lt;/a&gt; ,&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here goes the prototype, which is close to what kinjalin posted:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Add this script in the design page:&lt;br /&gt;&lt;/p&gt;&lt;pre name="code" class="javascript"&gt;&amp;lt;script&amp;gt;&lt;br /&gt;&lt;br&gt;    function addDays() {&lt;br /&gt;&lt;br&gt;        dateParts = document.getElementById('txtDate1').value.split('/');&lt;br /&gt;&lt;br&gt;        year  =  dateParts[2];&lt;br /&gt;&lt;br&gt;        month = parseInt(dateParts[0])-1;&lt;br /&gt;&lt;br&gt;        day   = parseInt(dateParts[1]) + 1;&lt;br /&gt;&lt;br&gt;        &lt;br /&gt;&lt;br&gt;        newDate = new Date ( year, month, day );&lt;br /&gt;&lt;br&gt;        year  = newDate.getYear();&lt;br /&gt;&lt;br&gt;       month = newDate.getMonth()+1;&lt;br /&gt;&lt;br&gt;       day   = newDate.getDate();&lt;br /&gt;&lt;br&gt;       formattedDate = month + '/' + day + '/' + year;&lt;br /&gt;&lt;br&gt;   &lt;br /&gt;&lt;br&gt;       document.getElementById('txtDate2').value=formattedDate;&lt;br /&gt;&lt;br&gt;   }&lt;br /&gt;&lt;br&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;p&gt;Now in the design page:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre name="code" class="xhtml"&gt;Date1:&amp;lt;asp:TextBox ID=&amp;quot;txtDate1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;  Date2 (One day forward):&amp;lt;asp:TextBox ID=&amp;quot;txtDate2&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;cc1:CalendarExtender ID=&amp;quot;CalendarExtender1&amp;quot; runat=&amp;quot;server&amp;quot; TargetControlID=&amp;quot;txtDate1&amp;quot; PopupButtonID=&amp;quot;txtDate1&amp;quot;&amp;gt;&amp;lt;/cc1:CalendarExtender&amp;gt;&lt;/pre&gt;&lt;p&gt;In the code behind.&lt;span style="font-family:Courier New;font-size:10;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:10;"&gt;txtDate1.Attributes.Add("onchange", "addDays();");&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;Now this works.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:12;"&gt;Hope this will be useful to all. Happy Programming!&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-5603859121301665697?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/dh14NjHt_do" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/dh14NjHt_do/how-to-change-second-textbox-text-when.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2009/07/how-to-change-second-textbox-text-when.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-1886695854890886487</guid><pubDate>Fri, 26 Jun 2009 12:43:00 +0000</pubDate><atom:updated>2009-06-26T18:47:17.293+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL Server 2005</category><title>Convert date to different date string using Convert function of ms sql server 2005</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fa3cu-X5g8l3EfI37QcOVqMEYh4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fa3cu-X5g8l3EfI37QcOVqMEYh4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fa3cu-X5g8l3EfI37QcOVqMEYh4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fa3cu-X5g8l3EfI37QcOVqMEYh4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span xmlns=""&gt;&lt;p&gt;Many times we need to convert datetime to different strings representing date, varying from 2009/06/2009 to June 26, 2009, and so on. Microsoft sql server 2005 can do the job for us! I had the same need some time ago, and sql server did this for me. (By the way, don't we programmers often find it irritating to have datetime representations different in different data base providers and different programming languages? Yes. Exactly here is what I am pointing towards what sql server 2005 can do for us. Follow the rest of this article for the magic!)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This is the syntax:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;CONVERT (&lt;em&gt;data-type&lt;/em&gt;, &lt;em&gt;date-time-string-input&lt;/em&gt;, &lt;em&gt;date-display-style&lt;/em&gt;)&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Parameters:&lt;br /&gt;    &lt;strong&gt;data-type&lt;/strong&gt;: Any data type from nchar, nvarchar, char, varchar, binary, varbinary [length is optional, e.g. varchar(20) or varchar(22)&lt;br /&gt;    &lt;strong&gt;date-time-string-input&lt;/strong&gt;: Date time string supplied as input (You can use GETDATE() function etc.)&lt;br /&gt;    &lt;strong&gt;date-display-style&lt;/strong&gt;: The string style (You need '2009.06.26' or 'June 26, 2009' etc. You can even use the useful style number. Read on.)&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Note: If you provide insufficient length, you may be trimming your result!&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Now, here is a list of the sql query and the result to the query that will introduce a number of the ways to get desired date strings.&lt;br /&gt;&lt;/p&gt;&lt;pre name="code" class="csharp"&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),100) &lt;br /&gt;Result: Jun 26 2009 5:53PM&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),101) &lt;br /&gt;Result: 06/26/2009&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),102) &lt;br /&gt;Result: 2009.06.26&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),103) &lt;br /&gt;Result: 26/06/2009&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),104) &lt;br /&gt;Result: 26.06.2009&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),105) &lt;br /&gt;Result: 26-06-2009&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),106) &lt;br /&gt;Result: 26 Jun 2009&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),107) &lt;br /&gt;Result: Jun 26, 2009&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),108) &lt;br /&gt;Result: 17:49:42&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),109) &lt;br /&gt;Result: Jun 26 2009 5:50:02&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),110) &lt;br /&gt;Result: 06-26-2009&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),111) &lt;br /&gt;Result: 2009/06/26&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),113) &lt;br /&gt;Result: 26 Jun 2009 17:51:24&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),114) &lt;br /&gt;Result: 17:51:44:397&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),120) &lt;br /&gt;Result: 2009-06-26 18:00:17&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),121) &lt;br /&gt;Result: 2009-06-26 18:01:14&lt;br /&gt;&lt;br /&gt;SELECT CONVERT(VARCHAR(20),GETDATE(),126) &lt;br /&gt;Result: 2009-06-26T18:02:00&lt;/pre&gt;&lt;p&gt;As you can see, I have used the select statement to retrieve the desired sql query result. You can use it with any combination of sql query to perform any of the CRUD (Create, Read, Update and Delete) operations.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;You can comment to add to the above list. It may be incomplete. Remember your participation is very important to make it more complete and more useful. You are as always heartily welcome to post you suggestions, comments, rate this article or spread the words by adding it to the social bookmarks! Happy Programming!&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;a rev="vote-for" href="http://dotnetshoutout.com/Convert-date-to-different-date-string-using-Convert-function-of-ms-sql-server-2005"&gt;&lt;img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fdotnetspidor.blogspot.com%2F2009%2F06%2Fconvert-date-to-different-date-string.html" style="border:0px"/&gt;&lt;/a&gt;&amp;nbsp;&lt;a rev="vote-for" href="http://pimpthisblog.com/dotNETspidor-Convert-date-to-different-date-string-using-Convert-function-of-ms-sql-server-2005"&gt;&lt;img alt="pimp it" src="http://pimpthisblog.com/image.axd?url=http%3A%2F%2Fdotnetspidor.blogspot.com%2F2009%2F06%2Fconvert-date-to-different-date-string.html" style="border:0px"/&gt;&lt;/a&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-1886695854890886487?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/sOXJN1B1pHQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/sOXJN1B1pHQ/convert-date-to-different-date-string.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>0</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2009/06/convert-date-to-different-date-string.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6104185749662767834.post-2339115224732523435</guid><pubDate>Wed, 10 Jun 2009 12:25:00 +0000</pubDate><atom:updated>2009-06-10T18:41:53.740+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">ASP.NET GridView</category><category domain="http://www.blogger.com/atom/ns#">ASP.NET</category><title>Highlight gridview row on mouse over in asp net web page: Adding effects to the gridview control</title><description>&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3zG2CPd1-AmiNC4AjJzrT_4Lhyc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3zG2CPd1-AmiNC4AjJzrT_4Lhyc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3zG2CPd1-AmiNC4AjJzrT_4Lhyc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3zG2CPd1-AmiNC4AjJzrT_4Lhyc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span xmlns=''&gt;&lt;p&gt;Programmers heavily use the asp.net gridview control. Adding some effects to the gridview will change the appearance so that user interactivity increases. One of such effects is highlighting the gridview row on mouseover. With this short background let's go for the design markup of the example gridview.&lt;br /&gt;&lt;/p&gt;&lt;pre name="code" class="xhtml"&gt;&amp;lt;asp:GridView ID=&amp;quot;gridTest&amp;quot; runat=&amp;quot;server&amp;quot; OnRowDataBound=&amp;quot;gridTest_RowDataBound&amp;quot; AutoGenerateColumns=&amp;quot;false&amp;quot;&amp;gt;&lt;br /&gt;&lt;br&gt;&amp;lt;Columns&amp;gt;&lt;br /&gt;&lt;br&gt;     &amp;lt;asp:BoundField HeaderText=&amp;quot;Status&amp;quot; DataField=&amp;quot;Status&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br&gt;     &amp;lt;asp:BoundField HeaderText=&amp;quot;Name&amp;quot; DataField=&amp;quot;Name&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br&gt;     &amp;lt;asp:BoundField HeaderText=&amp;quot;Comment&amp;quot; DataField=&amp;quot;Comment&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br&gt;     &amp;lt;asp:BoundField HeaderText=&amp;quot;Date&amp;quot; DataField=&amp;quot;Date&amp;quot; /&amp;gt;&lt;br /&gt;&lt;br&gt;&amp;lt;/Columns&amp;gt;&lt;br /&gt;&lt;br&gt;&amp;lt;/asp:GridView&amp;gt;&lt;/pre&gt;&lt;p&gt;Now we have the asp.net gridview, why not choose the highlighted row's color? Let's define a style sheet class for highlighted row. &lt;br /&gt;&lt;/p&gt;&lt;pre name="code" class="css"&gt;&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&lt;br /&gt;&lt;br&gt;        /*for gridview row hover, select etc*/&lt;br /&gt;&lt;br&gt;        .normalrow&lt;br /&gt;&lt;br&gt;            {&lt;br /&gt;&lt;br&gt;                background-color:white;&lt;br /&gt;&lt;br&gt;            }&lt;br /&gt;&lt;br&gt;        .highlightrow&lt;br /&gt;&lt;br&gt;            {&lt;br /&gt;&lt;br&gt;                background-color:#cccccc;&lt;br /&gt;&lt;br&gt;            }&lt;br /&gt;&lt;br&gt;    &amp;lt;/style&amp;gt;&lt;/pre&gt;&lt;p&gt;(The gridview markup shown above is only for example purpose. So you will not see any matches between the figure showing highlighted row and the example markup. Further you will also need to implement your own css styling, if you prefer any). Note the OnRowDataBound event handler in the gridview design markup. We will write some lines of code in this event handler to add the effect of highlighting gridview rows on mouse over. Here goes the code.&lt;br /&gt;&lt;/p&gt;&lt;pre name="code" class="csharp"&gt;//row created event&lt;br /&gt;    protected void gridTest_RowCreated(object sender, GridViewRowEventArgs e)&lt;br /&gt;    {&lt;br /&gt;        if (e.Row.RowType == DataControlRowType.DataRow)&lt;br /&gt;        {&lt;br /&gt;            e.Row.Attributes.Add("onmouseover", "this.className='highlightrow'");&lt;br /&gt;            e.Row.Attributes.Add("onmouseout", "this.className='normalrow'");&lt;br /&gt;        } &lt;br /&gt;    }&lt;/pre&gt;&lt;p&gt;We have specified the css class to adapt by the gridview row on mouse over. At the same time, we need to assign another css class on mouse out so that the gridview will be highlighted only on mouseover and on mouse out the effect will be void. Happy programming!&lt;/p&gt;&lt;/span&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2009%2f06%2fhighlight-gridview-row-on-mouse-over-in.html"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fdotnetspidor.blogspot.com%2f2009%2f06%2fhighlight-gridview-row-on-mouse-over-in.html" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&amp;nbsp;&lt;a rev="vote-for" href="http://pimpthisblog.com/dotNETspidor-Highlight-gridview-row-on-mouse-over-in-asp-net-web-page-Adding-effects-to-the-gridview-control"&gt;&lt;img alt="pimp it" src="http://pimpthisblog.com/image.axd?url=http%3A%2F%2Fdotnetspidor.blogspot.com%2F2009%2F06%2Fhighlight-gridview-row-on-mouse-over-in.html" style="border:0px"/&gt;&lt;/a&gt;&amp;nbsp;&lt;a rev="vote-for" href="http://dotnetshoutout.com/dotNETspidor-Highlight-gridview-row-on-mouse-over-in-asp-net-web-page-Adding-effects-to-the-gridview-control"&gt;&lt;img alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fdotnetspidor.blogspot.com%2F2009%2F06%2Fhighlight-gridview-row-on-mouse-over-in.html" style="border:0px"/&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;For full article, tips and utilities, visit http://www.dotnetspidor.blogspot.com&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6104185749662767834-2339115224732523435?l=dotnetspidor.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotnetspidor/~4/aAWZjTFfxWU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/dotnetspidor/~3/aAWZjTFfxWU/highlight-gridview-row-on-mouse-over-in.html</link><author>noreply@blogger.com (Sangam Uprety)</author><thr:total>5</thr:total><feedburner:origLink>http://dotnetspidor.blogspot.com/2009/06/highlight-gridview-row-on-mouse-over-in.html</feedburner:origLink></item></channel></rss>

