<?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/"
	>

<channel>
	<title>Dima</title>
	<atom:link href="http://kostikov.co.uk/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://kostikov.co.uk/blog</link>
	<description>etc</description>
	<lastBuildDate>Mon, 28 Mar 2011 14:27:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>How to make HTML5 work in Internet Explorer: IE6, IE7, IE8</title>
		<link>http://kostikov.co.uk/blog/?p=49</link>
		<comments>http://kostikov.co.uk/blog/?p=49#comments</comments>
		<pubDate>Mon, 28 Mar 2011 14:23:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://kostikov.co.uk/blog/?p=49</guid>
		<description><![CDATA[Having played with the html5 elements I came across a problem - they will be ignored by older IE browsers. So you won't be able to style html5 page that contains lines of code like this: &#160; &#60;header&#62;This is header&#60;/header&#62; &#160; IEs will display the text as if it would be outside the "header" tag. [...]]]></description>
			<content:encoded><![CDATA[<p>Having played with the html5 elements I came across a problem - they will be ignored by older IE browsers. So you won't be able to style html5 page that contains lines of code like this:</p>
<pre>&nbsp;
&lt;header&gt;This is header&lt;/header&gt;
&nbsp;</pre>
<p>IEs will display the text as if it would be outside the "header" tag. The solution I've found is to fix it using javascript:</p>
<pre class="html4strict">&nbsp;
<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!--[if lt IE 9]&gt;</span>
</span>
&nbsp;
  <span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    document.createElement('header');
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;</span>!<span style="color: #66cc66;">&#91;</span>endif<span style="color: #66cc66;">&#93;</span>--<span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;</pre>
<p>How to apply the fix to the other html5 elements you can find right <a href="http://www.communitymx.com/content/article.cfm?cid=8C170" target='_blank'>here</a></p>
<p>But how to fix that if the user have javascript disabled? - This is the question.</p>
]]></content:encoded>
			<wfw:commentRss>http://kostikov.co.uk/blog/?feed=rss2&#038;p=49</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>asp.net: how to make asp:button render a button tagname with type=submit</title>
		<link>http://kostikov.co.uk/blog/?p=21</link>
		<comments>http://kostikov.co.uk/blog/?p=21#comments</comments>
		<pubDate>Fri, 25 Mar 2011 08:56:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kostikov.co.uk/blog/?p=21</guid>
		<description><![CDATA[Sometimes when I try to style the asp:button I get pretty frustrated because it has its limitations as it's not a container so you can't add any elements inside it. The real question is - why did Microsoft not make it possible to change the asp:button behaviour so it would be the option which tag [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes when I try to style the asp:button I get pretty frustrated because it has its limitations as it's not a container so you can't add any elements inside it. The real question is - why did Microsoft not make it possible to change the asp:button behaviour so it would be the option which tag you want to render? [sigh]<br />
There are some articles in the internet saying how you can fix that by using web control adaptors or even javascript.<br />
But what I really wanted is to have a different control that would render what I wanted it to. So I came up with the solution of extending the standard asp:button and overriding a couple of methods in it. The code is below. It's very simple and seems to work for me.</p>
<pre class="csharp">&nbsp;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Collections</span>.<span style="color: #0000FF;">Generic</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Linq</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Text</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">ComponentModel</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>.<span style="color: #0000FF;">WebControls</span>;
&nbsp;
<span style="color: #0600FF;">namespace</span> MyControls
<span style="color: #000000;">&#123;</span>
    <span style="color: #008080; font-style: italic;">/// Class extending Button, but rendering button type='submit'</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> ButtonSubmit : Button
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">public</span> ButtonSubmit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
            : <span style="color: #0600FF;">base</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> Value
        <span style="color: #000000;">&#123;</span>
            get
            <span style="color: #000000;">&#123;</span>
                <span style="color: #FF0000;">string</span> str = <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#41;</span>ViewState<span style="color: #000000;">&#91;</span><span style="color: #808080;">&quot;Value&quot;</span><span style="color: #000000;">&#93;</span>;
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>str != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    <span style="color: #0600FF;">return</span> str;
                <span style="color: #000000;">&#125;</span>
                <span style="color: #0600FF;">return</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span>;
            <span style="color: #000000;">&#125;</span>
            set <span style="color: #000000;">&#123;</span> ViewState<span style="color: #000000;">&#91;</span><span style="color: #808080;">&quot;Value&quot;</span><span style="color: #000000;">&#93;</span> = value; <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> RenderBeginTag<span style="color: #000000;">&#40;</span>HtmlTextWriter writer<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            AddAttributesToRender<span style="color: #000000;">&#40;</span>writer<span style="color: #000000;">&#41;</span>;
            writer.<span style="color: #0000FF;">RenderBeginTag</span><span style="color: #000000;">&#40;</span>HtmlTextWriterTag.<span style="color: #0000FF;">Button</span><span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> RenderContents<span style="color: #000000;">&#40;</span>HtmlTextWriter writer<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>HasControls<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">RenderChildren</span><span style="color: #000000;">&#40;</span>writer<span style="color: #000000;">&#41;</span>;
            <span style="color: #0600FF;">else</span>
                writer.<span style="color: #0000FF;">Write</span><span style="color: #000000;">&#40;</span>Text<span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> AddAttributesToRender<span style="color: #000000;">&#40;</span>HtmlTextWriter writer<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">// substitute &quot;text&quot; with &quot;value&quot; because the base class uses &quot;text&quot; for &quot;value&quot;</span>
            <span style="color: #FF0000;">string</span> strText = Text;
            Text = Value;
            <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">AddAttributesToRender</span><span style="color: #000000;">&#40;</span>writer<span style="color: #000000;">&#41;</span>;
            Text = strText;
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://kostikov.co.uk/blog/?feed=rss2&#038;p=21</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Install IE9 on Windows XP</title>
		<link>http://kostikov.co.uk/blog/?p=19</link>
		<comments>http://kostikov.co.uk/blog/?p=19#comments</comments>
		<pubDate>Thu, 17 Mar 2011 08:48:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kostikov.co.uk/blog/?p=19</guid>
		<description><![CDATA[This is just not fair. If you're a web developer and you've got Windows XP running on your machine - Microsoft actually force you to pay them in order to upgrade your system. I've come across this article telling us about the ways you can use to install Internet Explorer 9 on Windows XP. But [...]]]></description>
			<content:encoded><![CDATA[<p>This is just not fair. If you're a web developer and you've got Windows XP running on your machine - Microsoft actually force you to pay them in order to upgrade your system. I've come across this <a href="http://www.pubarticles.com/article-how-to-install-ie9-on-windows-xp-service-pack-3-1285493009.html">article</a> telling us about the ways you can use to install Internet Explorer 9 on Windows XP. But apparently - you can't do this. So spend some money and be happy.</p>
]]></content:encoded>
			<wfw:commentRss>http://kostikov.co.uk/blog/?feed=rss2&#038;p=19</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Difference between ref and out in .net</title>
		<link>http://kostikov.co.uk/blog/?p=17</link>
		<comments>http://kostikov.co.uk/blog/?p=17#comments</comments>
		<pubDate>Tue, 28 Jul 2009 10:35:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[out parameters]]></category>
		<category><![CDATA[procedure]]></category>
		<category><![CDATA[ref parameters]]></category>

		<guid isPermaLink="false">http://kostikov.co.uk/blog/?p=17</guid>
		<description><![CDATA[There are a couple of ways getting output parameters from .net procedures: you can use the keyword out or the keyword ref. Like so: public void DoSmth&#40;ref int nRefVar&#41;&#123;&#125; or public void DoSmth&#40;out int nOutVar&#41;&#123;&#125; What's the difference? Well, that's pretty easy. To pass a variable by reference, first you have create that reference by [...]]]></description>
			<content:encoded><![CDATA[<p>There are a couple of ways getting output parameters from .net procedures: you can use the keyword <strong>out </strong>or the keyword <strong>ref</strong>. Like so:</p>
<pre class="csharp"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> DoSmth<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ref</span> <span style="color: #FF0000;">int</span> nRefVar<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span></pre>
<p>or</p>
<pre class="csharp"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> DoSmth<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">out</span> <span style="color: #FF0000;">int</span> nOutVar<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span></pre>
<p>What's the difference? Well, that's pretty easy. To pass a variable by reference, first you have create that reference by initializing the variable. Usually you want to use this way when you're gonna use the value of the variable inside the function.</p>
<pre class="csharp"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> DoSmth<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ref</span> <span style="color: #FF0000;">int</span> nRefVar<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>nRef &amp;gt; <span style="color: #FF0000;">10</span><span style="color: #000000;">&#41;</span>
nRef = <span style="color: #FF0000;">5</span>;
<span style="color: #0600FF;">else</span>
nRef = <span style="color: #FF0000;">25</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #FF0000;">int</span> nRefVar = <span style="color: #FF0000;">10</span>;
DoSmth<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ref</span> nRefVar<span style="color: #000000;">&#41;</span>;</pre>
<p>To pass a variable as an <strong>out </strong>parameter you have only to declare it first. This way is just for getting the value. Usually you will need it when you have to get more than one return value from a procedure.</p>
<pre class="csharp"><span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> DoSmth<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">out</span> <span style="color: #FF0000;">int</span> nOutVar1, <span style="color: #0600FF;">out</span> <span style="color: #FF0000;">int</span> nOutVar2<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
nOutVar1 = <span style="color: #FF0000;">1</span>;
nOutVar2 = <span style="color: #FF0000;">2</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #FF0000;">int</span> nOutVar1, nOutVar2;
DoSmth<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">out</span> nOutVar1, <span style="color: #0600FF;">out</span> nOutVar2<span style="color: #000000;">&#41;</span>;</pre>
<p>Good Luck</p>
]]></content:encoded>
			<wfw:commentRss>http://kostikov.co.uk/blog/?feed=rss2&#038;p=17</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>asp.net interview question</title>
		<link>http://kostikov.co.uk/blog/?p=16</link>
		<comments>http://kostikov.co.uk/blog/?p=16#comments</comments>
		<pubDate>Fri, 24 Jul 2009 08:57:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://kostikov.co.uk/blog/?p=16</guid>
		<description><![CDATA[Here is a list of some basic ASP.Net interview question. I've come across them here: http://weblogs.asp.net/anasghanem/archive/2008/02/22/common-net-technical-questions-that-you-will-be-asked-about-in-the-interviews.aspx For those who looks for a new job 1. Explain the life cycle of an ASP .NET page. 2. Explain the .NET architecture. 3. What are object-oriented concepts? 4. How do you create multiple inheritance in c# and .NET? 5. When is web.config called? [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a list of some basic ASP.Net interview question. I've come across them here: http://weblogs.asp.net/anasghanem/archive/2008/02/22/common-net-technical-questions-that-you-will-be-asked-about-in-the-interviews.aspx</p>
<p>For those who looks for a new job <img src='http://kostikov.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="display: block" class="ACECollapsed" border="0" id="divExpCollAsst_39"><font face="Arial">1. Explain the life cycle of an ASP .NET page.<br />
2. Explain the .NET architecture.<br />
3. What are object-oriented concepts?<br />
4. How do you create multiple inheritance in c# and .NET?<br />
5. When is web.config called?<br />
6. Differences between DLL and EXE?<br />
7. Can an assembly have EXE?<br />
8. Can a DLL be changed to an EXE?<br />
9. Compare &amp; contrast rich client (smart clients or Windows-based) &amp; browser-based Web application<br />
10. Compare Client server application with n-Tier application<br />
11. Can a try block have more than one catch block?<br />
12. Can a try block have nested try blocks?<br />
13. How do you load an assembly at runtime?<br />
14. If I am writing in a language like VB or C++, what are the procedures to be followed to support .NET?<br />
15. How do you view the methods and members of a DLL?<br />
16. What is shadowing?<br />
17. What are the collections you’ve used?<br />
18. What is a static class?<br />
19. What is static member?<br />
20. What is static function?<br />
21. What is static constructor?<br />
22. How can we inherit a static variable?<br />
23. How can we inherit a static member?<br />
24. Can we use a static function with a non-static variable?<br />
25. How can we access static variable?<br />
26. Why main function is static?<br />
27. What is garbage collection?<br />
28. Can we force garbage collector to run?<br />
29. What is reflection?<br />
30. What are different type of JIT?<br />
31. What are Value types and Reference types?<br />
32. What is concept of Boxing and Unboxing?<br />
33. What’s difference between VB.NET and C#?<br />
34. What’s difference between System exceptions and Application exceptions?<br />
35. What is CODE Access security?<br />
36. What is a satellite assembly?<br />
37. How to prevent my .NET DLL to be decompiled?<br />
38. What’s the difference between Convert.toString and .toString() method ?<br />
39. What is Native Image Generator (Ngen.exe)?<br />
We have two version of the same assembly in GAC? I want my client to make choice which assembly to choose?<br />
40. What is CodeDom?</font></span></p>
]]></content:encoded>
			<wfw:commentRss>http://kostikov.co.uk/blog/?feed=rss2&#038;p=16</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uploading and executing an SQL Script File using ASP.Net and osql</title>
		<link>http://kostikov.co.uk/blog/?p=15</link>
		<comments>http://kostikov.co.uk/blog/?p=15#comments</comments>
		<pubDate>Fri, 11 Apr 2008 09:53:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[executing file]]></category>
		<category><![CDATA[osql]]></category>
		<category><![CDATA[uploading]]></category>

		<guid isPermaLink="false">http://kostikov.co.uk/blog/?p=15</guid>
		<description><![CDATA[Now I am gonna tell how to upload a file containg T-SQL script using ASP.Net and execute entire of the file using osql utility tool. Note: This example is using the UploadFile method from the previous article &#160; using System; using System.Web; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.IO; using System.Diagnostics; &#160; // some [...]]]></description>
			<content:encoded><![CDATA[<p>Now I am gonna tell how to upload a file containg T-SQL script using ASP.Net and execute entire of the file using osql utility tool.<br />
Note: This example is using the UploadFile method from the <a href="http://kostikov.co.uk/blog/?p=14">previous article</a></p>
<pre class="csharp">&nbsp;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>.<span style="color: #0000FF;">HtmlControls</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>.<span style="color: #0000FF;">WebControls</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">IO</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Diagnostics</span>;    
&nbsp;
<span style="color: #008080; font-style: italic;">// some code goes here</span>
<span style="color: #008080; font-style: italic;">// ..................</span>
<span style="color: #008080; font-style: italic;">// ...................    </span>
&nbsp;
<span style="color: #FF0000;">string</span> strResult = <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span>;
<span style="color: #008080; font-style: italic;">// first of all the file should be uploaded</span>
<span style="color: #008080; font-style: italic;">// let's use the UploadFile procedure from the previous article</span>
<span style="color: #FF0000;">string</span> strFileName = <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span>;
<span style="color: #FF0000;">string</span> strBaseFolder = <span style="color: #808080;">&quot;c:<span style="color: #008080; font-weight: bold;">\u</span>ploads&quot;</span>;
<span style="color: #FF0000;">string</span> strFolder = Path.<span style="color: #0000FF;">Combine</span><span style="color: #000000;">&#40;</span>strBaseFolder, Guid.<span style="color: #0000FF;">NewGuid</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #FF0000;">bool</span> bIsOk;
<span style="color: #0600FF;">try</span>
<span style="color: #000000;">&#123;</span>
	bIsOk = UploadFile<span style="color: #000000;">&#40;</span>FileInputControl, strFolder, <span style="color: #0600FF;">ref</span> strFileName<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">catch</span>
<span style="color: #000000;">&#123;</span>
	bIsOk = <span style="color: #0600FF;">false</span>;
<span style="color: #000000;">&#125;</span>    
&nbsp;
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>bIsOk<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #008080; font-style: italic;">// getting full file path</span>
	<span style="color: #FF0000;">string</span> strFilePath = Path.<span style="color: #0000FF;">Combine</span><span style="color: #000000;">&#40;</span>strFolder, strFileName<span style="color: #000000;">&#41;</span>;    
&nbsp;
	<span style="color: #008080; font-style: italic;">// here we should set connection parameters (i.e. they could be taken from web.config)</span>
	<span style="color: #FF0000;">string</span> strServerName = <span style="color: #808080;">&quot;&quot;</span>, strDBName = <span style="color: #808080;">&quot;&quot;</span>, strUserName = <span style="color: #808080;">&quot;&quot;</span>, strPassword = <span style="color: #808080;">&quot;&quot;</span>;    
&nbsp;
	<span style="color: #008080; font-style: italic;">// executing entire script</span>
	<span style="color: #0600FF;">using</span> <span style="color: #000000;">&#40;</span>Process proc = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Process<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		proc.<span style="color: #0000FF;">StartInfo</span>.<span style="color: #0000FF;">FileName</span> = <span style="color: #808080;">&quot;osql&quot;</span>;
		proc.<span style="color: #0000FF;">StartInfo</span>.<span style="color: #0000FF;">Arguments</span> = <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;/S {0} /U {1} /P {2} /d {3} /i {4}&quot;</span>,
			strServerName, strUserName, strPassword, strDBName, strFilePath<span style="color: #000000;">&#41;</span>;
		proc.<span style="color: #0000FF;">StartInfo</span>.<span style="color: #0000FF;">UseShellExecute</span> = <span style="color: #0600FF;">false</span>;
		proc.<span style="color: #0000FF;">StartInfo</span>.<span style="color: #0000FF;">RedirectStandardOutput</span> = <span style="color: #0600FF;">true</span>;
		proc.<span style="color: #0000FF;">StartInfo</span>.<span style="color: #0000FF;">RedirectStandardError</span> = <span style="color: #0600FF;">true</span>;
		proc.<span style="color: #0000FF;">StartInfo</span>.<span style="color: #0000FF;">CreateNoWindow</span> = <span style="color: #0600FF;">true</span>;
		<span style="color: #0600FF;">try</span>
		<span style="color: #000000;">&#123;</span>
			proc.<span style="color: #0000FF;">Start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			proc.<span style="color: #0000FF;">WaitForExit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			strResult = proc.<span style="color: #0000FF;">StandardOutput</span>.<span style="color: #0000FF;">ReadToEnd</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			proc.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0600FF;">catch</span>
		<span style="color: #000000;">&#123;</span>
			strResult = <span style="color: #808080;">@"The script can not be executed.
                                           Make sure there is osql utility on the server.&quot;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>    
&nbsp;
	<span style="color: #008080; font-style: italic;">// now lets delete the file as we don't want it to be saved on the server</span>
	Directory.<span style="color: #0000FF;">Delete</span><span style="color: #000000;">&#40;</span>strFolder, <span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">else</span>
<span style="color: #000000;">&#123;</span>
	strResult = <span style="color: #808080;">&quot;The file cannot be uploaded to the server&quot;</span>;
<span style="color: #000000;">&#125;</span>    
&nbsp;
<span style="color: #008080; font-style: italic;">// now we could display strResult variable containg information about script execution</span>
<span style="color: #008080; font-style: italic;">// i.e. using Response.Write method</span>
Page.<span style="color: #0000FF;">Response</span>.<span style="color: #0000FF;">Write</span><span style="color: #000000;">&#40;</span>strResult<span style="color: #000000;">&#41;</span>;</pre>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://kostikov.co.uk/blog/?feed=rss2&#038;p=15</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uploading a file using ASP.Net</title>
		<link>http://kostikov.co.uk/blog/?p=14</link>
		<comments>http://kostikov.co.uk/blog/?p=14#comments</comments>
		<pubDate>Thu, 10 Apr 2008 13:20:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fileupload]]></category>
		<category><![CDATA[uploading]]></category>

		<guid isPermaLink="false">http://kostikov.co.uk/blog/?p=14</guid>
		<description><![CDATA[I know there are loads of articles related to uploading a file usin ASP.Net application. But still there is my method of doing that. Usually while creating a web application all my pages extend one base class but not the Page class. I always create some base class which extends the Page, so I could [...]]]></description>
			<content:encoded><![CDATA[<p>I know there are loads of articles related to uploading a file usin ASP.Net application. But still there is my method of doing that. Usually while creating a web application all my pages extend one base class but not the Page class. I always create some base class which extends the Page, so I could add some basic functionality and it and use it on any page I want. So the UploadFile procedure would on the methods of my base page class.</p>
<pre class="csharp">&nbsp;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>.<span style="color: #0000FF;">WebControls</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>.<span style="color: #0000FF;">HtmlControls</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">IO</span>;    
&nbsp;
<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> MyPage : Page
<span style="color: #000000;">&#123;</span>
..........
    <span style="color: #008080; font-style: italic;">// strUploadFolder - full path to the folder in which we are gonna store the file (i.e c:\savehere)</span>
    <span style="color: #008080; font-style: italic;">// strFileName - return parameter, that will store upaded file's name</span>
    <span style="color: #008080; font-style: italic;">// function returns true if uploading has been successfull, otherwise we get false</span>
    <span style="color: #0600FF;">protected</span> <span style="color: #FF0000;">bool</span> UploadFile<span style="color: #000000;">&#40;</span>HtmlInputFile fileinput, <span style="color: #FF0000;">string</span> strUploadFolder, <span style="color: #0600FF;">ref</span> <span style="color: #FF0000;">string</span> strFileName<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        HttpPostedFile myFile = fileinput.<span style="color: #0000FF;">PostedFile</span>;
        <span style="color: #FF0000;">int</span> nFileLen = myFile.<span style="color: #0000FF;">ContentLength</span>;
        strFileName = <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span>;
        <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>nFileLen &amp;gt; <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #FF0000;">byte</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> myData = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> <span style="color: #FF0000;">byte</span><span style="color: #000000;">&#91;</span>nFileLen<span style="color: #000000;">&#93;</span>;
            myFile.<span style="color: #0000FF;">InputStream</span>.<span style="color: #0000FF;">Read</span><span style="color: #000000;">&#40;</span>myData, <span style="color: #FF0000;">0</span>, nFileLen<span style="color: #000000;">&#41;</span>;
            strFileName = Path.<span style="color: #0000FF;">GetFileName</span><span style="color: #000000;">&#40;</span>myFile.<span style="color: #0000FF;">FileName</span><span style="color: #000000;">&#41;</span>;    
&nbsp;
            <span style="color: #0600FF;">try</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>!Directory.<span style="color: #0000FF;">Exists</span><span style="color: #000000;">&#40;</span>strUploadFolder<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
	       Directory.<span style="color: #0000FF;">CreateDirectory</span><span style="color: #000000;">&#40;</span>strUploadFolder<span style="color: #000000;">&#41;</span>;
                <span style="color: #0600FF;">using</span> <span style="color: #000000;">&#40;</span>FileStream newFile = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> FileStream<span style="color: #000000;">&#40;</span>Path.<span style="color: #0000FF;">Combine</span><span style="color: #000000;">&#40;</span>strUploadFolder, strFileName<span style="color: #000000;">&#41;</span>,
                                       FileMode.<span style="color: #0000FF;">Create</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
	   <span style="color: #000000;">&#123;</span>
	       newFile.<span style="color: #0000FF;">Write</span><span style="color: #000000;">&#40;</span>myData, <span style="color: #FF0000;">0</span>, myData.<span style="color: #0000FF;">Length</span><span style="color: #000000;">&#41;</span>;
	       newFile.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
                <span style="color: #000000;">&#125;</span>
            <span style="color: #000000;">&#125;</span>
            <span style="color: #0600FF;">catch</span> <span style="color: #000000;">&#40;</span>Exception ex<span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">throw</span> ex;
            <span style="color: #000000;">&#125;</span>
            <span style="color: #0600FF;">return</span> <span style="color: #0600FF;">true</span>;
        <span style="color: #000000;">&#125;</span>
        <span style="color: #0600FF;">else</span>
            <span style="color: #0600FF;">return</span> <span style="color: #0600FF;">false</span>;
    <span style="color: #000000;">&#125;</span>
..........
<span style="color: #000000;">&#125;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://kostikov.co.uk/blog/?feed=rss2&#038;p=14</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a new column to a MS SQL Table safely</title>
		<link>http://kostikov.co.uk/blog/?p=13</link>
		<comments>http://kostikov.co.uk/blog/?p=13#comments</comments>
		<pubDate>Tue, 08 Apr 2008 10:59:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[sql]]></category>
		<category><![CDATA[add a column]]></category>
		<category><![CDATA[alter table]]></category>
		<category><![CDATA[t-sql]]></category>

		<guid isPermaLink="false">http://kostikov.co.uk/blog/?p=13</guid>
		<description><![CDATA[How could we check if a column exists and add it to a table if it doesn't? Very easily! &#160; IF NOT EXISTS &#40;SELECT * FROM syscolumns WHERE id = OBJECT_ID&#40;N'[MyTable]'&#41; AND name = 'MyColumn'&#41; ALTER TABLE dbo.MyTable ADD MyColumn INT Enjoy!]]></description>
			<content:encoded><![CDATA[<p>How could we check if a column exists and add it to a table if it doesn't? Very easily!</p>
<pre class="tsql">&nbsp;
<span style="color: #0000FF;">IF</span> NOT EXISTS
	<span style="color: #808080;">&#40;</span><span style="color: #0000FF;">SELECT</span> * <span style="color: #0000FF;">FROM</span> syscolumns
	<span style="color: #0000FF;">WHERE</span> id = <span style="color: #FF00FF;">OBJECT_ID</span><span style="color: #808080;">&#40;</span>N<span style="color: #FF0000;">'[MyTable]'</span><span style="color: #808080;">&#41;</span> AND name = <span style="color: #FF0000;">'MyColumn'</span><span style="color: #808080;">&#41;</span>
             <span style="color: #0000FF;">ALTER</span> <span style="color: #0000FF;">TABLE</span> dbo.<span style="color: #202020;">MyTable</span> <span style="color: #0000FF;">ADD</span> MyColumn <span style="color: #0000FF;">INT</span></pre>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://kostikov.co.uk/blog/?feed=rss2&#038;p=13</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ASP.Net QueryString Builder</title>
		<link>http://kostikov.co.uk/blog/?p=11</link>
		<comments>http://kostikov.co.uk/blog/?p=11#comments</comments>
		<pubDate>Tue, 25 Mar 2008 12:25:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://kostikov.co.uk/blog/?p=11</guid>
		<description><![CDATA[I was trying to find any classes allowing easily modify querystring. I have found a couple of good ones but not ideal for me. So I have created my own class. It has a number of static functions which could be called without creating an instance of the class - if you need to use [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to find any classes allowing easily modify querystring. I have found a couple of good ones but not ideal for me. So I have created my own class. It has a number of static functions which could be called without creating an instance of the class - if you need to use some basic stuff. Here it is:</p>
<pre class="csharp">&nbsp;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Collections</span>.<span style="color: #0000FF;">Generic</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Linq</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Text</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>.<span style="color: #0000FF;">HtmlControls</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">UI</span>.<span style="color: #0000FF;">WebControls</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Collections</span>;
<span style="color: #0600FF;">using</span> <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Collections</span>.<span style="color: #0000FF;">Specialized</span>;
&nbsp;
<span style="color: #0600FF;">namespace</span> ClassLibrary
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> QueryStringBuilder
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">protected</span> NameValueCollection m_QueryString;
&nbsp;
        <span style="color: #0600FF;">public</span> QueryStringBuilder<span style="color: #000000;">&#40;</span>NameValueCollection nvcQueryString<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            m_QueryString = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> NameValueCollection<span style="color: #000000;">&#40;</span>nvcQueryString<span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// static function returning a new querystring with a new parameter</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> NameValueCollection QSWithParameter<span style="color: #000000;">&#40;</span>NameValueCollection nvcCurrentQS,
                                                      <span style="color: #FF0000;">string</span> strParameterName, <span style="color: #FF0000;">string</span> strParameterValue<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            NameValueCollection nvcQS = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> NameValueCollection<span style="color: #000000;">&#40;</span>nvcCurrentQS<span style="color: #000000;">&#41;</span>;
&nbsp;
            <span style="color: #0600FF;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> i = <span style="color: #FF0000;">0</span>; i &amp;lt; nvcQS.<span style="color: #0000FF;">Count</span>; i++<span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>nvcQS.<span style="color: #0000FF;">GetKey</span><span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span> == <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    nvcQS.<span style="color: #0000FF;">Remove</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>;
                    <span style="color: #0600FF;">break</span>;
                <span style="color: #000000;">&#125;</span>
            <span style="color: #000000;">&#125;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>nvcQS.<span style="color: #0000FF;">GetValues</span><span style="color: #000000;">&#40;</span>strParameterName<span style="color: #000000;">&#41;</span> == <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                nvcQS.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>strParameterName, strParameterValue<span style="color: #000000;">&#41;</span>;
            <span style="color: #0600FF;">else</span>
                nvcQS<span style="color: #000000;">&#91;</span>strParameterName<span style="color: #000000;">&#93;</span> = strParameterValue;
            <span style="color: #0600FF;">return</span> nvcQS;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// function returning a new querystring with a new parameter</span>
        <span style="color: #0600FF;">public</span> NameValueCollection QSWithParameter<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> strParameterName, <span style="color: #FF0000;">string</span> strParameterValue<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> QSWithParameter<span style="color: #000000;">&#40;</span>m_QueryString, strParameterName, strParameterValue<span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// static function returning a querystring without a parameter</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> NameValueCollection QSWithoutParameter<span style="color: #000000;">&#40;</span>NameValueCollection nvcCurrentQS,
                                                                               <span style="color: #FF0000;">string</span> strParameterName<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            NameValueCollection nvcQS = <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> NameValueCollection<span style="color: #000000;">&#40;</span>nvcCurrentQS<span style="color: #000000;">&#41;</span>;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>nvcQS.<span style="color: #0000FF;">GetValues</span><span style="color: #000000;">&#40;</span>strParameterName<span style="color: #000000;">&#41;</span> != <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
                nvcQS.<span style="color: #0000FF;">Remove</span><span style="color: #000000;">&#40;</span>strParameterName<span style="color: #000000;">&#41;</span>;
            <span style="color: #0600FF;">return</span> nvcQS;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// function returning a querystring without a parameter</span>
        <span style="color: #0600FF;">public</span> NameValueCollection QSWithoutParameter<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> strParameterName<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> QSWithoutParameter<span style="color: #000000;">&#40;</span>m_QueryString, strParameterName<span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// static function returning url with a querystring</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> UrlWithQueryString<span style="color: #000000;">&#40;</span>NameValueCollection nvcQueryString, <span style="color: #FF0000;">string</span> strUrl<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #FF0000;">int</span> nQS = strUrl.<span style="color: #0000FF;">IndexOf</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;?&quot;</span><span style="color: #000000;">&#41;</span>;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>nQS &amp;gt; <span style="color: #FF0000;">-1</span><span style="color: #000000;">&#41;</span>
                strUrl = strUrl.<span style="color: #0000FF;">Substring</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">0</span>, nQS<span style="color: #000000;">&#41;</span>;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>nvcQueryString.<span style="color: #0000FF;">Count</span> &amp;gt; <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> i = <span style="color: #FF0000;">0</span>; i &amp;lt; nvcQueryString.<span style="color: #0000FF;">Count</span>; i++<span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    strUrl += <span style="color: #FF0000;">String</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;{0}{1}={2}&quot;</span>, i == <span style="color: #FF0000;">0</span> ? <span style="color: #808080;">&quot;?&quot;</span> : <span style="color: #808080;">&quot;&amp;amp;&quot;</span>, nvcQueryString.<span style="color: #0000FF;">Keys</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>,
                                                                                    nvcQueryString<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;
                <span style="color: #000000;">&#125;</span>
            <span style="color: #000000;">&#125;</span>
            <span style="color: #0600FF;">return</span> strUrl;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// static function returning RawUrl with a querystring</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span> UrlWithQueryString<span style="color: #000000;">&#40;</span>NameValueCollection nvcQueryString<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> UrlWithQueryString<span style="color: #000000;">&#40;</span>nvcQueryString, HttpContext.<span style="color: #0000FF;">Current</span>.<span style="color: #0000FF;">Request</span>.<span style="color: #0000FF;">RawUrl</span><span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// function returning url with a current querystring</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> UrlWithQueryString<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> strUrl<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> UrlWithQueryString<span style="color: #000000;">&#40;</span>m_QueryString, strUrl<span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// function returning RawUrl with a current querystring</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">string</span> UrlWithQueryString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> UrlWithQueryString<span style="color: #000000;">&#40;</span>m_QueryString<span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// procedure removing a parameter from a current querystring</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> RemoveQSParameter<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> strParameterName<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            m_QueryString = QSWithoutParameter<span style="color: #000000;">&#40;</span>strParameterName<span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080; font-style: italic;">// procedure adding a parameter to a current querystring</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> SetQSParameter<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> strParameterName, <span style="color: #FF0000;">string</span> strParameterValue<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            m_QueryString = QSWithParameter<span style="color: #000000;">&#40;</span>strParameterName, strParameterValue<span style="color: #000000;">&#41;</span>;
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://kostikov.co.uk/blog/?feed=rss2&#038;p=11</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net 3.5. Where?</title>
		<link>http://kostikov.co.uk/blog/?p=10</link>
		<comments>http://kostikov.co.uk/blog/?p=10#comments</comments>
		<pubDate>Sat, 22 Mar 2008 22:52:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[asp.net. .net]]></category>

		<guid isPermaLink="false">http://kostikov.co.uk/blog/?p=10</guid>
		<description><![CDATA[Just found a funny article explaining why after installing .Net 3.5 we can't select ASP.Net 3.5 under a ASP.Net version tab in IIS while setting up a site. I thought the answer was obvious - nobody had said about changing a version of ASP.Net - it is still 2]]></description>
			<content:encoded><![CDATA[<p>Just found a <a href="http://blogs.msdn.com/vijaysk/archive/2008/03/20/running-asp-net-3-5-on-iis.aspx" target="_blank">funny article</a> explaining why after installing .Net 3.5 we can't select ASP.Net 3.5 under a ASP.Net version tab in IIS while setting up a site. I thought the answer was obvious - nobody had said about changing a version of ASP.Net - it is still 2 <img src='http://kostikov.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://kostikov.co.uk/blog/?feed=rss2&#038;p=10</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

