<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Useful asp.NET and C#</title>
	<atom:link href="http://usefulaspandcsharp.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://usefulaspandcsharp.wordpress.com</link>
	<description>asp.net and c# code snippets and useful theory</description>
	<lastBuildDate>Sat, 19 Feb 2011 12:24:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='usefulaspandcsharp.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Useful asp.NET and C#</title>
		<link>http://usefulaspandcsharp.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://usefulaspandcsharp.wordpress.com/osd.xml" title="Useful asp.NET and C#" />
	<atom:link rel='hub' href='http://usefulaspandcsharp.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Belated statistics for 2010</title>
		<link>http://usefulaspandcsharp.wordpress.com/2011/02/19/belated-statistics-for-2010/</link>
		<comments>http://usefulaspandcsharp.wordpress.com/2011/02/19/belated-statistics-for-2010/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 12:24:19 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Off Topic]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[thank you]]></category>

		<guid isPermaLink="false">http://usefulaspandcsharp.wordpress.com/?p=167</guid>
		<description><![CDATA[This is a little late but I still wanted to post my 2010 stats up (even if just for my benefit ) In 2009 I had 4,229 unique visitors to my blog. I am happy to announce that in 2010, that number rose to 6,403 unique visitors! As I said last year, to some people [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=167&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a little late but I still wanted to post my 2010 stats up (even if just for my benefit <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>In 2009 I had 4,229 unique visitors to my blog. I am happy to announce that in 2010, that number rose to 6,403 unique visitors! As I said last year, to some people this number isn’t exactly staggering. To me however it really is. I started this blog to keep a note of all the little code snippets I thought may be useful instead of relying on my memory and reams of post it notes! It’s brilliant that it helps other people and in 2010 (end of the year excluded) I really started trying to make sure my posts could be found via search engines by trying to use tags properly and trying to write the posts so that other people could understand them!</p>
<p>So thank you for visiting, I really hope my blog can help you. I generally do check my comments regularly (again end of 2010 excluded!) so if you want to ask any questions about my code, need some help getting it to work or give some feedback on the site, leave me a comment and I will try and get back to you as soon as possible.</p>
<p>Stats for 2011 are looking good so far so lets hope we can top 2010′s stats! Bring on 2011…I should probably get writing some new posts!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/usefulaspandcsharp.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/usefulaspandcsharp.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/usefulaspandcsharp.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/usefulaspandcsharp.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/usefulaspandcsharp.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/usefulaspandcsharp.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/usefulaspandcsharp.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/usefulaspandcsharp.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/usefulaspandcsharp.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/usefulaspandcsharp.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/usefulaspandcsharp.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/usefulaspandcsharp.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/usefulaspandcsharp.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/usefulaspandcsharp.wordpress.com/167/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=167&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://usefulaspandcsharp.wordpress.com/2011/02/19/belated-statistics-for-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sarah</media:title>
		</media:content>
	</item>
		<item>
		<title>It&#8217;s been a while&#8230;</title>
		<link>http://usefulaspandcsharp.wordpress.com/2011/02/17/its-been-a-while/</link>
		<comments>http://usefulaspandcsharp.wordpress.com/2011/02/17/its-been-a-while/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 18:12:44 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Off Topic]]></category>
		<category><![CDATA[asp.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[guest blogger]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://usefulaspandcsharp.wordpress.com/?p=164</guid>
		<description><![CDATA[So here I am, apologising again for a lack of updates to this blog! I started a new job in November and moved house at the same time so it’s all been a bit manic really. I hadn’t done any admin with the site since late November so I came back to over 500 comments [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=164&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So here I am, apologising again for a lack of updates to this blog! I started a new job in November and moved house at the same time so it’s all been a bit manic really. I hadn’t done any admin with the site since late November so I came back to over 500 comments to moderate! There was a large amount of spam so if I accidentally trashed someone’s genuine comment then I am very sorry. Please post it again and I will approve it.</p>
<p>On the subject of comments, my general rule when moderating is to look at the name provided and the e-mail address provided and see if they match in some way. For example if the name provided is Sarah then the e-mail address is martin@someemailprovider.com then chances are it will get trashed. I also look at the URL’s provided. If there is one there, I look to see if it looks genuine and if it is, I check it out. I wish I could remove the comment moderation but there really are so many spammers out there!</p>
<p>Anyway, what I plan to do from here is to get back into posting regular content. I’m planning to do a little stats summary like I did at the end of 2009 (for my benefit to look back on really). I’ve also been looking into some SEO techniques at work recently so might start posting a little about SEO bits and also trying some things out on the site.</p>
<p>Another thing I’ve been considering is maybe getting a guest writer on to write some posts for the site. A similar sort of thing to what I do, general hints and tips for programming etc. If you’re interested please leave me a comment and I’ll get in touch with you.</p>
<p>So sorry again for the lack of new articles. I plan to spend much more time on it from now on when time allows!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/usefulaspandcsharp.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/usefulaspandcsharp.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/usefulaspandcsharp.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/usefulaspandcsharp.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/usefulaspandcsharp.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/usefulaspandcsharp.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/usefulaspandcsharp.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/usefulaspandcsharp.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/usefulaspandcsharp.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/usefulaspandcsharp.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/usefulaspandcsharp.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/usefulaspandcsharp.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/usefulaspandcsharp.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/usefulaspandcsharp.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=164&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://usefulaspandcsharp.wordpress.com/2011/02/17/its-been-a-while/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sarah</media:title>
		</media:content>
	</item>
		<item>
		<title>How to &#8216;Publish&#8217; a Web Application in Visual Studio 2003</title>
		<link>http://usefulaspandcsharp.wordpress.com/2010/08/03/how-to-publish-a-web-application-in-visual-studio-2003/</link>
		<comments>http://usefulaspandcsharp.wordpress.com/2010/08/03/how-to-publish-a-web-application-in-visual-studio-2003/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 10:38:00 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[asp.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C sharp]]></category>
		<category><![CDATA[copy project]]></category>
		<category><![CDATA[publish]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[visual studio 2003]]></category>
		<category><![CDATA[web application]]></category>

		<guid isPermaLink="false">https://usefulaspandcsharp.wordpress.com/2010/08/03/how-to-publish-a-web-application-in-visual-studio-2003/</guid>
		<description><![CDATA[If you’ve used later versions of Visual Studio for creating web applications, you will know that there is an option to ‘Publish’ your application which allows you to compile your application into only files needed to run the application (a good practice to use when putting your application online). When it comes to Visual Studio [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=160&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you’ve used later versions of Visual Studio for creating web applications, you will know that there is an option to ‘Publish’ your application which allows you to compile your application into only files needed to run the application (a good practice to use when putting your application online). </p>
<p>When it comes to Visual Studio 2003, there isn&#8217;t such an option but the functionality is still there, just masquerading under a different menu option!</p>
<p>When you have your project open, build it in ‘Release’ mode (it is not essential that it is built in ‘Release’ mode but I find there are performance improvements over building it in ‘Debug’ mode). Now select ‘Copy Project’ from the ‘Project’ menu along the top.</p>
<p><a href="http://usefulaspandcsharp.files.wordpress.com/2010/08/copyprojectmenu.png"><img style="display:inline;border-width:0;" title="CopyProjectMenu" border="0" alt="CopyProjectMenu" src="http://usefulaspandcsharp.files.wordpress.com/2010/08/copyprojectmenu_thumb.png?w=165&#038;h=276" width="165" height="276" /></a></p>
<p>You will then be presented with the following pop-up dialog:</p>
<p><a href="http://usefulaspandcsharp.files.wordpress.com/2010/08/copyprojectdialog.png"><img style="display:inline;border-width:0;" title="CopyProjectDialog" border="0" alt="CopyProjectDialog" src="http://usefulaspandcsharp.files.wordpress.com/2010/08/copyprojectdialog_thumb.png?w=344&#038;h=257" width="344" height="257" /></a></p>
<p>Here you give it a destination project folder (in my case, the same as the source project folder, but to a folder called ‘Published’), and a web access method. I choose to publish it to my local file system, and then upload it myself. You then choose to copy ‘Only files needed to run this application’ and click ‘OK’. If you now go to the folder which you chose in the ‘File Share’ path, you will have all the files you need to upload to put your web application online, the same as if you had ‘Published’ a web application in a later version of Visual Studio. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/usefulaspandcsharp.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/usefulaspandcsharp.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/usefulaspandcsharp.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/usefulaspandcsharp.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/usefulaspandcsharp.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/usefulaspandcsharp.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/usefulaspandcsharp.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/usefulaspandcsharp.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/usefulaspandcsharp.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/usefulaspandcsharp.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/usefulaspandcsharp.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/usefulaspandcsharp.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/usefulaspandcsharp.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/usefulaspandcsharp.wordpress.com/160/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=160&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://usefulaspandcsharp.wordpress.com/2010/08/03/how-to-publish-a-web-application-in-visual-studio-2003/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sarah</media:title>
		</media:content>

		<media:content url="http://usefulaspandcsharp.files.wordpress.com/2010/08/copyprojectmenu_thumb.png" medium="image">
			<media:title type="html">CopyProjectMenu</media:title>
		</media:content>

		<media:content url="http://usefulaspandcsharp.files.wordpress.com/2010/08/copyprojectdialog_thumb.png" medium="image">
			<media:title type="html">CopyProjectDialog</media:title>
		</media:content>
	</item>
		<item>
		<title>Useful asp.NET and C# is moving house!</title>
		<link>http://usefulaspandcsharp.wordpress.com/2010/07/29/useful-asp-net-and-c-is-moving-house/</link>
		<comments>http://usefulaspandcsharp.wordpress.com/2010/07/29/useful-asp-net-and-c-is-moving-house/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 12:39:20 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Off Topic]]></category>

		<guid isPermaLink="false">http://usefulaspandcsharp.wordpress.com/?p=151</guid>
		<description><![CDATA[I have decided to start hosting my blog myself as it gives me more control over what I do with it. For a while I will be duplicating all my posts. Eventually I will stop posting on here and only be posting at the new home. I will post when that is about to happen [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=151&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have decided to start hosting my blog myself as it gives me more control over what I do with it. </p>
<p>For a while I will be duplicating all my posts. Eventually I will stop posting on here and only be posting at the new home. I will post when that is about to happen though.</p>
<p>The new home for this blog is <a href="http://www.usefulaspandcsharp.co.uk">www.usefulaspandcsharp.co.uk</a></p>
<p>I hope you&#8217;ll still drop by <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/usefulaspandcsharp.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/usefulaspandcsharp.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/usefulaspandcsharp.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/usefulaspandcsharp.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/usefulaspandcsharp.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/usefulaspandcsharp.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/usefulaspandcsharp.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/usefulaspandcsharp.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/usefulaspandcsharp.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/usefulaspandcsharp.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/usefulaspandcsharp.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/usefulaspandcsharp.wordpress.com/151/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/usefulaspandcsharp.wordpress.com/151/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/usefulaspandcsharp.wordpress.com/151/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=151&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://usefulaspandcsharp.wordpress.com/2010/07/29/useful-asp-net-and-c-is-moving-house/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sarah</media:title>
		</media:content>
	</item>
		<item>
		<title>MouseUpOutside in ActionScript 3</title>
		<link>http://usefulaspandcsharp.wordpress.com/2010/07/20/mouseupoutside-in-actionscript-3/</link>
		<comments>http://usefulaspandcsharp.wordpress.com/2010/07/20/mouseupoutside-in-actionscript-3/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 10:54:00 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[Actionscript 3/Flex 3]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[actionscript 3]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[flex 3]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[MouseEvent]]></category>
		<category><![CDATA[MouseUpOutside]]></category>
		<category><![CDATA[onReleaseOutside]]></category>
		<category><![CDATA[outside]]></category>
		<category><![CDATA[up]]></category>

		<guid isPermaLink="false">https://usefulaspandcsharp.wordpress.com/2010/07/20/mouseupoutside-in-actionscript-3/</guid>
		<description><![CDATA[I recently needed an event that detected a mouse up outside of my object. It used to exist in ActionScript 1 &#38; 2 as onReleaseOutside and although ActionScript 3 has MouseDownOutside and MouseWheelOutside, for some reason there is no MouseUpOutisde. Pretty silly if you ask me! So after a little searching, I found a post [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=149&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently needed an event that detected a mouse up outside of my object. It used to exist in ActionScript 1 &amp; 2 as onReleaseOutside and although ActionScript 3 has MouseDownOutside and MouseWheelOutside, for some reason there is no MouseUpOutisde. Pretty silly if you ask me!</p>
<p>So after a little searching, I found a post that had some code that worked perfectly for me. I adapted mine a little, but first the original post. It is the fourth post on the page, you could just do a quick search on the page for “Detecting a mouseUp Outside” if you wanted to save your scrolly finger <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  For the original post, <a href="http://www.senocular.com/pub/kirupa/as3tips_p6.html" target="_blank">click here.</a></p>
<p>My slightly modified code is in a Flex Builder 3 project. I added the “clicked” variable as an application variable so I can access it from anywhere. The function is needed to detect when a scroll bar is being clicked and released so I added the MouseEvent.MOUSE_UP event to my module (this.addEventListener etc) on creationComplete.</p>
<p><code>public function captureMouseUp(e:MouseEvent):void<br />
{<br />
if(e.eventPhase == EventPhase.BUBBLING_PHASE)<br />
return;<br />
if(Application.application.clicked == ctgScroller)<br />
{<br />
Application.application.clicked = null;<br />
var target:Sprite = e.target as Sprite;<br />
if(target == ctgScroller) //mouse was released over the scroll bar<br />
{<br />
ScrollBarUp();<br />
}<br />
else<br />
{<br />
ScrollBarUp(); //mouse was released outside the scroll bar<br />
}<br />
}<br />
}</code></p>
<p>Thanks again to the original post that helped me out with this which can be found <a href="http://www.senocular.com/pub/kirupa/as3tips_p6.html" target="_blank">HERE</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/usefulaspandcsharp.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/usefulaspandcsharp.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/usefulaspandcsharp.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/usefulaspandcsharp.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/usefulaspandcsharp.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/usefulaspandcsharp.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/usefulaspandcsharp.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/usefulaspandcsharp.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/usefulaspandcsharp.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/usefulaspandcsharp.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/usefulaspandcsharp.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/usefulaspandcsharp.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/usefulaspandcsharp.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/usefulaspandcsharp.wordpress.com/149/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=149&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://usefulaspandcsharp.wordpress.com/2010/07/20/mouseupoutside-in-actionscript-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sarah</media:title>
		</media:content>
	</item>
		<item>
		<title>How To Do A Printer Friendly Pop Up That Has Information From The Original Web Page</title>
		<link>http://usefulaspandcsharp.wordpress.com/2010/07/08/how-to-do-a-printer-friendly-pop-up-that-has-information-from-the-original-web-page/</link>
		<comments>http://usefulaspandcsharp.wordpress.com/2010/07/08/how-to-do-a-printer-friendly-pop-up-that-has-information-from-the-original-web-page/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 11:07:00 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[asp.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[original information in a pop up]]></category>
		<category><![CDATA[pop up]]></category>
		<category><![CDATA[popup]]></category>
		<category><![CDATA[print]]></category>
		<category><![CDATA[printer friendly]]></category>
		<category><![CDATA[self.print]]></category>
		<category><![CDATA[window.open]]></category>

		<guid isPermaLink="false">https://usefulaspandcsharp.wordpress.com/2010/07/08/how-to-do-a-printer-friendly-pop-up-that-has-information-from-the-original-web-page/</guid>
		<description><![CDATA[Well that’s a bit of a lengthy title isn’t it! I wasn’t really sure what to call it. I’m sure this could be used in other ways too, but in my case I wanted to create a printer friendly pop up page, that took information from my ASP.net page to present in the pop up. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=148&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Well that’s a bit of a lengthy title isn’t it! I wasn’t really sure what to call it. I’m sure this could be used in other ways too, but in my case I wanted to create a printer friendly pop up page, that took information from my ASP.net page to present in the pop up. I’ll show the C# code first but then will also show you just the javascript without all the added double quotes and various other symbols that may cause confusion. Also apologies for the somewhat messy code listing for the C&#8217;# part, I may need to consider a change of theme soon!</p>
<p><strong>IMPORTANT NOTE:</strong> The web site I was doing this in is in .NET 1.1 so I am using the RegisterClientScriptBlock from the C#. This method is obsolete from 2.0 upwards so you should look to replace it with it’s correct newer method.</p>
<p> <code>RegisterClientScriptBlock(&quot;PrintWindow&quot;, &quot;&lt;script language=\&quot;javascript&quot;&gt;\&quot; + @&quot;    <br />var content = '&quot; + infoLabel.Text + @&quot;';     <br />var printFriendly=window.open('','PrinterFriendly','toolbar=no,menubar=no,width=1000,height=600');     <br />printFriendly.document.open();     <br />printFriendly.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;Printer Friendly Pop Up Page&lt;/title&gt;&lt;/head&gt;');&quot; +     <br />&quot;printFriendly.document.write('&lt;img src=&quot;\&quot;Images/ProgressPrintHeader.png\&quot;&quot; /&gt;&lt;h1&gt;');&quot; + @&quot;     <br />printFriendly.document.write(content);     <br />printFriendly.document.write('&lt;/h1&gt;');     <br />printFriendly.document.write('&lt;h5&gt;Printed on ');     <br />printFriendly.document.write('&quot; + DateTime.Now.ToString(&quot;dd MMMM yyyy&quot;) + @&quot;');     <br />printFriendly.document.write('&lt;/h5&gt;&lt;/body&gt;&lt;/html&gt;');     <br />printFriendly.document.close();     <br />printFriendly.focus();     <br />&lt;/script&gt;&quot;); </code>
<p>Now for just the javascript code on it’s own, without all the squiffy formatting and confusing symbols!</p>
<p> <code>var content = 'Text from original page';    <br />var printFriendly=window.open('','PrinterFriendly','toolbar=no,menubar=no,width=1000,height=600');     <br />printFriendly.document.open();     <br />printFriendly.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;Printer Friendly Pop Up Page&lt;/title&gt;&lt;/head&gt;');     <br />printFriendly.document.write('&lt;body onLoad=&quot;self.print()&quot;&gt;&lt;img src=&quot;Images/ProgressPrintHeader.png&quot;&gt;&lt;/br&gt;&lt;/br&gt;&lt;h1&gt;');     <br />printFriendly.document.write(content);     <br />printFriendly.document.write('&lt;/h1&gt;&lt;/br&gt;&lt;/br&gt;');     <br />printFriendly.document.write('&lt;h5&gt;Printed on ');     <br />printFriendly.document.write('Today's date');     <br />printFriendly.document.write('&lt;/h5&gt;&lt;/body&gt;&lt;/html&gt;');     <br />printFriendly.document.close();     <br />printFriendly.focus(); </code>
<p>It’s important to use the document.close() method, otherwise your print dialog will never pop up because as far as your browser is concerned, the document is still being written.</p>
<p>So as you can see, in order to take the text from my original ASP.net page into my pop up, I am referencing the label that the required text is in. It is also possible to do it using javascript if you are not using ASP.net or anything similar.</p>
<p>If I had the text I wanted to print within div tags for example: </p>
<p> <code>&lt;div id=”print”&gt;All text to be printed&lt;/div&gt;</code>
<p>then I could then retrieve that text using:</p>
<p> <code>document.getElementById(‘print’).innerHTML;</code>
<p>I hope that all makes sense! Feel free to comment if I have well and truly confused you <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/usefulaspandcsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/usefulaspandcsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/usefulaspandcsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/usefulaspandcsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/usefulaspandcsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/usefulaspandcsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/usefulaspandcsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/usefulaspandcsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/usefulaspandcsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/usefulaspandcsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/usefulaspandcsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/usefulaspandcsharp.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/usefulaspandcsharp.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/usefulaspandcsharp.wordpress.com/148/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=148&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://usefulaspandcsharp.wordpress.com/2010/07/08/how-to-do-a-printer-friendly-pop-up-that-has-information-from-the-original-web-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sarah</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding Text to an Image</title>
		<link>http://usefulaspandcsharp.wordpress.com/2010/06/23/adding-text-to-an-image/</link>
		<comments>http://usefulaspandcsharp.wordpress.com/2010/06/23/adding-text-to-an-image/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 09:59:00 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[asp.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[a generic error occurred in GDI+]]></category>
		<category><![CDATA[add text to image]]></category>
		<category><![CDATA[dispose]]></category>
		<category><![CDATA[drawstring]]></category>
		<category><![CDATA[format image]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[save image]]></category>
		<category><![CDATA[web application]]></category>

		<guid isPermaLink="false">https://usefulaspandcsharp.wordpress.com/2010/06/23/adding-text-to-an-image/</guid>
		<description><![CDATA[I had a blank calendar icon that I needed to draw a date on to depending on the user that was signed in to my website. It took some fiddling, but eventually after a few errors and some searching, I have the solution. On my ASP.net page, I have 2 images: calenderIcon and blankCalenderIcon. Both [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=145&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had a blank calendar icon that I needed to draw a date on to depending on the user that was signed in to my website. It took some fiddling, but eventually after a few errors and some searching, I have the solution. On my ASP.net page, I have 2 images: calenderIcon and blankCalenderIcon. Both of these have their &#8216;Visible&#8217; attribute set to false. blankCalenderIcon is the image I always start with and that is never changed, and calenderIcon is the image that has been modified to include a date. The code snippets are originally broken up to allow me to explain easier what is going on and provide some relevant links. However there is a full code snippet at the end of the post without any explanations.</p>
<p>Firstly, as there is a crossover here between System.Drawing.Image and System.Web.UI.WebControls.Image, I had to save the image I had placed on my page as a System.Drawing.Image.</p>
<p> <code>System.Drawing.Image img = null;    <br />img = System.Drawing.Image.FromFile(Server.MapPath(blankCalenderIcon.ImageUrl)); </code>
<p>Then in order to edit the image, and save it back to it&#8217;s original &#8216;ImageUrl&#8217; path, you need to create 2 Bitmap objects. If you try and do all of this with one Bitmap object, you will get the following error, &quot;A generic error occurred in GDI+&quot;. This is because the file is locked. For a more in depth explanation, <a href="http://support.microsoft.com/?id=814675" target="_blank">click here</a>.</p>
<p> <code>Bitmap originalCalender = new Bitmap(img);    <br />Bitmap newCalender = new Bitmap(originalCalender.Width, originalCalender.Height);     <br />Graphics newG = Graphics.FromImage(newCalender);     <br />newG.DrawImage(originalCalender,0,0); </code>
<p>Now that you have your Graphics object that contains the blank image, you can add the text to it. I personally set the Anti Aliasing for smoothness, that&#8217;s obviously not a necessity. I then use the DrawString method to place my text on the image. For some further info on how to do this and how it works, <a href="http://www.switchonthecode.com/tutorials/csharp-snippet-tutorial-how-to-draw-text-on-an-image" target="_blank">click here</a>.</p>
<p> <code>newG.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;    <br />StringFormat strFormat = new StringFormat();     <br />strFormat.Alignment = StringAlignment.Center;     <br />newG.DrawString(&quot;July 2011&quot;, new Font(&quot;Arial&quot;, 12), Brushes.White, new RectangleF(12,5,newCalender.Width, 30)); </code>
<p>Now that your new image is ready, you need to dispose of your graphics object, your originalBitmap and in this case the Image object created to allow us to create the original Bitmap object (I say in this case because in a Windows Forms application, that step wouldn&#8217;t have been necessary).</p>
<p> <code>newG.Dispose();    <br />originalCalender.Dispose();     <br />img.Dispose(); </code>
<p>Now that everything has been disposed, you can save your new Bitmap object back to your original icons &#8216;ImageUrl&#8217; and then in my case, make the icon visible.</p>
<p> <code>newCalender.Save(Server.MapPath(calenderIcon.ImageUrl));    <br />calenderIcon.Visible = true; </code>
<p>And now you will see your original Image, but with your text added. Magical!</p>
<p> <code>System.Drawing.Image img = null;    <br />img = System.Drawing.Image.FromFile(Server.MapPath(blankCalenderIcon.ImageUrl));     <br />Bitmap originalCalender = new Bitmap(img);     <br />Bitmap newCalender = new Bitmap(originalCalender.Width, originalCalender.Height);     <br />Graphics newG = Graphics.FromImage(newCalender);     <br />newG.DrawImage(originalCalender,0,0);     <br />newG.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;     <br />StringFormat strFormat = new StringFormat();     <br />strFormat.Alignment = StringAlignment.Center;     <br />newG.DrawString(&quot;July 2011&quot;, new Font(&quot;Arial&quot;, 12), Brushes.White, new RectangleF(12,5,newCalender.Width, 30));     <br />newG.Dispose();     <br />originalCalender.Dispose();     <br />img.Dispose();     <br />newCalender.Save(Server.MapPath(calenderIcon.ImageUrl));     <br />calenderIcon.Visible = true; </code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/usefulaspandcsharp.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/usefulaspandcsharp.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/usefulaspandcsharp.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/usefulaspandcsharp.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/usefulaspandcsharp.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/usefulaspandcsharp.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/usefulaspandcsharp.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/usefulaspandcsharp.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/usefulaspandcsharp.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/usefulaspandcsharp.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/usefulaspandcsharp.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/usefulaspandcsharp.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/usefulaspandcsharp.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/usefulaspandcsharp.wordpress.com/145/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=145&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://usefulaspandcsharp.wordpress.com/2010/06/23/adding-text-to-an-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sarah</media:title>
		</media:content>
	</item>
		<item>
		<title>How To Enable Integrated Windows Authentication in IIS 7</title>
		<link>http://usefulaspandcsharp.wordpress.com/2010/06/16/how-to-enable-integrated-windows-authentication-in-iis-7/</link>
		<comments>http://usefulaspandcsharp.wordpress.com/2010/06/16/how-to-enable-integrated-windows-authentication-in-iis-7/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 14:15:00 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[asp.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[General Code]]></category>
		<category><![CDATA[.net 1.1]]></category>
		<category><![CDATA[iis 7]]></category>
		<category><![CDATA[integrated windows authentication]]></category>
		<category><![CDATA[Unable to start debugging on the web server. Debugging failed because integrated windows authentication is not enabled]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[visual studio 2003]]></category>

		<guid isPermaLink="false">https://usefulaspandcsharp.wordpress.com/2010/06/16/how-to-enable-integrated-windows-authentication-in-iis-7/</guid>
		<description><![CDATA[I’m currently working on a website that was created in .NET 1.1 and Visual Studio 2003 and I had nothing but nightmares getting it to work on my Vista machine which is running IIS7! My final hurdle was getting it to run in Debug from Visual Studio 2003. To do this I needed to enable [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=141&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I’m currently working on a website that was created in .NET 1.1 and Visual Studio 2003 and I had nothing but nightmares getting it to work on my Vista machine which is running IIS7! My final hurdle was getting it to run in Debug from Visual Studio 2003. To do this I needed to enable integrated Windows authentication for the website. So here is how I did it:</p>
<p>1 &#8211; Open IIS Manager</p>
<p>2 – Highlight your website that you want to enable integrated Windows authentication for</p>
<p><a href="http://usefulaspandcsharp.files.wordpress.com/2010/06/iis71.jpg"><img style="display:inline;border:0;" title="iis7" src="http://usefulaspandcsharp.files.wordpress.com/2010/06/iis7_thumb1.jpg?w=515&#038;h=308" border="0" alt="iis7" width="515" height="308" /></a></p>
<p>3 – Double-click the Authentication tab</p>
<p>4 – Where it says “Windows Authentication” in the Name column, the status column should read “Enabled”. If it reads disabled, right click and select “Enable”.</p>
<p><a href="http://usefulaspandcsharp.files.wordpress.com/2010/06/iis72.jpg"><img style="display:inline;border:0;" title="iis72" src="http://usefulaspandcsharp.files.wordpress.com/2010/06/iis72_thumb.jpg?w=515&#038;h=309" border="0" alt="iis72" width="515" height="309" /></a></p>
<p>This did it for me and I was then able to go back into my Visual Studio 2003 environment and successfully run the website in debug mode. <strong>REMEMBER!!!</strong> Visual Studio 2003 might need to be run as an administrator to allow debugging (Right Click &#8212; Run as administrator) so if you are still having problems give that a go!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/usefulaspandcsharp.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/usefulaspandcsharp.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/usefulaspandcsharp.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/usefulaspandcsharp.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/usefulaspandcsharp.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/usefulaspandcsharp.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/usefulaspandcsharp.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/usefulaspandcsharp.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/usefulaspandcsharp.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/usefulaspandcsharp.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/usefulaspandcsharp.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/usefulaspandcsharp.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/usefulaspandcsharp.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/usefulaspandcsharp.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=141&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://usefulaspandcsharp.wordpress.com/2010/06/16/how-to-enable-integrated-windows-authentication-in-iis-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sarah</media:title>
		</media:content>

		<media:content url="http://usefulaspandcsharp.files.wordpress.com/2010/06/iis7_thumb1.jpg" medium="image">
			<media:title type="html">iis7</media:title>
		</media:content>

		<media:content url="http://usefulaspandcsharp.files.wordpress.com/2010/06/iis72_thumb.jpg" medium="image">
			<media:title type="html">iis72</media:title>
		</media:content>
	</item>
		<item>
		<title>How to retrieve Connection Strings from a Web App config file</title>
		<link>http://usefulaspandcsharp.wordpress.com/2010/05/12/how-to-retrieve-connection-strings-from-a-web-app-config-file/</link>
		<comments>http://usefulaspandcsharp.wordpress.com/2010/05/12/how-to-retrieve-connection-strings-from-a-web-app-config-file/#comments</comments>
		<pubDate>Wed, 12 May 2010 10:15:00 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[asp.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[connection]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[get connection string from config file]]></category>
		<category><![CDATA[retrieve connection string]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[strings]]></category>
		<category><![CDATA[system.configuration]]></category>
		<category><![CDATA[web application]]></category>
		<category><![CDATA[web.config]]></category>

		<guid isPermaLink="false">https://usefulaspandcsharp.wordpress.com/2010/05/12/how-to-retrieve-connection-strings-from-a-web-app-config-file/</guid>
		<description><![CDATA[A friend of mine who’s just starting out with a bit of C# and asp.NET asked me about this yesterday. He had spent the evening before doing lots of searching and hadn’t found anything that actually helped him get his connection string from his web.config file into the C#. So I thought I’d write a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=131&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A friend of mine who’s just starting out with a bit of C# and asp.NET asked me about this yesterday. He had spent the evening before doing lots of searching and hadn’t found anything that actually helped him get his connection string from his web.config file into the C#. So I thought I’d write a little post about it. </p>
<p>The common practice with connection strings in asp.NET is to put them in your web.config file. By doing this, when you need to change your connection string, for example when you put it on your web server, you can change it in one place in the config file and your web application doesn’t need to be changed or rebuilt in any way. As mentioned above, the problem my friend had was getting the connection string from the config file into the C# so here’s some code example to show how it’s done.</p>
<p>1. Put your connection string in your config file (<a href="http://www.connectionstrings.com">www.connectionstrings.com</a> is a great resource to help with formatting of connection strings and different types of connection strings for different servers). Please excuse the formatting of the XML below, it wouldn’t allow me to use the &lt;&gt; tag’s in the code box so this was a better way!</p>
<p>&lt;connectionStrings&gt;</p>
<blockquote><p>&lt;add name=”UsefulAppConnString” connectionString=”Data Source=myServerAddress;Initial Catalog=myDataBase;IntegratedSecurity=SSPI;”</p>
</blockquote>
<p>&lt;/connectionStrings&gt;</p>
<p>2. Add a reference to System.Configuration (right click ‘References &gt; Add Reference’, select the .NET tab and find System.Configuration. Double click it or highlight it and click ‘OK’).</p>
<p><a href="http://usefulaspandcsharp.files.wordpress.com/2010/05/addref.png"><img title="addref" style="display:inline;border-width:0;" height="264" alt="addref" src="http://usefulaspandcsharp.files.wordpress.com/2010/05/addref_thumb.png?w=313&#038;h=264" width="313" border="0" /></a> </p>
<p>3. Add a using statement to your C# class where you will be pulling in the connection string.</p>
<p> <code>using System.Configuration;</code>
<p>4. Now you have everything you need to get the connection string! In this example I’m just going to put it in a string variable. You could assign it to a string variable when your web app loads that could then be accessed throughout your web application or you could just retrieve it from the config file every time you wanted to use it. That’s up to you. </p>
<p> <code>string connString = ConfigurationManager.ConnectionStrings[&quot;UsefulAppConnString&quot;].ToString();</code>
<p>You can also store the connection string in the appSettings part of a config file. If you do, you will need to use ConfigurationManager.AppSettings instead of ConfigurationManager.ConnectionStrings. </p>
<p>So the ConfigurationManager is effectively your config file. Using ConfigurationManager.ConnectionStrings is looking at the data within the ConnectionStrings tags in your config file. The name in the square brackets as you’ve probably noticed is the name attribute I assigned to my connection string in step 1.</p>
<p>So there it is. How to retrieve your connection string from your web.config file. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/usefulaspandcsharp.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/usefulaspandcsharp.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/usefulaspandcsharp.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/usefulaspandcsharp.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/usefulaspandcsharp.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/usefulaspandcsharp.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/usefulaspandcsharp.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/usefulaspandcsharp.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/usefulaspandcsharp.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/usefulaspandcsharp.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/usefulaspandcsharp.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/usefulaspandcsharp.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/usefulaspandcsharp.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/usefulaspandcsharp.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=131&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://usefulaspandcsharp.wordpress.com/2010/05/12/how-to-retrieve-connection-strings-from-a-web-app-config-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sarah</media:title>
		</media:content>

		<media:content url="http://usefulaspandcsharp.files.wordpress.com/2010/05/addref_thumb.png" medium="image">
			<media:title type="html">addref</media:title>
		</media:content>
	</item>
		<item>
		<title>Date Manipulation in C#</title>
		<link>http://usefulaspandcsharp.wordpress.com/2010/03/30/date-manipulation-in-c/</link>
		<comments>http://usefulaspandcsharp.wordpress.com/2010/03/30/date-manipulation-in-c/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 13:28:00 +0000</pubDate>
		<dc:creator>Sarah</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[add]]></category>
		<category><![CDATA[adddays]]></category>
		<category><![CDATA[addhours]]></category>
		<category><![CDATA[addminutes]]></category>
		<category><![CDATA[addmonths]]></category>
		<category><![CDATA[addseconds]]></category>
		<category><![CDATA[addyears]]></category>
		<category><![CDATA[C sharp]]></category>
		<category><![CDATA[date format]]></category>
		<category><![CDATA[date manipulation]]></category>
		<category><![CDATA[datetime to string]]></category>
		<category><![CDATA[days]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[hours]]></category>
		<category><![CDATA[manipulation]]></category>
		<category><![CDATA[minus]]></category>
		<category><![CDATA[minutes]]></category>
		<category><![CDATA[months]]></category>
		<category><![CDATA[seconds]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[subtract]]></category>
		<category><![CDATA[years]]></category>

		<guid isPermaLink="false">http://usefulaspandcsharp.wordpress.com/2010/03/30/date-manipulation-in-c/</guid>
		<description><![CDATA[DateTime to String When you have a DateTime object that you want to store or present as a string, I find the easiest way to format the date is as follows: DateTime today = DateTime.Now; string stDate = today.ToString(&#34;dd MMMM yyyy&#34;); This code will return &#34;30 March 2010&#34;. You can format it as you like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=128&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><u>DateTime to String</u></strong></p>
<p>When you have a DateTime object that you want to store or present as a string, I find the easiest way to format the date is as follows:</p>
<p> <code>DateTime today = DateTime.Now;    <br />string stDate = today.ToString(&quot;dd MMMM yyyy&quot;);</code>
<p>This code will return &quot;30 March 2010&quot;. You can format it as you like using the ToString method, using the key string combinations for different ways of displaying days, months, year, minutes and seconds. I have linked to a useful site in a previous post that will give you the string combinations you can use, here’s the link again <a href="http://blog.stevex.net/string-formatting-in-csharp/">http://blog.stevex.net/string-formatting-in-csharp/</a> . The ones you will probably use most are under Custom Date Formatting on that site. </p>
<p>If you wanted to add the “th” after the date you could do the following:</p>
<p> <code>DateTime today = DateTime.Now;    <br />string stDate = String.Format(&quot;{0}th {1}&quot;, today.ToString(&quot;dd&quot;), today.ToString(&quot;MMMM yyyy&quot;));</code>
<p>This code will return “30th March 2010”.</p>
<p><strong><u>Adding &amp; Subtracting Days / Months / Years / Hours / Minutes / Seconds</u></strong></p>
<p>There are methods available to add days, months and years to a DateTime object. AddDays(), AddMonths() etc. So if I wanted to show 6 months time, I would use the following code:</p>
<p> <code>DateTime sixMonthsTime = DateTime.Now.AddMonths(6);    <br />string stDate = sixMonthsTime.ToString(&quot;MMMM yyyy&quot;);</code>
<p>This code will return “September 2010”.</p>
<p>To subtract days, months, years etc, we use the same method. If I wanted to show 6 months ago, I would use the following code:</p>
<p> <code>DateTime sixMonthsTime = DateTime.Now.AddMonths(-6);   <br />string stDate = sixMonthsTime.ToString(&quot;MMMM yyyy&quot;);</code>
<p>This code will return “September 2009”.</p>
<p>&#160;</p>
<p>This is all I have chance to write on this subject at the moment but I will add to this post whenever I get chance or come across something new. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/usefulaspandcsharp.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/usefulaspandcsharp.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/usefulaspandcsharp.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/usefulaspandcsharp.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/usefulaspandcsharp.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/usefulaspandcsharp.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/usefulaspandcsharp.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/usefulaspandcsharp.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/usefulaspandcsharp.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/usefulaspandcsharp.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/usefulaspandcsharp.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/usefulaspandcsharp.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/usefulaspandcsharp.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/usefulaspandcsharp.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=usefulaspandcsharp.wordpress.com&amp;blog=4896339&amp;post=128&amp;subd=usefulaspandcsharp&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://usefulaspandcsharp.wordpress.com/2010/03/30/date-manipulation-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">Sarah</media:title>
		</media:content>
	</item>
	</channel>
</rss>
