Hi,
I have page1.aspx with a calender control with multiple selection of dates with confirmation button below calender which displays selected dates in grid view below. Everthing worrking fine upto now.
Now i want to send the gridview data to nextpage.aspx using session.
Please see below code for gridview to display dates.
<asp:UpdatePanel ID="updpnl" runat="server">
<ContentTemplate>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="black"
BorderWidth="1px" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Height="150px"
NextPrevFormat="FullMonth" OnPreRender="Calendar1_PreRender" Width="200px"
OnSelectionChanged="Calendar1_SelectionChanged" SelectedDate="2012-07-18">
<DayHeaderStyle Font-Bold="True" Font-Size="8pt" />
<NextPrevStyle Font-Bold="True" Font-Size="7pt" ForeColor="#333333" VerticalAlign="Bottom" />
<OtherMonthDayStyle ForeColor="#999999" />
<SelectedDayStyle BackColor="#333399" ForeColor="White" />
<TitleStyle BackColor="White" BorderColor="Black" Font-Bold="True"
Font-Size="10pt" ForeColor="#333399" BorderWidth="1px" />
</asp:Calendar>
<br />
<asp:Label ID="lblErrorMessage" runat="server" Text="Label" Visible="False"
Font-Size="14px" ForeColor="Red"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel><br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<asp:Button ID="btnDisplaySelectedDates" runat="server" Text="Confirm Selected Dates"
OnClick="btnDisplaySelectedDates_Click" />
<asp:Button ID="btnClearSelection" runat="server" Text="Clear" OnClick="btnClearSelection_Click" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" Font-Names="Verdana" Font-Size="Small"
runat="server" Width="200px"
EmptyDataText="Select Dates and Confirm" CellPadding="4" AutoGenerateColumns="False"
ForeColor="#333333" GridLines="None">
<AlternatingRowStyle BackColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:TemplateField HeaderText="Selected Date" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<%# DateTime.Parse(Container.DataItem.ToString()).ToShortDateString() %>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />Select Number of People<asp:DropDownList ID="ddlNumberOfPeopleSwimming" runat="server"
onselectedindexchanged="ddl_SelectedIndexChanged" AutoPostBack="true"
autocomplete="off">
<asp:ListItem>0</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:DropDownList>
<br />Total in NZD:
<asp:Label ID="lblTotal" runat="server" ForeColor="Red" Font-Size="20px" ></asp:Label>
<asp:TextBox ID="txtnod" runat="server" AutoPostBack="True" BackColor="Red"
Visible="false"></asp:TextBox>
<br />
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="btnAccommodation" runat="server" Text="Select Accommodation"
BackColor="#7A1616" ForeColor="White" onclick="btnAccommodation_Click"
PostBackUrl="~/accommodation.aspx" />