<?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>Suraj&#039;s blog &#187; Fiddler</title>
	<atom:link href="http://www.surajshrestha.com.np/tag/fiddler/feed" rel="self" type="application/rss+xml" />
	<link>http://www.surajshrestha.com.np</link>
	<description>imagination more important than knowledge</description>
	<lastBuildDate>Sun, 08 Aug 2010 23:20:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Difference between Response.Redirect() and Server.Transfer() in ASP.Net</title>
		<link>http://www.surajshrestha.com.np/web-application/difference-between-responseredirect-and-servertransfer-in-aspnet.html</link>
		<comments>http://www.surajshrestha.com.np/web-application/difference-between-responseredirect-and-servertransfer-in-aspnet.html#comments</comments>
		<pubDate>Sat, 09 May 2009 04:32:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Application]]></category>
		<category><![CDATA[Fiddler]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[HTTP Request and Respond]]></category>
		<category><![CDATA[Packet Sniffer]]></category>

		<guid isPermaLink="false">http://www.surajshrestha.com.np/?p=156</guid>
		<description><![CDATA[Response.Redirect() and Server.Transfer() both bring the contents from new location (specified as parameter) in web server to the client (browser). However, there are some key differences between these two commands. ]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">Response.Redirect() and Server.Transfer() both bring the contents from new location (specified as parameter) in web server to the client (browser). However, there are some key differences between these two commands. The main difference is that, Redirect() forces the browser to redirect to new location whereas Transfer() makes server to transfer to new location. The point here is, who does the work, it is either client or server. I am going to deal the difference in terms of the HTTP Request generated and HTTP Response received.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">Steps involved in Response.Redirect()</span></span></p>
<p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;" lang="EN-US"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>Client (browser) sends a POST or GET request to the web server with details of new web location to be redirected.</span></span></span></p>
<p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;" lang="EN-US"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">Server checks the new location and if the location is found, it will respond back with 302 Found message. The response message format is like shown below. The message is catched by packet sniffing software called fiddler2.</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">HTTP/1.1 302 Found</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">Server: ASP.NET Development Server/9.0.0.0</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">Date: Fri, 08 May 2009 13:49:28 GMT</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">X-AspNet-Version: 2.0.50727</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">Location: /StateDemoApp/StatusPage.aspx</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">Set-Cookie: tempCookie=6; path=/</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">Set-Cookie: permCookie=0; expires=Fri, 08-May-2009 13:51:28 GMT; path=/</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">Cache-Control: private</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">Content-Type: text/html; charset=utf-8</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">Content-Length: 150</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">Connection: Close</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;"> </span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">&lt;html&gt;&lt;head&gt;&lt;title&gt;Object moved&lt;/title&gt;&lt;/head&gt;&lt;body&gt;</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">&lt;h2&gt;Object moved to &lt;a href=&#8221;%2fStateDemoApp%2fStatusPage.aspx&#8221;&gt;here&lt;/a&gt;.&lt;/h2&gt;</span></span></p>
<p class="MsoNoSpacing" style="margin: 0in 0in 0pt 1in;"><span style="font-size: 9pt;" lang="EN-US"><span style="font-family: Calibri;">&lt;/body&gt;&lt;/html&gt;</span></span></p>
<p class="MsoListParagraphCxSpFirst" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;" lang="EN-US"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">The client knows that this message is not for display and it is ok to redirect to new location.</span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;" lang="EN-US"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">Then, client generates a new GET HTTP Request, requesting contents from new location.</span></span></p>
<p class="MsoListParagraphCxSpLast" style="text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;" lang="EN-US"><span style="mso-list: Ignore;"><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: 7pt &quot;Times New Roman&quot;;">       </span></span></span><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">The server then serves it as a brand new request. It does not remember the client as it is follow up of previous Response.Redirect(). In fact, no need to remember.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">So, in Response.Redirect(), two round trips to the server are involved. In Response.Redirect(), we cannot pass on the form variable. Also, we cannot preserve those variables for reuse. In this method, the control is completely transferred to new page. However, the execution of current page can still be continued.</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 10pt;"><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">In Server.Tranfer() method, the transfer is done by server. In involves only one round trip to server. The server finds out the new location and if it ok, it serves the content. The new content from new location is served as the part of the originating application, i.e. the URL address remains same and not changed to new address unlike in Redirect() method. So, this method has got one major disadvantage that, if somebody wants to bookmark the new address, he or she will not be able to do so, as only one address is visible in address bar.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.surajshrestha.com.np/web-application/difference-between-responseredirect-and-servertransfer-in-aspnet.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Difference between refreshing a webpage and just hitting Enter in address bar</title>
		<link>http://www.surajshrestha.com.np/web-application/difference-between-refreshing-a-webpage-and-just-hitting-enter-in-address-bar.html</link>
		<comments>http://www.surajshrestha.com.np/web-application/difference-between-refreshing-a-webpage-and-just-hitting-enter-in-address-bar.html#comments</comments>
		<pubDate>Fri, 08 May 2009 05:21:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Application]]></category>
		<category><![CDATA[Fiddler]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[HTTP Request and Respond]]></category>
		<category><![CDATA[IE Facts]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Packet Sniffer]]></category>

		<guid isPermaLink="false">http://www.surajshrestha.com.np/?p=147</guid>
		<description><![CDATA[Let’s say that, you have loaded a webpage in Internet Explorer and some images are not loaded. Now, you may either refresh the webpage by pressing F5 (or clicking Refresh) or you may hit Enter in address bar to reload the page. Are these actions similar? No. But, for a novice user, it may seem [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="MARGIN: 0in 0in 10pt"><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">Let’s say that, you have loaded a webpage in Internet Explorer and some images are not loaded. Now, you may either refresh the webpage by pressing F5 (or clicking Refresh) or you may hit Enter in address bar to reload the page. Are these actions similar? No. But, for a novice user, it may seem similar. In fact they are same if the last action was sending HTTP request using GET method. But if, last action was using POST method, then they behave differently, although results may be same. I am going to analyze the difference in these actions in this post.</span></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 10pt"><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">Pressing F5 is a complete refresh. It resends the last HTTP Request to the web server completely. That means, if the last HTTP Request was using POST method, it will submit all the form variables again. So, the server will think as new request and process it accordingly. This is a very important thing to be taken care of, while doing online financial transactions. In fact, Internet Explorer and almost all browsers (including Mozilla Firefox and Chrome) warns about the resending the data again. Internet Explorer displays following warning.</span></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 10pt 0.5in"><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">“To display the webpage again, Internet Explorer needs to resend the information you’ve previously submitted. If you were making a purchase, you should click Cancel to avoid a duplicate transaction. Otherwise, click Retry to display the webpage again.”</span></span> </p>
<p class="MsoNormal" style="MARGIN: 0in 0in 10pt 0.5in"><img class="aligncenter" title="Refresh webpage warning" src="http://farm4.static.flickr.com/3386/3512348768_aff1348623.jpg?v=0" alt="" width="445" height="227" /></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 10pt"><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">You can check what data is actually sent to the web server through packet sniffers like Fiddler. It will display the HTTP Request sent to server. The request will include HTTP method, protocol, headers and contents. </span></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 10pt"> <img class="aligncenter" title="Fiddler" src="http://farm4.static.flickr.com/3302/3512348790_78e75a0357.jpg?v=0" alt="" width="500" height="281" /></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 10pt"><span lang="EN-US"><span style="font-family: Calibri; font-size: small;"> </span></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 10pt"><span lang="EN-US"><span style="font-size: small;"><span style="font-family: Calibri;">However, if you just press Enter in the address bar, you are safer. It is because, the browser sends the request now by using ‘GET’ method for ‘POST’ method also. As we know, the ‘GET’ method does not send the form data. So, the web server will think that it is not a new request. If server somehow figures out the state of this GET request from cookies and other header information, it serves the page again. In fact, in Internet Explorer 8, if all the data is already loaded in the window, and if you pressed Enter in address bar, it won’t generate and send any requests. Instead, it displays what it has stored in memory. But if you copy the link to new tab of IE8, it will generate new GET request as described above. <span style="mso-spacerun: yes"> </span></span></span></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 10pt"><span lang="EN-US"><span style="font-family: Calibri; font-size: small;">Finally, one major difference you must have noticed, i.e., if you are logged into hotmail account, refreshing the window is slower that just pressing the Enter in address bar.</span></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 10pt 0.5in"> </p>
<p> </p>
<p class="MsoNormal" style="MARGIN: 0in 0in 10pt 0.5in"> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.surajshrestha.com.np/web-application/difference-between-refreshing-a-webpage-and-just-hitting-enter-in-address-bar.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
