I'm trying to set some Session variables that will be used in binding some RadGrids on button click. I have ajaxified the button to update the panel that the grids are located in, and i get the following error on the first time that I click the button:
At that point, if I refresh the page and click the button again, it works fine. I think it's because I'm trying to set Session variables that will be used in databinding, which is possibly trying to happen while the Session variables are being set. I'm not quite sure though...
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="calcButton">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="WebBlue" />
<center>
<table>
<tr>
<td align="right">
<asp:Label ID="yearLabel" runat="server" Text="Select Year:" Font-Bold="true" Font-Size="Medium"></asp:Label>
</td>
<td> </td>
<td align="left">
<telerik:RadComboBox ID="yearList" runat="server" DataSourceID="yearSource" DataTextField="year" DataValueField="year"></telerik:RadComboBox>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="monthLabel" runat="server" Text="Select 4-5-4 Month:" Font-Bold="true" Font-Size="Medium"></asp:Label>
</td>
<td> </td>
<td align="left">
<telerik:RadComboBox ID="monthList" runat="server">
<Items>
<telerik:RadComboBoxItem Text="January" Value="1" />
<telerik:RadComboBoxItem Text="February" Value="2" />
<telerik:RadComboBoxItem Text="March" Value="3" />
<telerik:RadComboBoxItem Text="April" Value="4" />
<telerik:RadComboBoxItem Text="May" Value="5" />
<telerik:RadComboBoxItem Text="June" Value="6" />
<telerik:RadComboBoxItem Text="July" Value="7" />
<telerik:RadComboBoxItem Text="August" Value="8" />
<telerik:RadComboBoxItem Text="September" Value="9" />
<telerik:RadComboBoxItem Text="October" Value="10" />
<telerik:RadComboBoxItem Text="November" Value="11" />
<telerik:RadComboBoxItem Text="December" Value="12" />
</Items>
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="accountLabel" runat="server" Text="Select Account:" Font-Bold="true" Font-Size="Medium"></asp:Label>
</td>
<td> </td>
<td align="left">
<telerik:RadComboBox NoWrap="true" ID="accountBox" runat="server" DataSourceID="accountSource" DataTextField="description" DataValueField="account" Width="250px"></telerik:RadComboBox>
</td>
</tr>
<tr>
<td align="center" colspan="3">
<asp:Button ID="calcButton" runat="server" Text="Calculate GL Balance" style="cursor:pointer" OnClick="calcButton_Click"/>
</td>
</tr>
</table>
<br />
<br />
</center>
<asp:Button ID="hiddenButton" runat="server" style="display:none" OnClientClick="return false();" />
<asp:Panel ID="panel1" runat="server" DefaultButton="hiddenButton">
<table>
<tr>
<td align="right">
<asp:Label ID="accountText" runat="server" Text="Account: " Font-Bold="true"></asp:Label>
</td>
<td align="left">
<asp:Label ID="accountValue" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="GLCodeText" runat="server" Text="GL Code: " Font-Bold="true"></asp:Label>
</td>
<td align="left">
<asp:Label ID="GLCodeValue" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="dateStartText" runat="server" Text="4-5-4 Start Date: " Font-Bold="true"></asp:Label>
</td>
<td align="left">
<asp:Label ID="dateStartValue" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="dateEndText" runat="server" Text="4-5-4 End Date: " Font-Bold="true"></asp:Label>
</td>
<td align="left">
<asp:Label ID="dateEndValue" runat="server"></asp:Label>
</td>
</tr>
</table>
<center>
<table>
<tr>
<td colspan="2" align="center">
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Orientation="HorizontalTop" SelectedIndex="0" MultiPageID="RadMultiPage1">
<Tabs>
<telerik:RadTab Text="Balance View"></telerik:RadTab>
<telerik:RadTab Text="Outstanding Entries"></telerik:RadTab>
<telerik:RadTab Text="Entries During"></telerik:RadTab>
<telerik:RadTab Text="Entries After"></telerik:RadTab>
<telerik:RadTab Text="Voids and Modifications"></telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
<telerik:RadPageView ID="balancePage" runat="server">This is the Balance Page
</telerik:RadPageView>
<telerik:RadPageView ID="outstandingPage" runat="server">
<telerik:RadGrid ID="outstandingGrid" ShowStatusBar="true" DataSourceID="outstandingSource" AllowFilteringByColumn="true" ShowFooter="true"
runat="server" AutoGenerateColumns="true" PageSize="20" AllowSorting="True" AllowMultiRowSelection="False" EnableLinqExpressions="false"
AllowPaging="True" GridLines="Vertical" ShowHeader="true" Skin="WebBlue" AlternatingItemStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
FilterItemStyle-HorizontalAlign="Center">
</telerik:RadGrid>
</telerik:RadPageView>
<telerik:RadPageView ID="duringPage" runat="server">This is the During Page
</telerik:RadPageView>
<telerik:RadPageView ID="afterPage" runat="server">This is the After Page
</telerik:RadPageView>
<telerik:RadPageView ID="voidsPage" runat="server">This is the Voids Page
</telerik:RadPageView>
</telerik:RadMultiPage>
</td>
</tr>
</table>
</center>
</asp:Panel>
<asp:SqlDataSource ID="yearSource" ConnectionString="<%$ ConnectionStrings:StoreMainConnectionString %>"
SelectCommand="select distinct year(statement_date) as year from storemain..statement_header"
runat="server">
</asp:SqlDataSource>
<asp:SqlDataSource ID="accountSource" ConnectionString="<%$ ConnectionStrings:DBMotoConnectionString %>"
SelectCommand="select ccbact as account, ccadsc as description from dbmoto..xachkcp where ccactv <> 'I' and ccbact <> ''"
runat="server">
</asp:SqlDataSource>
<asp:SqlDataSource ID="outstandingSource" ConnectionString="<%$ ConnectionStrings:DBMotoConnectionString %>"
SelectCommand="select crbact, crcamt, crciso, crpaye from dbmoto..xachkrp where crbact = @account and crciso < @startDate and crcsts <> 'R'"
runat="server">
<SelectParameters>
<asp:SessionParameter Name="account" SessionField="account" />
<asp:SessionParameter Name="startDate" SessionField="startDate" />
</SelectParameters>
</asp:SqlDataSource>
And here is my code behind for my button click:
Any ideas?
Thanks,
Aaron