private void AttachLookupsToBoundFields()
{
foreach (DataControlField dcf in this.Group_Transaction.DataControlFieldCollection)
AxBoundField boundField = dcf as AxBoundField;
if (boundField != null)
switch (boundField.DataField)
case "ExchangeCode":
boundField.LookupStyle = LookupStyle.PreLoad;
boundField.LookupCacheScope = CacheScope.Global;
break;
case "PayMethod":
boundField.Lookup += new EventHandler<AxLookupEventArgs>(PayMethod_Lookup);
boundField.LookupCacheScope = CacheScope.DataBindingContainer; // since CostType is not changing on this page, we can cache it for the form
}
For example
// Check the state cache
IAxStateCache stateCache = AxStateCacheFactory.CreateStateCache(this.Page.Session);
if (stateCache != null)
object cachedState = stateCache.LoadState(this.GetExpenseTransToolbarMenuCacheKey());
if (cachedState != null)
// Got it from the cache - deserialize it
this.expenseTransToolbarMenu = WebMenuItemMetadataHierarchicalContainer.Deserialize((byte[])cachedState);
else
// Not found in the cache - create it
this.expenseTransToolbarMenu = this.GetExpenseTransToolbarMenu();
// Save it in the cache
stateCache.SaveState(this.GetExpenseTransToolbarMenuCacheKey(), this.expenseTransToolbarMenu.Serialize());
<Microsoft.Dynamics>
<AppFabricCaching Enable=”true” NamedCache=”FooCache” />
</ Microsoft.Dynamics>
<Session Timeout="15" MaxSessions=”300”/>
</Microsoft.Dynamics>
Follow the UX guidelines provided in http://msdn.microsoft.com/en-us/library/gg853304.aspx