Tuesday 12 October 2010

fix for The state information is invalid for this page and might be corrupted Error

This error suggests that  the Viewstate information between postback are not same after first postback so when you click on a page's any server control , it will give this error.
Problem :You might have embedded a page which contains "runat= "server"  within a Masterpage.
For example f you have a placed jquery tabs in master page and jquery tabs pointing to an aspx page with
  attribute it will give this error.
Workaround:
Just remove "runat=server" from
tag in calling page .It will fix the error.











Friday 8 October 2010

Fix for URL Rewriting With Intelligencia dll and IIS 5.1 Problem


If  a rewritten URL contains GUID( where Guid is encrypted in this example) and extra under  Intelligencia rewriter  and  IS 5.1 or IIS 6 ,  Request.QueryString["guid"]   will always read guid+ extra querystring.
For Example we have a following  rewritten URL.


Though URL have been  precisely configured  in web.config as
<rewrite url="/mysite/Preview/(.+)" to="/mysite/Preview.aspx? guid =$1">rewrite>
However, Request.QueryString["guid”] will always read this URL as


To fix this problem so that Request.QueryString["guid"] gets only Guid part of the URL, place .aspx extension with URL in web.config.

<rewrite url="/mysite/Preview/(.+).aspx" to="/mysite/Preview.aspx? guid =$1">rewrite>


And in code,  place.aspx extension with URL.


 this will generate URL as

and now Request.QueryString["guid”] will read only guid







Sunday 18 July 2010

Books for MONO Cross platform development using C#

I just came across this book and found it interesting.The book is about cross platform development using open source MONO and C#.

# Practical Mono

Practical Mono

# Quick-> Concise->Practical Mono

Mono sams

Applications can also be developed for iphone.

Wednesday 14 April 2010

ASP.NET Forms Authentication:Padding is Invalid and can not be removed Error.

I was getting this error using

FormsAuthenticationTicket ticket =

FormsAuthentication.Decrypt(authCookie.Value);

.I was trying Forms authentication to pass encrypted ticket between two web applications.I left out section with following configurations:

<machineKey

validationKey="AutoGenerate,IsolateApps"

decryptionKey="AutoGenerate,IsolateApps"

validation="AES"

decryption="Auto" />

This configuration means to create different key for each web applications thus it failed as

encrypted key was not same in two web applications.

so how to get same key for forms authentication. I resolved this issue by setting static values in section in both web.config files.

<machineKey validationKey='B5D752F96C1196D2A98014A3EF96F35192183FA47D467ACF0969F3687EC3C6BA3A959CD85BD3C282F2390B220ACD742568A8BC36BDBFBF9306ED807E6B090D56' decryptionKey='4BE38697FCD33A2C61D8FC93754FA668CEE4B5467B6B81F6' validation='SHA1'/>

Validation and decryption were generated using online machinekey generator tool.