<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Asp.Net</title>
        <link>http://geekswithblogs.net/sglima/category/10033.aspx</link>
        <description>Asp.Net</description>
        <language>pt</language>
        <copyright>Sglima</copyright>
        <managingEditor>sglima@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>How to handle ""Maximum request length exceeded" exception</title>
            <link>http://geekswithblogs.net/sglima/archive/2011/09/20/how-to-handle-maximum-request-length-exceeded-exception.aspx</link>
            <description>&lt;p&gt;In global.asax:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre style="background: black; color: white; font-family: Consolas;"&gt;&lt;span style="color: rgb(147, 199, 99);"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(147, 199, 99);"&gt;void&lt;/span&gt; Application_BeginRequest(&lt;span style="color: rgb(103, 140, 177);"&gt;Object&lt;/span&gt; sender, &lt;span style="color: rgb(103, 140, 177);"&gt;EventArgs&lt;/span&gt; e)
{
	&lt;span style="color: rgb(103, 140, 177);"&gt;HttpRuntimeSection&lt;/span&gt; runTime &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; (&lt;span style="color: rgb(103, 140, 177);"&gt;HttpRuntimeSection&lt;/span&gt;)&lt;span style="color: rgb(103, 140, 177);"&gt;WebConfigurationManager&lt;/span&gt;&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;GetSection(&lt;span style="color: rgb(236, 118, 0);"&gt;"system.web/httpRuntime"&lt;/span&gt;);
	&lt;span style="color: rgb(102, 116, 123);"&gt;//Approx 100 Kb(for page content) size has been deducted because the maxRequestLength proprty is the page size, not only the file upload size&lt;/span&gt;
	&lt;span style="color: rgb(147, 199, 99);"&gt;int&lt;/span&gt; maxRequestLength &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; (runTime&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;MaxRequestLength &lt;span style="color: rgb(232, 226, 183);"&gt;-&lt;/span&gt; &lt;span style="color: rgb(255, 205, 34);"&gt;100&lt;/span&gt;) &lt;span style="color: rgb(232, 226, 183);"&gt;*&lt;/span&gt; &lt;span style="color: rgb(255, 205, 34);"&gt;1024&lt;/span&gt;;
 
	&lt;span style="color: rgb(102, 116, 123);"&gt;//This code is used to check the request length of the page and if the request length is greater than &lt;/span&gt;
	&lt;span style="color: rgb(102, 116, 123);"&gt;//MaxRequestLength then retrun to the same page with extra query string value action=exception&lt;/span&gt;

	&lt;span style="color: rgb(103, 140, 177);"&gt;HttpContext&lt;/span&gt; context &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; ((&lt;span style="color: rgb(103, 140, 177);"&gt;HttpApplication&lt;/span&gt;)sender)&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;Context;
	&lt;span style="color: rgb(147, 199, 99);"&gt;if&lt;/span&gt;(context&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;Request&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;ContentLength &lt;span style="color: rgb(232, 226, 183);"&gt;&amp;gt;&lt;/span&gt; maxRequestLength)
	{
		&lt;span style="color: rgb(140, 140, 180);"&gt;IServiceProvider&lt;/span&gt; provider &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; (&lt;span style="color: rgb(140, 140, 180);"&gt;IServiceProvider&lt;/span&gt;)context;
		&lt;span style="color: rgb(103, 140, 177);"&gt;HttpWorkerRequest&lt;/span&gt; workerRequest &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; (&lt;span style="color: rgb(103, 140, 177);"&gt;HttpWorkerRequest&lt;/span&gt;)provider&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;GetService(&lt;span style="color: rgb(147, 199, 99);"&gt;typeof&lt;/span&gt;(&lt;span style="color: rgb(103, 140, 177);"&gt;HttpWorkerRequest&lt;/span&gt;));
		&lt;span style="color: rgb(102, 116, 123);"&gt;// Check if body contains data&lt;/span&gt;
		&lt;span style="color: rgb(147, 199, 99);"&gt;if&lt;/span&gt;(workerRequest&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;HasEntityBody())
		{
			&lt;span style="color: rgb(102, 116, 123);"&gt;// get the total body length&lt;/span&gt;
			&lt;span style="color: rgb(147, 199, 99);"&gt;int&lt;/span&gt; requestLength &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; workerRequest&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;GetTotalEntityBodyLength();
			&lt;span style="color: rgb(102, 116, 123);"&gt;// Get the initial bytes loaded&lt;/span&gt;
			&lt;span style="color: rgb(147, 199, 99);"&gt;int&lt;/span&gt; initialBytes &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(255, 205, 34);"&gt;0&lt;/span&gt;;
			&lt;span style="color: rgb(147, 199, 99);"&gt;if&lt;/span&gt;(workerRequest&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;GetPreloadedEntityBody() &lt;span style="color: rgb(232, 226, 183);"&gt;!=&lt;/span&gt; &lt;span style="color: rgb(147, 199, 99);"&gt;null&lt;/span&gt;)
				initialBytes &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; workerRequest&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;GetPreloadedEntityBody()&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;Length;
			&lt;span style="color: rgb(147, 199, 99);"&gt;if&lt;/span&gt;(&lt;span style="color: rgb(232, 226, 183);"&gt;!&lt;/span&gt;workerRequest&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;IsEntireEntityBodyIsPreloaded())
			{
				&lt;span style="color: rgb(147, 199, 99);"&gt;byte&lt;/span&gt;[] buffer &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(147, 199, 99);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(147, 199, 99);"&gt;byte&lt;/span&gt;[&lt;span style="color: rgb(255, 205, 34);"&gt;512000&lt;/span&gt;];
				&lt;span style="color: rgb(102, 116, 123);"&gt;// Set the received bytes to initial bytes before start reading&lt;/span&gt;
				&lt;span style="color: rgb(147, 199, 99);"&gt;int&lt;/span&gt; receivedBytes &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; initialBytes;
				&lt;span style="color: rgb(147, 199, 99);"&gt;while&lt;/span&gt;(requestLength &lt;span style="color: rgb(232, 226, 183);"&gt;-&lt;/span&gt; receivedBytes &lt;span style="color: rgb(232, 226, 183);"&gt;&amp;gt;=&lt;/span&gt; initialBytes)
				{
					&lt;span style="color: rgb(102, 116, 123);"&gt;// Read another set of bytes&lt;/span&gt;
					initialBytes &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; workerRequest&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;ReadEntityBody(buffer, buffer&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;Length);
					&lt;span style="color: rgb(102, 116, 123);"&gt;// Update the received bytes&lt;/span&gt;
					receivedBytes &lt;span style="color: rgb(232, 226, 183);"&gt;+=&lt;/span&gt; initialBytes;
				}
				initialBytes &lt;span style="color: rgb(232, 226, 183);"&gt;=&lt;/span&gt; workerRequest&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;ReadEntityBody(buffer, requestLength &lt;span style="color: rgb(232, 226, 183);"&gt;-&lt;/span&gt; receivedBytes);
			}
		}
		&lt;span style="color: rgb(102, 116, 123);"&gt;// Redirect the user to the same page with querystring action=exception. &lt;/span&gt;
		context&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;Response&lt;span style="color: rgb(232, 226, 183);"&gt;.&lt;/span&gt;Redirect(&lt;span style="color: rgb(236, 118, 0);"&gt;"~/Erros/FicheiroGrande.aspx"&lt;/span&gt;);
	}
}&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;a targuet="_blank" href="http://www.velocityreviews.com/forums/t97027-how-to-handle-maximum-request-length-exceeded-exception.html"&gt;Source&lt;/a&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/146957.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2011/09/20/how-to-handle-maximum-request-length-exceeded-exception.aspx</guid>
            <pubDate>Tue, 20 Sep 2011 11:36:54 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/146957.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2011/09/20/how-to-handle-maximum-request-length-exceeded-exception.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/146957.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to execute a javascript function every time an updatepanel executes an async postback</title>
            <link>http://geekswithblogs.net/sglima/archive/2011/09/20/how-to-execute-a-javascript-function-every-time-an-updatepanel.aspx</link>
            <description>&lt;p&gt;&amp;lt;script type="text/javascript" language="javascript"&amp;gt;&lt;/p&gt;
&lt;p&gt;        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(refresh);&lt;/p&gt;
&lt;p&gt;        function refresh()          {  		//Your code here;  	}&lt;/p&gt;
&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;a targuet="_blank" href="http://zeemalik.wordpress.com/2007/11/27/how-to-call-client-side-javascript-function-after-an-updatepanel-asychronous-ajax-request-is-over/"&gt;Source&lt;/a&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/146956.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2011/09/20/how-to-execute-a-javascript-function-every-time-an-updatepanel.aspx</guid>
            <pubDate>Tue, 20 Sep 2011 09:57:32 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/146956.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2011/09/20/how-to-execute-a-javascript-function-every-time-an-updatepanel.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/146956.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to: Invoke a method by name</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/05/31/how-to-invoke-a-method-by-name.aspx</link>
            <description>&lt;p&gt;Type myType = typeof(MyClass);&lt;/p&gt;
&lt;p&gt;string methodName = "methodNameAsString";&lt;/p&gt;
&lt;p&gt;MethodInfo myTypeGetMethod = myType.GetMethod(methodName);&lt;/p&gt;
&lt;p&gt;MyClass obj = new MyClass();&lt;/p&gt;
&lt;p&gt;object[] parms = { 123, "string test"};&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color: #ff9900"&gt;myTypeGetMethod.Invoke(obj, args);&lt;/span&gt;&lt;br /&gt;
 &lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/140158.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/05/31/how-to-invoke-a-method-by-name.aspx</guid>
            <pubDate>Mon, 31 May 2010 13:41:50 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/140158.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/05/31/how-to-invoke-a-method-by-name.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/140158.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to: Change Master Page at runtine</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/03/03/how-to-change-master-page-at-runtine.aspx</link>
            <description>&lt;p&gt;        protected override void OnPreInit(EventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            Page.MasterPageFile = "~/LinkToMasterPage";&lt;br /&gt;
            base.OnInit(e);&lt;br /&gt;
        }&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Enjoy :)&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/138299.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/03/03/how-to-change-master-page-at-runtine.aspx</guid>
            <pubDate>Wed, 03 Mar 2010 11:39:49 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/138299.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/03/03/how-to-change-master-page-at-runtine.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/138299.aspx</wfw:commentRss>
        </item>
        <item>
            <title>How to use an Aspx as a proxy for a PDF file</title>
            <link>http://geekswithblogs.net/sglima/archive/2010/02/05/how-to-use-an-aspx-as-a-proxy-for-a.aspx</link>
            <description>&lt;pre class="prettyprint"&gt;&lt;code&gt;&lt;span class="typ"&gt;Response&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Clear&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="typ"&gt;Response&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;ContentType&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"application/pdf"&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="typ"&gt;Response&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;AddHeader&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Content-Disposition"&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"attachment;filename=\"FileName.pdf\""&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="typ"&gt;Response&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;BinaryWrite&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;yourPdfAsByteArray&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="typ"&gt;Response&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;Flush&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="typ"&gt;Response&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;End&lt;/span&gt;&lt;span class="pun"&gt;();     &lt;p /&gt;&lt;a href="http://stackoverflow.com/questions/2057836/how-can-i-return-a-pdf-from-a-web-request-in-asp-net" target="_blank"&gt;Source&lt;/a&gt;&lt;p /&gt;Enjoy :)&lt;br /&gt;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/137816.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2010/02/05/how-to-use-an-aspx-as-a-proxy-for-a.aspx</guid>
            <pubDate>Fri, 05 Feb 2010 18:25:55 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/137816.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2010/02/05/how-to-use-an-aspx-as-a-proxy-for-a.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/137816.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Hidding auto generated columns in GridView</title>
            <link>http://geekswithblogs.net/sglima/archive/2009/10/29/hidding-auto-generated-columns-in-gridview.aspx</link>
            <description>Hello,&lt;br /&gt;
&lt;br /&gt;
If you are reading this you probably have already realized that it is not possible to hide a column that was auto-generated using &lt;span style="font-style: italic;"&gt;myGridView.Columns[index].Visible=false;&lt;/span&gt;&lt;br /&gt;
To achieve this you must:&lt;br /&gt;
1 - set the OnRowCreated to execute a function, something like OnRowCreated="gridRowCreated"&lt;br /&gt;
2 - Create your function as such:&lt;br /&gt;
&lt;br /&gt;
protected void gridRowCreated(object sender, GridViewRowEventArgs e)&lt;br /&gt;
        {&lt;br /&gt;
            e.Row.Cells[yourIndexHere].Visible = false;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
Hope this helps ;) &lt;img src="http://geekswithblogs.net/sglima/aggbug/135792.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2009/10/29/hidding-auto-generated-columns-in-gridview.aspx</guid>
            <pubDate>Thu, 29 Oct 2009 14:23:58 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/135792.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2009/10/29/hidding-auto-generated-columns-in-gridview.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/135792.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Prevent Double Post</title>
            <link>http://geekswithblogs.net/sglima/archive/2009/08/19/prevent-double-post.aspx</link>
            <description>A few days ago I got an error report to fix. Some web application that I now maintain was inserting duplicate records. &lt;br /&gt;
&lt;br /&gt;
After a quick look it became obvious that the users where double clicking the submit button and that made the page post twice and so a duplicate record would appear.&lt;br /&gt;
&lt;br /&gt;
A quick fix dor this problem using javascript:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script language="javascript" type="text/javascript"&amp;gt;&lt;br /&gt;
        var haveSubmitted=false;&lt;br /&gt;
        function FirstSubmitOnly() {&lt;br /&gt;
            if (haveSubmitted)&lt;br /&gt;
                return false;&lt;br /&gt;
&lt;br /&gt;
            haveSubmitted = true;&lt;br /&gt;
            return true;&lt;br /&gt;
        }&lt;br /&gt;
    &amp;lt;/script&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And at the form tag just invoke the function &amp;lt;form id="form1" runat="server" onsubmit="return FirstSubmitOnly();"&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enjoy :) &lt;img src="http://geekswithblogs.net/sglima/aggbug/134194.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2009/08/19/prevent-double-post.aspx</guid>
            <pubDate>Wed, 19 Aug 2009 17:26:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/134194.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2009/08/19/prevent-double-post.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/134194.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Keep Scroll on Postback</title>
            <link>http://geekswithblogs.net/sglima/archive/2009/06/05/keep-scrool-on-postback.aspx</link>
            <description>I think at some point everybody had this problem... A big form with some control that forces a postback. If you have scrolled down, the page scroll will be placed at the top.&lt;br /&gt;
&lt;br /&gt;
To force the aspx to keep the scroll, just place the following instrucion on the &amp;lt;pages&amp;gt; tag of your web config.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pages maintainScrollPositionOnPostBack="true"&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enjoy :) &lt;img src="http://geekswithblogs.net/sglima/aggbug/132646.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2009/06/05/keep-scrool-on-postback.aspx</guid>
            <pubDate>Fri, 05 Jun 2009 16:30:31 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/132646.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2009/06/05/keep-scrool-on-postback.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/132646.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Asp.Net Auto refresh</title>
            <link>http://geekswithblogs.net/sglima/archive/2009/05/04/asp.net-auto-refresh.aspx</link>
            <description>&lt;span style="font-family: monospace; font-size: 9pt; color: rgb(0, 0, 255);"&gt;&lt;span style="font-family: monospace; font-size: 9pt; color: rgb(0, 0, 255);"&gt;&lt;span style="font-family: monospace; font-size: 9pt; color: rgb(0, 0, 255);"&gt;&lt;span style="font-family: monospace; font-size: 9pt; color: rgb(0, 0, 255);"&gt;&lt;span style="font-family: monospace; font-size: 9pt; color: rgb(0, 0, 255);"&gt;&lt;span style="font-family: monospace; font-size: 9pt; color: rgb(0, 0, 255);"&gt;&lt;span style="font-family: monospace; font-weight: bold; font-size: 9pt; color: rgb(0, 0, 255);"&gt;Simple how to refresh page every 60 seconds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;&lt;span style="font-family: monospace; font-weight: bold; font-size: 9pt; color: rgb(128, 0, 0);"&gt;meta&lt;/span&gt;&lt;span style="font-family: monospace; font-weight: bold; font-size: 9pt; color: rgb(255, 0, 255);"&gt; &lt;/span&gt;&lt;span style="font-family: monospace; font-weight: bold; font-size: 9pt; color: rgb(255, 0, 0);"&gt;http-equiv&lt;/span&gt;&lt;span style="font-family: monospace; font-weight: bold; font-size: 9pt; color: rgb(0, 0, 255);"&gt;="refresh"&lt;/span&gt;&lt;span style="font-family: monospace; font-weight: bold; font-size: 9pt; color: rgb(255, 0, 255);"&gt; &lt;/span&gt;&lt;span style="font-family: monospace; font-weight: bold; font-size: 9pt; color: rgb(255, 0, 0);"&gt;content&lt;/span&gt;&lt;span style="font-family: monospace; font-weight: bold; font-size: 9pt; color: rgb(0, 0, 255);"&gt;="60"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;img src="http://geekswithblogs.net/sglima/aggbug/131714.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2009/05/04/asp.net-auto-refresh.aspx</guid>
            <pubDate>Mon, 04 May 2009 17:05:39 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/131714.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2009/05/04/asp.net-auto-refresh.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/131714.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Export Aspx to Excel</title>
            <link>http://geekswithblogs.net/sglima/archive/2009/04/17/export-aspx-to-excel.aspx</link>
            <description>Just a simple snippet to show how an aspx can be exported to Excel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Response.ClearContent();&lt;br /&gt;
Response.Buffer = true;&lt;br /&gt;
Response.ContentType = "application/vnd.ms-excel";&lt;br /&gt;
Response.AddHeader("content-disposition", "attachment; filename=" + "teste" + ".xls;charset=iso-8859-1");&lt;br /&gt;
&lt;br /&gt;
StreamWriter sw = new StreamWriter(Response.OutputStream, System.Text.Encoding.GetEncoding("iso-8859-1"));&lt;br /&gt;
HtmlTextWriter htmlTextWriter = new HtmlTextWriter(sw);&lt;br /&gt;
this.RenderControl(htmlTextWriter);&lt;br /&gt;
&lt;br /&gt;
Response.End(); &lt;img src="http://geekswithblogs.net/sglima/aggbug/131270.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Sglima</dc:creator>
            <guid>http://geekswithblogs.net/sglima/archive/2009/04/17/export-aspx-to-excel.aspx</guid>
            <pubDate>Fri, 17 Apr 2009 22:49:31 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sglima/comments/131270.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sglima/archive/2009/04/17/export-aspx-to-excel.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sglima/comments/commentRss/131270.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
