Why are my Session variables lost frequently when using InProc mode?

This can be due to application recycle. See PRB: Session variables are lost intermittently in ASP.NET applications In v1, there is also a bug that will cause worker process to restart. It’s fixed in SP2 and v1.1. See FIX: ASP.NET Worker Process (Aspnet_wp.exe) Is Recycled Unexpectedly.

How to apply css style to each item of the dropdownlist or listbox control

The dropDownList has a bug which prevent us from assigning the style property to each item in the DropDownList. This bug confirmed by Microsoft in Microsoft Knowledge Base Article – 309338 For the workaround use a HTML dropdownlist with runat=server tag <SELECT id=’DropDownList1′ runat=’server’ > </SELECT> Use namespace System.Reflection VB.NET If Not Page.IsPostBack Then Dim col As FieldInfo For Each col In GetType(KnownColor).GetFields If col.FieldType Is GetType(Drawing.KnownColor) Then DropDownList1.Items.Add(New ListItem(col.Name, col.Name)) End If Next End If Dim i As Integer For i = 0 To DropDownList1.Items.Count – 1 DropDownList1.Items(i).Attributes.Add(‘style’, ‘background-color:’ + DropDownList1.Items(i).Text) Next C# if (!IsPostBack) { foreach(FieldInfo col in typeof(KnownColor).GetFields() ) { if (col.FieldType == typeof(KnownColor) ) { DropDownList1.Items.Add(new ListItem(col.Name ,col.Name)); } } } for (int i= 0 ;i < DropDownList1.Items.Count;i++) { DropDownList1.Items[i].Attributes.Add(‘style’, ‘background-color:’ + DropDownList1.Items[i].Text); }

Why does FormsAuthentication.Decrypt crashes when moving to another Server

The reason why the encrypted data couldn’t be decrypted on another machine is because the validation key in the original machine’s machine.config is set to AutoGenerate. This means that the generated keys are unique to each machine. A better solution will be to specify the validation key, so you can decrypt it across any machine with the same validation key. For more details on solution refer following article : Microsoft Knowledge Base Article – 313091 Microsoft Knowledge Base Article – 312906