<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://rextang.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Rexiology::Work : ASP.NET</title><link>http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx</link><description>Tags: ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Debug Build: 40407.4157)</generator><item><title>Convert VS2010 Projects back to VS2008 ones…</title><link>http://rextang.net/blogs/work/archive/2009/07/06/6934.aspx</link><pubDate>Mon, 06 Jul 2009 08:41:52 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:6934</guid><dc:creator>rextangtw</dc:creator><slash:comments>4</slash:comments><comments>http://rextang.net/blogs/work/archive/2009/07/06/6934.aspx#comments</comments><description>&lt;p&gt;Crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Long time no blogs. been busy on works, also mostly &lt;a href="http://twitter.com/rextang" target="_blank"&gt;twittering&lt;/a&gt; and &lt;a href="http://www.plurk.com/rextang" target="_blank"&gt;plurking&lt;/a&gt; except blogging. time to write something.&lt;/p&gt;  &lt;p&gt;Before going further, be caution that &lt;strong&gt;&lt;font color="#ff0000"&gt;this is just personal-experience know-how writing, and use at your own risk&lt;/font&gt;&lt;/strong&gt;. &lt;/p&gt;  &lt;p&gt;Being testing &lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx" target="_blank"&gt;Visual Studio 2010 beta 1&lt;/a&gt;, I am writing some projects under it, also using TFS 2010 beta 1 for source control. when you do this like me, you should experience same problems like me. that is, when you want to hand out your project to your team members, you’ll have to force your team to upgrade to VSTS 2010 beta 1, or you’ll have to manually convert all your vsts 2010 projects/solutions back to vsts2008 ones for exchangeability. when you have tens of projects that compose a solution, it will be tidy to manually create projects and reset the source relationships for vsts2008 again. &lt;/p&gt;  &lt;p&gt;so here is the idea, using file-wide string-replacing to convert vsts2010 project/solution files back to vsts2008 ones. I’ve tried it on my own and proved worked. &lt;strong&gt;&lt;font color="#ff0000"&gt;the pre-requisites are that, you only have class library projects, console projects as well as asp.net web projects&lt;/font&gt;&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;so, here are the necessary replacing strings you need to go through. use editors that support file-wide string-replacement (like &lt;a href="http://notepad-plus.sourceforge.net/" target="_blank"&gt;Notepad++&lt;/a&gt;) to do this. don’t replace those in vsts 2010 or vsts 2008 since you are mainly manipulate solution (.sln) and project (.csproj or .vbproj) files.&lt;/p&gt;  &lt;p&gt;for all your project and source files, do the following (find first line and replace to second line):&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;TargetFrameworkMoniker = &amp;quot;.NETFramework,Version=v2.0&amp;quot;     &lt;br /&gt;TargetFramework = &amp;quot;3.5&amp;quot; &lt;/p&gt;    &lt;p&gt;# Visual Studio 10     &lt;br /&gt;# Visual Studio 2008 &lt;/p&gt;    &lt;p&gt;Microsoft Visual Studio Solution File, Format Version 11.00     &lt;br /&gt;Microsoft Visual Studio Solution File, Format Version 10.00 &lt;/p&gt;    &lt;p&gt;&amp;lt;Project ToolsVersion=&amp;quot;4.0&amp;quot;     &lt;br /&gt;&amp;lt;Project ToolsVersion=&amp;quot;3.5&amp;quot; &lt;/p&gt;    &lt;p&gt;&amp;lt;ProductVersion&amp;gt;10.0.20506&amp;lt;/ProductVersion&amp;gt;     &lt;br /&gt;&amp;lt;ProductVersion&amp;gt;9.0.30729&amp;lt;/ProductVersion&amp;gt; &lt;/p&gt;    &lt;p&gt;\VisualStudio\v10.0\     &lt;br /&gt;\VisualStudio\v9.0\ &lt;/p&gt;    &lt;p&gt;&amp;lt;Import Project=&amp;quot;$(MSBuildToolsPath)\Workflow.Targets&amp;quot; /&amp;gt;     &lt;br /&gt;&amp;lt;Import Project=&amp;quot;$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets&amp;quot; /&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This worked on my solutions, you can try to see if it fit to your cases. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;FYI.&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:0cd9b46b-1624-4a75-b895-1bb9a8e3b71f" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/microsoft" rel="tag"&gt;microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/visual+studio" rel="tag"&gt;visual studio&lt;/a&gt;,&lt;a href="http://technorati.com/tags/2008" rel="tag"&gt;2008&lt;/a&gt;,&lt;a href="http://technorati.com/tags/2010" rel="tag"&gt;2010&lt;/a&gt;,&lt;a href="http://technorati.com/tags/project" rel="tag"&gt;project&lt;/a&gt;,&lt;a href="http://technorati.com/tags/solution" rel="tag"&gt;solution&lt;/a&gt;,&lt;a href="http://technorati.com/tags/convert" rel="tag"&gt;convert&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=6934" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category></item><item><title>CRM 4.0, Data Import and TCP Socket Outage...</title><link>http://rextang.net/blogs/work/archive/2009/02/10/6626.aspx</link><pubDate>Tue, 10 Feb 2009 07:21:04 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:6626</guid><dc:creator>rextangtw</dc:creator><slash:comments>1</slash:comments><comments>http://rextang.net/blogs/work/archive/2009/02/10/6626.aspx#comments</comments><description>&lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt; &lt;p&gt;When doing bulk data import on CRM 4.0 using self-made application that utilizes CRM SDK to communicate with web server, if the application is running parallel that simultaneously accessing the server, sometimes you may get this kind of error and the import will fail:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;quot;Only one usage of each socket address (protocol/network address/port) is normally permitted (typically under load).&amp;quot; &lt;/p&gt; &lt;p&gt;or error message in Japanese:&lt;/p&gt; &lt;p&gt;&amp;quot;リモート サーバーに接続できません。 通常、各ソケット アドレスに対してプロトコル、ネットワーク アドレス、またはポートのどれか 1 つのみを使用できます。 10.1.1.1:80&amp;quot;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;when encounter this, mostly it&amp;#39;s likely that the client side is running out the available TCP connection sockets due to that Windows had the default free available socket amount set to 5000 and fast parallel web requests and 240 seconds default TCP TIME_WAIT settings that just occupied all the available sockets in a short interval of time. refer to &lt;a href="http://www.crowehorwath.com/cs/blogs/crm/archive/2009/01/15/crm-webservice-error-only-one-usage-of-each-socket-address-protocol-network-address-port-is-normally-permitted.aspx" target="_blank"&gt;this&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/dgorti/archive/2005/09/18/470766.aspx" target="_blank"&gt;this&lt;/a&gt; for detals.&lt;/p&gt; &lt;p&gt;the solution is to increase the available TCP sockets and decrease the TCP TIME_WAIT interval, at client application machine, via the registry settings.&lt;/p&gt; &lt;p&gt;Increase TCP sockets: add or modify the DWORD key to 65534 (the default is 5000) &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\MaxUserPort&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Decrease the TCP TIME_WAIT time: add or modify the DWORD key to 30 (default is 240 in seconds)&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\TCPTimedWaitDelay&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;remember to restart the client machine to let the settings take effect.&lt;/p&gt; &lt;p&gt;by setting this successfully avoid the error and the data import was done smoothly in a fast powerful production CRM server-farm during our testing. from here we are considering to increase the importing-application parallel rank in order to minimize the initial bulk import time for next step...&lt;/p&gt; &lt;p&gt;the other thing to mention is that, actually the same error also occurred when calling CRM services in Plugins. for this, the CRM Web Server are not only acts as the server, but also a client at consuming itself, and thus for the CRM Web Server that has plugins using CRM web services, it maybe a good idea to also do this workaround to prevent socket outage.&lt;/p&gt; &lt;p&gt;FYI.&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:cc20f923-c433-4e85-8377-6ee94363fc5b" style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/microsoft" rel="tag"&gt;microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/dynamics" rel="tag"&gt;dynamics&lt;/a&gt;,&lt;a href="http://technorati.com/tags/crm" rel="tag"&gt;crm&lt;/a&gt;,&lt;a href="http://technorati.com/tags/bulk" rel="tag"&gt;bulk&lt;/a&gt;,&lt;a href="http://technorati.com/tags/import" rel="tag"&gt;import&lt;/a&gt;,&lt;a href="http://technorati.com/tags/tcp" rel="tag"&gt;tcp&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ip" rel="tag"&gt;ip&lt;/a&gt;,&lt;a href="http://technorati.com/tags/socket" rel="tag"&gt;socket&lt;/a&gt;,&lt;a href="http://technorati.com/tags/web" rel="tag"&gt;web&lt;/a&gt;,&lt;a href="http://technorati.com/tags/service" rel="tag"&gt;service&lt;/a&gt;,&lt;a href="http://technorati.com/tags/networking" rel="tag"&gt;networking&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=6626" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://rextang.net/blogs/work/archive/tags/dynamics/default.aspx">dynamics</category><category domain="http://rextang.net/blogs/work/archive/tags/crm/default.aspx">crm</category></item><item><title>When missing Visual Studio project template...</title><link>http://rextang.net/blogs/work/archive/2009/01/22/6596.aspx</link><pubDate>Thu, 22 Jan 2009 12:12:50 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:6596</guid><dc:creator>rextangtw</dc:creator><slash:comments>0</slash:comments><comments>http://rextang.net/blogs/work/archive/2009/01/22/6596.aspx#comments</comments><description>&lt;p&gt;cross from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt; &lt;p&gt;One of my dev VM had missing all the project template while trying to new a project from selecting &amp;quot;New Project&amp;quot;. had found &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/vssetup/thread/8a5ae9e3-be7b-493d-831c-1e49e8103f26/" target="_blank"&gt;this forum thread&lt;/a&gt; and by running &amp;quot;&lt;strong&gt;DevEnv /InstallVSTemplates&lt;/strong&gt;&amp;quot; from elevated VS2008 Command prompt, all the template just came back without problems.&lt;/p&gt; &lt;p&gt;FYI.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=6596" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category></item><item><title>Dynamically Loading Scripts Files on Dynamics CRM</title><link>http://rextang.net/blogs/work/archive/2008/11/30/6501.aspx</link><pubDate>Sat, 29 Nov 2008 20:48:14 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:6501</guid><dc:creator>rextangtw</dc:creator><slash:comments>1</slash:comments><comments>http://rextang.net/blogs/work/archive/2008/11/30/6501.aspx#comments</comments><description>&lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt; &lt;p&gt;People who are working in customizing &lt;a href="http://www.microsoft.com/dynamics/crm/default.mspx" target="_blank"&gt;Dynamics CRM&lt;/a&gt; system should all sooner or later facing this problem: what can I do to have my common sharing Javascript library injected in an elegant way so that all the events in all my crmForm can use it without problems?&lt;/p&gt; &lt;p&gt;As now I am engaging in a Dynamics CRM customization project and am building a common base framework for CRM developing of our vendors, I am also facing this problem. (also others though...)&lt;/p&gt; &lt;p&gt;In &lt;a href="http://blog.davidyack.com/" target="_blank"&gt;David Yack&lt;/a&gt;&amp;#39;s book &amp;quot;&lt;a href="http://www.amazon.com/CRM-as-Rapid-Development-Platform/dp/0981511813" target="_blank"&gt;CRM as a Rapid Development Platform&lt;/a&gt;&amp;quot;, he is using an OO Javascript writing of base classes to be used in crmForm, and to overcome the offline CRM client problem, paste all the base class code in every entities&amp;#39; form&amp;#39;s OnLoad event. the idea of writing Javascript code in VS2008 and utilizing intellisence support are pretty good ideas also.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.stunnware.com/" target="_blank"&gt;Michael Höhne from Stunnware.com&lt;/a&gt; is using another approach to dynamically load javascript files of common sharing client code to the crmForm. Refer to his excellent articles &lt;a href="http://www.stunnware.com/crm2/topic.aspx?id=JS18" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://www.stunnware.com/crm2/topic.aspx?id=JS19" target="_blank"&gt;here&lt;/a&gt;.&amp;nbsp; Although it&amp;#39;s modifying the form.css file to add extended logics, which becomes an unsupported custimization. he minimized the impacts of the side effects so that it can be easily recovered after a hotfix patch or version up of CRM system. notice that this approach may not work in CRM offline environment and may need further works to deploy your javascript codes into client machines.&lt;/p&gt; &lt;p&gt;if your solution will only target in online environment, like mine this time, I think Michael&amp;#39;s solution will be a good one to implement. base on what you need, choose the proper solution to make your solution work.&lt;/p&gt; &lt;p&gt;FYI.&lt;/p&gt; &lt;p&gt; &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:fa5106e2-812a-4a8d-9b0b-618df10c7924" style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/microsoft" rel="tag"&gt;microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/dynamics" rel="tag"&gt;dynamics&lt;/a&gt;,&lt;a href="http://technorati.com/tags/crm" rel="tag"&gt;crm&lt;/a&gt;,&lt;a href="http://technorati.com/tags/javascript" rel="tag"&gt;javascript&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=6501" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://rextang.net/blogs/work/archive/tags/dynamics/default.aspx">dynamics</category><category domain="http://rextang.net/blogs/work/archive/tags/crm/default.aspx">crm</category></item><item><title>CRM 4 Outlook Client Lost Connection Problem…</title><link>http://rextang.net/blogs/work/archive/2008/09/24/6422.aspx</link><pubDate>Tue, 23 Sep 2008 19:23:42 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:6422</guid><dc:creator>rextangtw</dc:creator><slash:comments>1</slash:comments><comments>http://rextang.net/blogs/work/archive/2008/09/24/6422.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Most of my testing CRM 4 environment were built upon Windows 2008 Server / IIS7 (both 32bit and 64bit) . The server and outlook client installation works fine without problems. started from this week I am making prototyping env. using Windows 2003 Server R2 with IIS6 and after done the installation, the Outlook client kept telling me “Lost Connection to CRM Server” popup messages in the notification area of Vista. the message said&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;“Unable to Connect. Lost Connection to Microsoft Dynamics CRM. Microsoft Dynamics CRM will restore the connection when possible. To stop retrying, right-click and select Sign Out”.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;had a searching and found &lt;a href="http://forums.microsoft.com/Dynamics/ShowPost.aspx?PostID=3008879&amp;amp;SiteID=27" target="_blank"&gt;this thread&lt;/a&gt; about the solution. basically it seems that the outlook client agent just can not have access to CRM web server with proper permissions. by enabling CRM Website with anonymous acess right (via IIS management console). the annoying popup message disappeared. problem solved. &lt;/p&gt;  &lt;p&gt;wondering if enabling annonymous access will affect the security of the CRM site, but since trying access from other computer using IE the form authentication poped out correctly, should be no problems doing settings in this way.&lt;/p&gt;  &lt;p&gt;also wondering why in IIS7 there was no problems like this…&lt;/p&gt;  &lt;p&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/microsoft"&gt;microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/dynamics"&gt;dynamics&lt;/a&gt;,&lt;a href="http://technorati.com/tags/crm"&gt;crm&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=6422" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Information+Technology/default.aspx">Information Technology</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://rextang.net/blogs/work/archive/tags/dynamics/default.aspx">dynamics</category><category domain="http://rextang.net/blogs/work/archive/tags/crm/default.aspx">crm</category></item><item><title>Enable CRM 4 URL QueryString Parameter Passing…</title><link>http://rextang.net/blogs/work/archive/2008/09/24/6421.aspx</link><pubDate>Tue, 23 Sep 2008 17:58:18 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:6421</guid><dc:creator>rextangtw</dc:creator><slash:comments>0</slash:comments><comments>http://rextang.net/blogs/work/archive/2008/09/24/6421.aspx#comments</comments><description>&lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It seems worked while CRM 3.0 that one can pass custom variables via URL’s querystring and use it while form’s onload event. but it’s not worked in CRM 4 by default now. to be able to do this, you have to tune the registry.&lt;/p&gt;  &lt;p&gt;Create a DWORD registry key named [DisableParameterFilter] under [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM], set the value to 1 , and the do a iisreset, this enable the url querystring parameter passing under CRM 4.&lt;/p&gt;  &lt;p&gt;some related discussion &lt;a href="http://groups.google.com.eg/group/microsoft.public.crm.developer/browse_thread/thread/2175622892ba28b7" target="_blank"&gt;here&lt;/a&gt;. but still wondering what will be affected by disabling this “ParameterFilter”, since it seems not documented in any documents I’ve seen…&lt;/p&gt;  &lt;p&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/microsoft"&gt;microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/dynamics"&gt;dynamics&lt;/a&gt;,&lt;a href="http://technorati.com/tags/crm"&gt;crm&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=6421" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://rextang.net/blogs/work/archive/tags/dynamics/default.aspx">dynamics</category><category domain="http://rextang.net/blogs/work/archive/tags/crm/default.aspx">crm</category></item><item><title>Dynamics CRM 4.0 – Hide the Application Menu Toolbar…</title><link>http://rextang.net/blogs/work/archive/2008/08/28/6376.aspx</link><pubDate>Wed, 27 Aug 2008 16:34:20 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:6376</guid><dc:creator>rextangtw</dc:creator><slash:comments>0</slash:comments><comments>http://rextang.net/blogs/work/archive/2008/08/28/6376.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the main page of Dynamics CRM, there is Application Menu Toolbar for users to do most of actions, also allowed for customizations.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rextang.net/photos/work/images/6374/original.aspx" target="_blank"&gt;&lt;img src="http://rextang.net/photos/work/images/6374/500x375.aspx" alt="" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;sometimes you may got customization requirements (like me) not to customize this, but to completely remove it so that user would only be allowed to use Application navigation pane and the Wunderbar in the left side (maybe for the single path page transition for making SOP for users). so I spent some time to find a way to do this and would like to leave a note here.&lt;/p&gt;  &lt;p&gt;if you go standard (supported) ways, it’s not possible to remove the application menu bar by modify sitemap, ISV.config, etc. but if you are an experienced asp.net / web developer, by examing the aspx code, soon you should find a way to workaround this. &lt;/p&gt;  &lt;p&gt;The CRM home page is loaded by the /loader.aspx file, if you look at the code there, you’ll find that the home page is made by several IFrames. the CRM logo image and the menubar is located at top frame, so you can simplely just delete the frame to make it disappear. but if you do so, you’ll soon find that the application won’t function normally anymore and will get errors when you click anything. since actually many of other components are interacting with objects in this application menu bar. &lt;/p&gt;  &lt;p&gt;so how do you solve this? well, simple enough, just adjust the frameset row size to “HIDE” this menu bar, and you are done! in the loader.aspx file, locate the line with&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;frameset rows=&amp;quot;112,*&amp;quot; border=&amp;quot;0&amp;quot; style=&amp;quot;border:0px;&amp;quot;&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;and change the row height to 60:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;frameset rows=&amp;quot;60,*&amp;quot; border=&amp;quot;0&amp;quot; style=&amp;quot;border:0px;&amp;quot;&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;and you got something like this with everything working like nothing happened:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://rextang.net/photos/work/images/6375/original.aspx" target="_blank"&gt;&lt;img src="http://rextang.net/photos/work/images/6375/500x375.aspx" alt="" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;wondering if this modification works in Application Mode? &lt;/p&gt;  &lt;p&gt;the answer is YES, it will also work in Application Mode. since it used the same loader.aspx file.&lt;/p&gt;  &lt;p&gt;by the way, the source aspx of the top frame is located at [{crm web root}/_root/bar_Top.aspx], in case you want to see what’s it doing inside…&lt;/p&gt;  &lt;p&gt;and be caution, &lt;strong&gt;&lt;em&gt;&lt;font color="#ff0000"&gt;this is not a supported customization&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;!!&lt;/p&gt;  &lt;p&gt;FYI.&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:781fba4e-44ed-41a2-adb5-8537bcd5b204" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/microsoft" rel="tag"&gt;microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/dynamics" rel="tag"&gt;dynamics&lt;/a&gt;,&lt;a href="http://technorati.com/tags/crm" rel="tag"&gt;crm&lt;/a&gt;,&lt;a href="http://technorati.com/tags/customization" rel="tag"&gt;customization&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=6376" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://rextang.net/blogs/work/archive/tags/dynamics/default.aspx">dynamics</category><category domain="http://rextang.net/blogs/work/archive/tags/crm/default.aspx">crm</category></item><item><title>Auto-Indent HTML source in Notepad++ using TextFX Html Tidy</title><link>http://rextang.net/blogs/work/archive/2008/08/28/6372.aspx</link><pubDate>Wed, 27 Aug 2008 15:16:37 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:6372</guid><dc:creator>rextangtw</dc:creator><slash:comments>0</slash:comments><comments>http://rextang.net/blogs/work/archive/2008/08/28/6372.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Am started investigating CRM 4.0’s aspx source for custimization. had the requirements of re-indenting aspx/html code so that I can see the table layout structure and others. here is the quick note about using TextFX Html Tidy in &lt;a href="http://notepad-plus.sourceforge.net/uk/site.htm" target="_blank"&gt;Notepad++&lt;/a&gt; to do the html auto-indention.&lt;/p&gt;  &lt;p&gt;First of all , &lt;a href="http://www.w3.org/People/Raggett/tidy/" target="_blank"&gt;HTML Tidy&lt;/a&gt; is a project of reformatting/transforming HTML source. and Notepad++ got TextFX plug-in and can &lt;a href="http://notepad-plus.wiki.sourceforge.net/HTML+Tidy" target="_blank"&gt;work with HTML Tidy&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;by referring to the &lt;a href="http://www.w3.org/People/Raggett/tidy/" target="_blank"&gt;Notepad++ Tidy page&lt;/a&gt;, it stated:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;As installed, HTML Tidy will not do much - it requires a configuration file to activate it. For Notepad++, create a text file in the folder &lt;font color="#ff0000"&gt;&lt;strong&gt;plugins\NPPTextFX&lt;/strong&gt;&lt;/font&gt; under your Notepad++ installation folder, and name it &lt;font color="#ff0000"&gt;&lt;strong&gt;tidycfg.ini&lt;/strong&gt;&lt;/font&gt;. After creating the file, select TextFX -&amp;gt; TextFX HTML Tidy -&amp;gt; Refresh Menu from TidyCFG.INI from the menu to load the file in Notepad++. Notepad++ will then show a list of possible actions in the TextFX -&amp;gt; TextFX HTML Tidy menu.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;so I just followed the instructions above to make the tidycfg.ini file and put those basic formatting rules on that page for testing. after that, just create a simple reformatting rule like this one:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;[Re-Indent HTML Source]      &lt;br /&gt;indent: yes       &lt;br /&gt;indent-spaces: 2&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;and it’s done. by running this rule under Notepad++, the html source will be re-indented to tag-view-friendly indention for me to check the layout and debug.&lt;/p&gt;  &lt;p&gt;pretty nice editor, Notepadd++, and pretty nice plug-in, the TextFX HTML Tidy!!&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:b33e3970-e720-4a0c-96c4-4d8428937a65" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/notepad%2b%2b" rel="tag"&gt;notepad++&lt;/a&gt;,&lt;a href="http://technorati.com/tags/textfx" rel="tag"&gt;textfx&lt;/a&gt;,&lt;a href="http://technorati.com/tags/html" rel="tag"&gt;html&lt;/a&gt;,&lt;a href="http://technorati.com/tags/tidy" rel="tag"&gt;tidy&lt;/a&gt;,&lt;a href="http://technorati.com/tags/editor" rel="tag"&gt;editor&lt;/a&gt;,&lt;a href="http://technorati.com/tags/indent" rel="tag"&gt;indent&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=6372" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/Useful+Tools/default.aspx">Useful Tools</category><category domain="http://rextang.net/blogs/work/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://rextang.net/blogs/work/archive/tags/dynamics/default.aspx">dynamics</category><category domain="http://rextang.net/blogs/work/archive/tags/crm/default.aspx">crm</category></item><item><title>Change default View Source editor of IE</title><link>http://rextang.net/blogs/work/archive/2008/08/27/6371.aspx</link><pubDate>Wed, 27 Aug 2008 13:33:52 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:6371</guid><dc:creator>rextangtw</dc:creator><slash:comments>0</slash:comments><comments>http://rextang.net/blogs/work/archive/2008/08/27/6371.aspx#comments</comments><description>&lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;started playing around CRM 4.0 customization. need to view the page html source often and need a good xml / html tag editor!&lt;/p&gt;  &lt;p&gt;I choosed &lt;a href="http://notepad-plus.sourceforge.net/uk/site.htm" target="_blank"&gt;Notepad++&lt;/a&gt; for my tag editor, found it pretty useful. and now got the question about using it by default when I view the page source in IE.&lt;/p&gt;  &lt;p&gt;Found the information from &lt;a href="http://dotnet.org.za/thea/archive/2004/11/25/7933.aspx" target="_blank"&gt;Thea Burger’s blog&lt;/a&gt; and would like to note here for my further reference…&lt;/p&gt;  &lt;p&gt;the registry key for setting the default view source editor for IE is at:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;HKEY_LOCAL_MACHINE      &lt;br /&gt;|- Software       &lt;br /&gt;|-- Microsoft       &lt;br /&gt;|--- Internet Explorer       &lt;br /&gt;|---- View Source Editor       &lt;br /&gt;|----- Editor Name (Default) = C:\windows\notepad.exe&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt;    &lt;p&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;modify or create the key and make whatever editor you like here and you are done.&lt;/p&gt;  &lt;p&gt;also by reading the comments of the post, Notepad++ made a exe file called “nppIExplorerShell.exe” that do this for you without get your hand dirty with registry editing (you have to select “As a default html viewer” while in the setup of Notepad++ to get this exe file copied to the working directory, or it won’t be copied. tested in Notepad++ v5.0.3)…&lt;/p&gt;  &lt;p&gt;FYI.&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1b972141-8d09-4628-b33b-01cf7eb1682d" style="padding-right:0px;display:inline;padding-left:0px;float:none;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/ie" rel="tag"&gt;ie&lt;/a&gt;,&lt;a href="http://technorati.com/tags/editor" rel="tag"&gt;editor&lt;/a&gt;,&lt;a href="http://technorati.com/tags/text" rel="tag"&gt;text&lt;/a&gt;,&lt;a href="http://technorati.com/tags/notepad%2b%2b" rel="tag"&gt;notepad++&lt;/a&gt;,&lt;a href="http://technorati.com/tags/crm" rel="tag"&gt;crm&lt;/a&gt;,&lt;a href="http://technorati.com/tags/dynamics" rel="tag"&gt;dynamics&lt;/a&gt;,&lt;a href="http://technorati.com/tags/html" rel="tag"&gt;html&lt;/a&gt;,&lt;a href="http://technorati.com/tags/xml" rel="tag"&gt;xml&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=6371" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/Useful+Tools/default.aspx">Useful Tools</category><category domain="http://rextang.net/blogs/work/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://rextang.net/blogs/work/archive/tags/dynamics/default.aspx">dynamics</category><category domain="http://rextang.net/blogs/work/archive/tags/crm/default.aspx">crm</category></item><item><title>CommunityServer 2008 is available...</title><link>http://rextang.net/blogs/work/archive/2008/04/22/6212.aspx</link><pubDate>Tue, 22 Apr 2008 04:40:10 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:6212</guid><dc:creator>rextangtw</dc:creator><slash:comments>0</slash:comments><comments>http://rextang.net/blogs/work/archive/2008/04/22/6212.aspx#comments</comments><description>&lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt; &lt;p&gt;per &lt;a href="http://weblogs.asp.net/rhoward/archive/2008/04/15/community-server-2008-now-available.aspx" target="_blank"&gt;Rob Harward&amp;#39;s blog&lt;/a&gt; last week, &lt;a href="http://communityserver.com/" target="_blank"&gt;CommunityServer 2008&lt;/a&gt; is now available for download.&lt;/p&gt; &lt;p&gt;although &lt;a href="http://rextang.net" target="_blank"&gt;my personal blog site&lt;/a&gt; only used the blog features for 3 blogs, I&amp;#39;ll still consider upgrading to this version and try out the new features...&lt;/p&gt; &lt;p&gt;need to squeeze some of my weekends for this upgrade and re-customize my sites...&lt;/p&gt; &lt;p&gt; &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:333261aa-65c3-451c-b7a8-44eb964be639" style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/communityserver" rel="tag"&gt;communityserver&lt;/a&gt;,&lt;a href="http://technorati.com/tags/blog" rel="tag"&gt;blog&lt;/a&gt;,&lt;a href="http://technorati.com/tags/programming" rel="tag"&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=6212" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Blog+Framework+_2F00_+Tools/default.aspx">Blog Framework / Tools</category><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/Useful+Tools/default.aspx">Useful Tools</category><category domain="http://rextang.net/blogs/work/archive/tags/I.T.+News/default.aspx">I.T. News</category></item><item><title>.NET Framework Source Code now Available...</title><link>http://rextang.net/blogs/work/archive/2008/01/18/5871.aspx</link><pubDate>Fri, 18 Jan 2008 02:10:22 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:5871</guid><dc:creator>rextangtw</dc:creator><slash:comments>0</slash:comments><comments>http://rextang.net/blogs/work/archive/2008/01/18/5871.aspx#comments</comments><description>&lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt; &lt;p&gt;[via &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx" target="_blank"&gt;ScottGu&lt;/a&gt;]&lt;/p&gt; &lt;p&gt;Available source code for now:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;NET Base Class Libraries (including System, System.CodeDom, System.Collections, System.ComponentModel, System.Diagnostics, System.Drawing, System.Globalization, System.IO, System.Net, System.Reflection, System.Runtime, System.Security, System.Text, System.Threading, etc). &lt;/li&gt;&lt;/ul&gt; &lt;ul&gt; &lt;li&gt;ASP.NET (System.Web, System.Web.Extensions) &lt;/li&gt;&lt;/ul&gt; &lt;ul&gt; &lt;li&gt;Windows Forms (System.Windows.Forms) &lt;/li&gt;&lt;/ul&gt; &lt;ul&gt; &lt;li&gt;Windows Presentation Foundation (System.Windows) &lt;/li&gt;&lt;/ul&gt; &lt;ul&gt; &lt;li&gt;ADO.NET and XML (System.Data and System.Xml) &lt;/li&gt;&lt;/ul&gt; &lt;h5&gt;Enabling Reference Source Access in Visual Studio 2008&lt;/h5&gt; &lt;blockquote&gt; &lt;p&gt;Enabling .NET Framework source access within Visual Studio 2008 only takes a few minutes to setup. Shawn Burke has a &lt;a href="http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx"&gt;detailed blog post&lt;/a&gt; that covers the exact steps on how to enable this in more depth &lt;a href="http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx"&gt;here&lt;/a&gt;.  &lt;p&gt;If you run into problems or have questions setting it up, please post a question in the &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=2019&amp;amp;SiteID=1"&gt;Reference Source Forum&lt;/a&gt; on MSDN &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=2019&amp;amp;SiteID=1"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt; &lt;h5&gt;Reference License&lt;/h5&gt; &lt;blockquote&gt; &lt;p&gt;The .NET Framework source is being released under a read-only reference license. When we announced that we were releasing the source back in October, some people had concerns about the potential impact of their viewing the source. To help clarify and address these concerns, we made a small change to the license to specifically call out that the license does not apply to users developing software for a non-Windows platform that has “the same or substantially the same features or functionality” as the .NET Framework. If the software you are developing is for Windows platforms, you can look at the code, even if that software has &amp;quot;the same or substantially the same features or functionality&amp;quot; as the .NET Framework.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;FYI.  &lt;p&gt;&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8d9bbb9e-8e73-44f9-85c8-46fded0702be" style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/microsoft" rel="tag"&gt;microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/.net" rel="tag"&gt;.net&lt;/a&gt;,&lt;a href="http://technorati.com/tags/framework" rel="tag"&gt;framework&lt;/a&gt;,&lt;a href="http://technorati.com/tags/programming" rel="tag"&gt;programming&lt;/a&gt;,&lt;a href="http://technorati.com/tags/asp.net" rel="tag"&gt;asp.net&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=5871" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/I.T.+News/default.aspx">I.T. News</category></item><item><title>asp.net: checking session size in SQL Server ASPState DB...</title><link>http://rextang.net/blogs/work/archive/2008/01/13/5857.aspx</link><pubDate>Sat, 12 Jan 2008 21:43:49 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:5857</guid><dc:creator>rextangtw</dc:creator><slash:comments>0</slash:comments><comments>http://rextang.net/blogs/work/archive/2008/01/13/5857.aspx#comments</comments><description>&lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt; &lt;p&gt;by setting asp.net application to save session state into SQL Server database, not only can scale application out with multiple web servers, but also provided a way to investigate session usage.&lt;/p&gt; &lt;p&gt;Saving session state in SQL Server database will be slower than InProc session state, since it requires Serialization / DeSerialization of session data and there will be round trips between web server and database server, therefore, session size / usage in asp.net application becomes an important factor of optimizing and scaling out an application.&lt;/p&gt; &lt;p&gt;To create a session state database for using in asp.net application, refer to &lt;a href="http://msdn2.microsoft.com/en-us/library/ms229862(VS.80).aspx" target="_blank"&gt;aspnet_reqsql.exe usage&lt;/a&gt;, using the command&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;aspnet_reqsql.exe -ssadd -sstype p -E&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;using -E if you are authenticating using windows credential (trusted connection), or using -U and -P to input sql server login and password. the default session state database name is &amp;quot;ASPState&amp;quot;&lt;/p&gt; &lt;p&gt;Inside ASPState db, there are 2 tables: &amp;quot;ASPStateTempApplications&amp;quot; and &amp;quot;ASPStateTempSessions&amp;quot;. ASPStateTempApplications table have the mapping of self-made application-id and infomation of web virtual directory. the application-id is a decimal int value. &lt;/p&gt; &lt;p&gt;ASPStateTempSessions table is the place where the actualy session data is stored. the key field is SessionId, which is a 32 bytes string combined with asp.net session-id (the first 24 bytes) and application-id (the last 8 bytes). the application-id in SessionId field is represented in hex value, which is different than the id in ASPStateTempApplications table, which is in decimal value. thus the conversion become necessary if trying to mapping those 2 tables to create meaningful report in one query. &lt;/p&gt; &lt;p&gt;I just &lt;a href="http://rextang.net/blogs/work/archive/2008/01/13/5855.aspx" target="_blank"&gt;wrote a post&lt;/a&gt; with the function to convert HexString to VarBinary and to convert VarBinary to Int, so the conversion should be no problem if using that self-defined function. now here is the query for getting session size and mapping each session to its virtual directory:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;select &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SessionId, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; substring(SessionId,25,8) as AppIDHex, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; convert(int, dbo.HexStrToVarBinary(substring(SessionId,25,8))) as AppIDDec, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.AppName, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; datalength(SessionItemLong) as SessionSize &lt;br /&gt;from dbo.ASPStateTempSessions as a &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; left outer join dbo.ASPStateTempApplications as b on &lt;br /&gt;&amp;nbsp;&amp;nbsp; convert(int, dbo.HexStrToVarBinary(substring(a.SessionId,25,8))) = b.AppId &lt;/p&gt; &lt;p&gt;where datalength(SessionItemLong) &amp;gt; 0&lt;br /&gt;order by SessionSize desc&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Before running this query, be sure to first add the &amp;quot;HexStrToVarBinary&amp;quot; function to ASPState database, which stated in &lt;a href="http://rextang.net/blogs/work/archive/2008/01/13/5855.aspx" target="_blank"&gt;my last post&lt;/a&gt;.  &lt;p&gt;&lt;font color="#ff0000"&gt;[UPDATE 2008/01/13 07:50 Start]&lt;/font&gt; &lt;p&gt;since the AppId in ASPStateTempApplications might contain minus decimal values, the conversion from hex to decimal will have chances not match the decimal values of AppId.  &lt;p&gt;to solve this, not converting to decimal value for the mapping, but using hex value for matching 2 tables: &lt;blockquote&gt; &lt;p&gt;SELECT &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.SessionId, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUBSTRING(a.SessionId, 25, 8) AS AppIDHex, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.AppId AS AppIDDec, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.AppName, &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATALENGTH(a.SessionItemLong) AS SessionSize&lt;br /&gt;FROM&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbo.ASPStateTempSessions AS a &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LEFT OUTER JOIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbo.ASPStateTempApplications AS b &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#ff0000"&gt;&lt;strong&gt;SUBSTRING(a.SessionId, 25, 8) = &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUBSTRING(sys.fn_varbintohexstr(CONVERT(VarBinary,b.AppId)), 3, 8)&lt;br /&gt;&lt;/strong&gt;&lt;/font&gt;WHERE&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (DATALENGTH(a.SessionItemLong) &amp;gt; 0)&lt;br /&gt;ORDER BY SessionSize DESC&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;by using this query there is no necessary to use self-made function to convert hex string to varbinary value, but have to use the built-in sql function &amp;quot;sys.fn_varbintohexstr&amp;quot;. this query guarantees the match of those 2 tables. &lt;p&gt;&lt;font color="#ff0000"&gt;[UPDATE 2008/01/13 07:50 End]&lt;/font&gt; &lt;p&gt;the query result is like the following:  &lt;p&gt;&lt;a href="http://rextang.net/photos/work/images/5856/original.aspx" target="_blank"&gt;&lt;img src="http://rextang.net/photos/work/images/5856/500x375.aspx" alt="" /&gt;&lt;/a&gt;  &lt;p&gt;now you can see each session state with its size and where the virtual directory the session is belong to, to get an idea of where the problem is at...  &lt;p&gt;by seeing the above result, I got a session with size around 18mb, which is not a good idea... imaging each page request of this session, the 18mb data transfer between sql server and web server, and serialize / deserialize of a 18mb data... well, I&amp;#39;ll write further posts if I got it solved...&amp;nbsp; &lt;p&gt;&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:0e9b980b-efc3-4c34-b8eb-7f25b36f1757" style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/microsoft" rel="tag"&gt;microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/asp.net" rel="tag"&gt;asp.net&lt;/a&gt;,&lt;a href="http://technorati.com/tags/session" rel="tag"&gt;session&lt;/a&gt;,&lt;a href="http://technorati.com/tags/state" rel="tag"&gt;state&lt;/a&gt;,&lt;a href="http://technorati.com/tags/sqlserver" rel="tag"&gt;sqlserver&lt;/a&gt;,&lt;a href="http://technorati.com/tags/programming" rel="tag"&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=5857" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://rextang.net/blogs/work/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://rextang.net/blogs/work/archive/tags/Database/default.aspx">Database</category></item><item><title>asp.net: __EVENTVALIDATION is related to page virtual path...</title><link>http://rextang.net/blogs/work/archive/2007/12/26/5832.aspx</link><pubDate>Wed, 26 Dec 2007 11:43:46 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:5832</guid><dc:creator>rextangtw</dc:creator><slash:comments>0</slash:comments><comments>http://rextang.net/blogs/work/archive/2007/12/26/5832.aspx#comments</comments><description>&lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt; &lt;p&gt;--- #Summary: ---&lt;/p&gt; &lt;p&gt;When using performance test tools to record asp.net pages for test, and later those pages were moved to different path at the same server, not only have to change the recorded test scripts to the correct paths, but also need to capture and replace the new path&amp;#39;s &amp;quot;__EVENTVALIDATION&amp;quot; field if the pages were requested with HTTP POST.&amp;nbsp; &lt;/p&gt; &lt;p&gt;--- #Introduction: ---&lt;/p&gt; &lt;p&gt;In my project I am in charging of doing performance test using &lt;a href="http://www.empirix.com/products-services/web_applications.asp" target="_blank"&gt;Empirix&amp;#39;s E-Test Suite&lt;/a&gt;. E-Test scripts was recorded and customized for each testing asp.net page and the performance test was going well until something happened the other days.&lt;/p&gt; &lt;p&gt;Due to project requirement some of the asp.net pages were moved to different paths under the same server. although the pages were not modified at all, and I did modified the url path of pages in E-Test scripts, those asp.net pages that E-Test recorded with previous paths were still not working anymore and throwing exceptions as follows:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;quot;The viewstate is invalid for this page and might be corrupted&amp;quot;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;and the error target was at form post field &amp;quot;__EVENTVALIDATION&amp;quot;.&lt;/p&gt; &lt;p&gt;--- #Solution: ---&lt;/p&gt; &lt;p&gt;The &amp;quot;__EVENTVALIDATION&amp;quot; field was encoded / encrypted using a modifier that&amp;#39;s calculated and related to page&amp;#39;s virtual path. thus when a page was changed to different path, the modifier will also changes and if submit the page using original &amp;quot;__EVENTVALIDATION&amp;quot; field that&amp;#39;s generated using previous page, the event validation check will fail and throw exceptions like above.&lt;/p&gt; &lt;p&gt;To solve this, when pages changed paths, not only have to modify the test scripts to the correct paths, but also need to get the new paths&amp;#39; &amp;quot;__EVENTVALIDATION&amp;quot; field to replace the scripts&amp;#39; ones. &lt;/p&gt; &lt;p&gt;--- #More Information: ---&lt;/p&gt; &lt;p&gt;By looking into System.Web.dll, if Event Validation was set enabled, Page object will call ClientScriptManager object to save the event validation content to &amp;quot;__EVENTVALIDATION&amp;quot; hidden field. that&amp;#39;s where the event validation content was generated.&lt;/p&gt; &lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt; &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#008000;"&gt;// under System.Web.UI.Page class...&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;internal&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; EndFormRender(HtmlTextWriter writer, &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; formUniqueID)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     &lt;span style="color:#008000;"&gt;// ...&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.EnableEventValidation)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.ClientScript.&lt;font color="#ff0000"&gt;&lt;strong&gt;SaveEventValidationField();&lt;/strong&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;     &lt;span style="color:#008000;"&gt;// ...&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#008000;"&gt;// System.Web.UI.ClientScriptManager.SaveEventValidationField() code.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;internal&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; SaveEventValidationField()&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; eventValidationFieldValue = &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.&lt;strong&gt;&lt;font color="#ff0000"&gt;GetEventValidationFieldValue();&lt;/font&gt;&lt;/strong&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (!&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.IsNullOrEmpty(eventValidationFieldValue))&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.RegisterHiddenField(&lt;span style="color:#006080;"&gt;&amp;quot;__EVENTVALIDATION&amp;quot;&lt;/span&gt;, eventValidationFieldValue);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#008000;"&gt;// System.Web.UI.ClientScriptManager.GetEventValidationFieldValue() code&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;internal&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; GetEventValidationFieldValue()&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; ((&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._validEventReferences != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;) &amp;amp;&amp;amp; (&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._validEventReferences.Count != 0))&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._owner.&lt;strong&gt;&lt;font color="#ff0000"&gt;CreateStateFormatter().Serialize&lt;/font&gt;&lt;/strong&gt;(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._validEventReferences);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Empty;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;CreateStateFormatter() will return a System.Web.UI.ObjectStateFormatter object to serialize event validation content. &lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#008000;"&gt;// System.Web.UI.ObjectStateFormatter.Serialize() code.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; Serialize(&lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; stateGraph)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; str = &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     MemoryStream memoryStream = GetMemoryStream();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;try&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.Serialize(memoryStream, stateGraph);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;         memoryStream.SetLength(memoryStream.Position);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;[] buf = memoryStream.GetBuffer();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; length = (&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt;) memoryStream.Length;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; ((&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._page != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;) &amp;amp;&amp;amp; &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._page.RequiresViewStateEncryptionInternal)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt;             buf = MachineKeySection.&lt;strong&gt;&lt;font color="#ff0000"&gt;EncryptOrDecryptData&lt;/font&gt;&lt;/strong&gt;(&lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;, buf, &lt;strong&gt;&lt;font color="#ff0000"&gt;&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.GetMacKeyModifier()&lt;/font&gt;&lt;/strong&gt;, 0, length);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt;             length = buf.Length;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  16:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  17:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (((&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._page != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;) &amp;amp;&amp;amp; &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._page.EnableViewStateMac) || (&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._macKeyBytes != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;))&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  18:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  19:&lt;/span&gt;             buf = MachineKeySection.&lt;strong&gt;&lt;font color="#ff0000"&gt;GetEncodedData&lt;/font&gt;&lt;/strong&gt;(buf, &lt;strong&gt;&lt;font color="#ff0000"&gt;&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.GetMacKeyModifier()&lt;/font&gt;&lt;/strong&gt;, 0, &lt;span style="color:#0000ff;"&gt;ref&lt;/span&gt; length);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  20:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  21:&lt;/span&gt;         str = Convert.ToBase64String(buf, 0, length);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  22:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  23:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;finally&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  24:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  25:&lt;/span&gt;         ReleaseMemoryStream(memoryStream);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  26:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  27:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; str;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  28:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Both EncryptOrDecryptData() and GetEncodedDate() use GetMacKeyModifier() to form the crypto modifier.&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#008000;"&gt;// System.Web.UI.ObjectStateFormatter.GetMacKeyModifier()&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;[] GetMacKeyModifier()&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._macKeyBytes == &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._page == &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;         &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;         &lt;span style="color:#008000;"&gt;//Rex: the num variable used page.TemplateSourceDirectory to get hashcode.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; num = StringComparer.InvariantCultureIgnoreCase.&lt;strong&gt;&lt;font color="#ff0000"&gt;GetHashCode(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._page.TemplateSourceDirectory)&lt;/font&gt;&lt;/strong&gt; + StringComparer.InvariantCultureIgnoreCase.GetHashCode(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._page.GetType().Name);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; viewStateUserKey = &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._page.ViewStateUserKey;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (viewStateUserKey != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  16:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; byteCount = Encoding.Unicode.GetByteCount(viewStateUserKey);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  17:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._macKeyBytes = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;[byteCount + 4];&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  18:&lt;/span&gt;             Encoding.Unicode.GetBytes(viewStateUserKey, 0, viewStateUserKey.Length, &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._macKeyBytes, 4);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  19:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  20:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  21:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  22:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._macKeyBytes = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;[4];&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  23:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  24:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  25:&lt;/span&gt;         &lt;span style="color:#008000;"&gt;// Rex: use num variable to form the modifier...&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  26:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._macKeyBytes[0] = (&lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;) num;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  27:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._macKeyBytes[1] = (&lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;) (num &amp;gt;&amp;gt; 8);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  28:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._macKeyBytes[2] = (&lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;) (num &amp;gt;&amp;gt; 0x10);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  29:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._macKeyBytes[3] = (&lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;) (num &amp;gt;&amp;gt; 0x18);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  30:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  31:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;._macKeyBytes;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  32:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;_Page.TemplateSourceDirectory() return page&amp;#39;s virtual directory path.&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#008000;"&gt;// System.Web.UI.Control.TemplateSourceDirectory property&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;virtual&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; TemplateSourceDirectory&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     get&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.TemplateControlVirtualDirectory == &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;.Empty;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;         &lt;strong&gt;&lt;font color="#ff0000"&gt;&lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.TemplateControlVirtualDirectory.VirtualPathStringNoTrailingSlash;&lt;/font&gt;&lt;/strong&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;finally, EncryptOrDecryptData() form the string of &amp;quot;__EVENTVALIDATION&amp;quot;, also append the modifier in the end of the string. if it&amp;#39;s on decryption mode, it verifies the modifier to see if postback-ed modifier matched currently calculated one (which is related to page url path), if page url changed, the modifier will also change, and then match operation will fail and throw exception.&lt;/p&gt;
&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;background-color:#f4f4f4;"&gt;
&lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#008000;"&gt;// System.Web.Configuration.MachineKeySection.EncryptOrDecryptData() code&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;internal&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;static&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;[] EncryptOrDecryptData(&lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; fEncrypt, &lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;[] buf, &lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;[] modifier, &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; start, &lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; length, &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; useValidationSymAlgo)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     EnsureConfig();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     MemoryStream stream = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; MemoryStream();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;     ICryptoTransform cryptoTransform = GetCryptoTransform(fEncrypt, useValidationSymAlgo);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;     CryptoStream stream2 = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; CryptoStream(stream, cryptoTransform, CryptoStreamMode.Write);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;     stream2.Write(buf, start, length);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (fEncrypt &amp;amp;&amp;amp; (modifier != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;))&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;         &lt;span style="color:#008000;"&gt;// Rex: Append the modifier to the end of content&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt;         stream2.Write(modifier, 0, modifier.Length);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt;     stream2.FlushFinalBlock();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;[] src = stream.ToArray();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  16:&lt;/span&gt;     stream2.Close();&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  17:&lt;/span&gt;     ReturnCryptoTransform(fEncrypt, cryptoTransform, useValidationSymAlgo);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  18:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; ((fEncrypt || (modifier == &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)) || (modifier.Length &amp;lt;= 0))&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  19:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  20:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; src;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  21:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  22:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;for&lt;/span&gt; (&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; modifier.Length; i++)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  23:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  24:&lt;/span&gt;         &lt;span style="color:#008000;"&gt;// Rex: compare the modifier to see if it matches...&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  25:&lt;/span&gt;         &lt;span style="color:#008000;"&gt;// Rex: modifier is related to page url path.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  26:&lt;/span&gt;         &lt;span style="color:#008000;"&gt;// Rex: if url changed, the match will fail the exception will be thrown...&lt;/span&gt;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  27:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (src[(src.Length - modifier.Length) + i] != modifier&lt;img src="http://rextang.net/emoticons/emotion-55.gif" alt="Idea" /&gt;)&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  28:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  29:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; HttpException(SR.GetString(&lt;span style="color:#006080;"&gt;&amp;quot;Unable_to_validate_data&amp;quot;&lt;/span&gt;));&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  30:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  31:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  32:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;[] dst = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;byte&lt;/span&gt;[src.Length - modifier.Length];&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  33:&lt;/span&gt;     Buffer.BlockCopy(src, 0, dst, 0, dst.Length);&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  34:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; dst;&lt;/pre&gt;&lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  35:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This concluded that &amp;quot;__EVENTVALIDATION&amp;quot; field is related to page url path.&lt;/p&gt;
&lt;p&gt;--- #End ---&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5259d8ee-e2f2-4ddd-a297-d7f03efc860b" style="padding-right:0px;display:inline;padding-left:0px;padding-bottom:0px;margin:0px;padding-top:0px;"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/microsoft" rel="tag"&gt;microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/asp.net" rel="tag"&gt;asp.net&lt;/a&gt;,&lt;a href="http://technorati.com/tags/viewstate" rel="tag"&gt;viewstate&lt;/a&gt;,&lt;a href="http://technorati.com/tags/event" rel="tag"&gt;event&lt;/a&gt;,&lt;a href="http://technorati.com/tags/validation" rel="tag"&gt;validation&lt;/a&gt;,&lt;a href="http://technorati.com/tags/programming" rel="tag"&gt;programming&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=5832" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Updated FullText Search Provider for CommunityServer 2007.1...</title><link>http://rextang.net/blogs/work/archive/2007/10/14/5696.aspx</link><pubDate>Sat, 13 Oct 2007 23:16:52 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:5696</guid><dc:creator>rextangtw</dc:creator><slash:comments>0</slash:comments><comments>http://rextang.net/blogs/work/archive/2007/10/14/5696.aspx#comments</comments><description>&lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Since I just &lt;a href="http://rextang.net/blogs/work/archive/2007/10/14/5694.aspx" target="_blank"&gt;upgraded my personal website to CommunityServer 2007.1&lt;/a&gt; , I also make a update for my &lt;a href="http://rextang.net/blogs/work/archive/2007/05/27/4998.aspx" target="_blank"&gt;FullText Search Provider&lt;/a&gt; to be able to use on 2007.1. &lt;/p&gt; &lt;p&gt;I updated the source by referring the 2007.1 SearchBarrel source, and had been tested on my personal website without problems. The modification places were not much, and the site which upgraded to 2007.1 needs to apply this new version of FullText search provider.&lt;/p&gt; &lt;p&gt;&lt;a href="http://archive.rextang.com/blogfiles/work/CS2007.1-FullTextSearchPackage-20071014.zip" target="_blank"&gt;Download the source and binary here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;FYI.&lt;/p&gt; &lt;p&gt;Technorati tags: &lt;a href="http://technorati.com/tags/asp.net"&gt;asp.net&lt;/a&gt;, &lt;a href="http://technorati.com/tags/programming"&gt;programming&lt;/a&gt;, &lt;a href="http://technorati.com/tags/communityserver"&gt;communityserver&lt;/a&gt;, &lt;a href="http://technorati.com/tags/search"&gt;search&lt;/a&gt;, &lt;a href="http://technorati.com/tags/provider"&gt;provider&lt;/a&gt;, &lt;a href="http://technorati.com/tags/blog"&gt;blog&lt;/a&gt;, &lt;a href="http://technorati.com/tags/platform"&gt;platform&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=5696" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Blog+Framework+_2F00_+Tools/default.aspx">Blog Framework / Tools</category><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Personal Blog upgraded to CommunityServer 2007.1...</title><link>http://rextang.net/blogs/work/archive/2007/10/14/5694.aspx</link><pubDate>Sat, 13 Oct 2007 22:54:18 GMT</pubDate><guid isPermaLink="false">c4c3a05f-02e4-4db4-b761-d853f78d3399:5694</guid><dc:creator>rextangtw</dc:creator><slash:comments>1</slash:comments><comments>http://rextang.net/blogs/work/archive/2007/10/14/5694.aspx#comments</comments><description>&lt;p&gt;crosspost from &lt;a href="http://blogs.msdn.com/rextang"&gt;http://blogs.msdn.com/rextang&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://telligent.com/"&gt;Telligent Systems&lt;/a&gt; released &lt;a href="http://communityserver.org/blogs/announcements/archive/2007/09/18/community-server-2007-1.aspx" target="_blank"&gt;CommunityServer 2007.1&lt;/a&gt; at 2007/09/18, and I just upgraded my &lt;a href="http://rextang.net/"&gt;personal blog site&lt;/a&gt; to this version (Build 3.1.20917.1142)&amp;nbsp;from my &lt;a href="http://rextang.net/blogs/work/archive/2007/06/21/5251.aspx"&gt;previous sp2 upgrade&lt;/a&gt;.  &lt;p&gt;Still using SDK upgrade and the compilation had no problems. Need to be awared that the source / web folder modified the communityserver.config and SiteUrl.config files, so be sure you do a Diff before you copy new files to overwrite original source if you had customized some of those settings. also be awared of those master theme file overwrites if you also modified your own theme layouts.  &lt;p&gt;FYI.  &lt;p&gt;Technorati tags: &lt;a href="http://technorati.com/tags/blog"&gt;blog&lt;/a&gt;, &lt;a href="http://technorati.com/tags/communityserver"&gt;communityserver&lt;/a&gt;, &lt;a href="http://technorati.com/tags/asp.net"&gt;asp.net&lt;/a&gt;, &lt;a href="http://technorati.com/tags/programming"&gt;programming&lt;/a&gt;, &lt;a href="http://technorati.com/tags/patch"&gt;patch&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://rextang.net/aggbug.aspx?PostID=5694" width="1" height="1"&gt;</description><category domain="http://rextang.net/blogs/work/archive/tags/Blog+Framework+_2F00_+Tools/default.aspx">Blog Framework / Tools</category><category domain="http://rextang.net/blogs/work/archive/tags/Programming/default.aspx">Programming</category><category domain="http://rextang.net/blogs/work/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item></channel></rss>