Particular ASP.NET page losing one (and only one?) session variable

hasan0011

New Member
I maintain a small financial site. Part of this site allows certain users to perform a bank account reconciliation, clearing lines that have been entered that show up on bank statements. This particular page has been causing me a few headaches, as, seemingly at random, when a user submits the reconciled data or even just changes the account and date they are working with, the site will lose the ClientId they are working with. This is, at best, mildly annoying; at worst, a lot of time is wasted, as all the lines they have just checked off have to be rechecked. ClientId is stored in Session, so my first thought is that the Session is being lost or the Application is being recycled. However, only the ClientId Session variable (which is stored as "ActiveClient") is lost; other things like PortalId remain in place (and this is actually used to recover from what would otherwise be a serious error on the site), so that's not the issue. Then I thought that because the page submitted so much data on postback (I had to raise \[code\]MaxHttpCollectionKeys\[/code\] twice for this page, it's now at 5000, though I recently changed how data is passed to cut the number of keys in half). However, this isn't the issue, either, because the error reports I'm getting also include submissions with only a few dozen keys or just a handful when they're changing the date/account being worked with.It happens at different times, it doesn't happen every time (as a percentage of page submissions I'd say it's about 5-10%), and the only thing that seems even to be a constant across all errors is that they're from FireFox and Chrome, not Internet Explorer. However, our office uses both of those predominantly; IE is only used when staff encounters a site that must use it. I've asked one of my co-workers to try switching to IE, but I'm still trying to figure out other leads in the meantime.The page is set up with two ListViews, one for Credits and one for Debits. They display one line for each transaction detail line in the financial system, which lists brief information about the transaction and gives the user the option to mark it as cleared (or, if recalling a previous reconciled statement, mark it as uncleared).\[code\]<ItemTemplate> <tr class='<%# UseFutureDateClass(Eval("TrxDate")) %> <%# Container.DisplayIndex % 2 == 1 ? "alt" : "" %>'> <td> <asp:CheckBox ID="ClearLine" runat="server" Checked='<%# IsCleared(Eval("DateCleared")) %>' /> <asp:HiddenField ID="IdentSet" runat="server" Value='http://stackoverflow.com/questions/14446739/<%# Eval("NRecord") + "," + Eval("LineNo") + "," + IsCleared(Eval("DateCleared")) %>' /> </td> <td><asp:Label ID="TrxDateLabel" runat="server" Text='<%# Eval("TrxDate","{0:MM/dd/yyyy}") %>' /></td> <td><asp:Label ID="HeaderReference" runat="server" Text='<%# Eval("HeaderReference") %>' /></td> <td><asp:Label ID="VendorInfoLabel" runat="server" Text='<%# Eval("VendorInfo.VendorName") %>' /></td> <td><asp:Label ID="Label2" runat="server" Text='<%# Eval("Description") %>' /></td> <td class="money"> <asp:Label ID="Amount" runat="server" Text='<%# FormatInvertMoney(Eval("Amount")) %>' /> </td> </tr></ItemTemplate>\[/code\]That first \[code\]<td>\[/code\] contains the information POSTed on form submit for each line. Once submitted, the page will parse out the IdentSet and take action only if the line was previously cleared and is now not, or vice versa. From there it will update the financial files to mark the line as cleared or uncleared; if all updates are successfully, it marks the account as having been reconciled on the given date for the period relevant for the given date. I can post more of the code if someone believes it will be helpful; however, as I said earlier, this issue also happens when users just change the account and date, so I don't believe the issue is in the code itself. For reference, here's the code for the ActiveClient property, maintained in a static class called "Working":\[code\]public static String ActiveClient { get { String s = (String)HttpContext.Current.Session["ActiveClient"]; return s ?? String.Empty; } set { HttpContext.Current.Session["ActiveClient"] = value; }}\[/code\]tl;dr: One, and only one, page will sometimes lose one, and (apparently) only one, session variable on submission, and I can't figure out why or how to stop it.
 
Back
Top