Contents tagged with .NET
-
Calling a C# Generic Method using Reflection in .NET Core
In this post, we will explore a way to call a C# generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime.
-
Encrypt and Decrypt Text Values in .NET
In this article, we will explore how to encrypt/decrypt text using .NET and MD5 crypto provider. These methods can be used to secure critical values that are used by our ASP.NET web application.
-
The Style of the SP DateTimeControl is Corrupted
I'm using a SharePoint DateTimeControl on a custom SharePoint page, while implementing theomplete behavior of the page I found that the DateTimeControl is not rendered properly on the page, the picker is opening but with no styles. Note that the control is working properly on the default SharePoint pages.
-
Large ViewState & ViewState chunking (maxPageStateFieldLength)
The ViewState Chunking mechanism allow you to split the ViewState content into several chunks/hidden fields. The reason behind using this feature is that some proxies and firewalls will deny access to the aspx page that contains a huge ViewState size by enabling the chunking mechanism that will allow you to bypass this policy.
You can enable ViewState chunking by setting the MaxPageStateFieldLength property the web.config of your asp.net application, this property should be added to the "pages" section in the web.config and it will specify the maximum size of the ViewState in bytes.
If the ViewState size is larger than the value of the MaxPageStateFieldLength than it will be splitted automatically into several hidden fields.
Set the property in the web.config as per the following:
<pages maxPageStateFieldLength="5">
ViewState Example:
Note that you should reconsider the way you are using the ViewState (ViewState optimization, maybe disabling it in some cases) when it has large size.
Reference:
http://msdn.microsoft.com/en-us/library/ms178577%28v=vs.85%29.aspx -
SharePoint Navigation - Setting the Audience Property of an SPNavigationNode
In this tip/trick i will demonstrate a way of setting by code the target audience of an SP navigation node.
You might say setting this property in SharePoint UI is quite simple, but if you want to set it by code you will not find any straight forward property or method out of the box in SharePoint Object Model that does the job.