4show: Hi, I have done what u said by adding the code snippet at the page load and when i run it i get this error; the specified dispay mode is currently disabled on this page.make sure personalisation is enabled for the current user.
Be sure to set Authentication mode in your web config like:
<authentication mode="Windows" />
<authorization>
<allow users="*" />
<deny users="?" />
</authorization>
And set authorization scope for all users in your web.config file like:
<webParts>
<personalization defaultProvider="SqlPersonalizationProvider">
<providers>
<add name="SqlPersonalizationProvider" type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider" connectionStringName="AspNetDBConnectionString" applicationName="MSWebParts"/>
</providers>
<authorization>
<allow users="*" verbs="enterSharedScope"/>
<allow users="*" verbs="modifyState"/>
</authorization>
</personalization>
</webParts>
Please take a look at this post:Implementing ASP.NET WebParts with Different Authentication modes
Regards, Vinz
SDE |Microsoft MVP - ASP/ASP.NET
~Currently looking for an overseas job opportunity~