|
[Site Entry Point: Frames]▶[SignalR:MoveSquare] [Site Entry Point: MVC] ▶[SignalR: KnockOut Form] [Site Entry Point: Index] ▶[MVC: Standard Razor] [Site Entry Point: Page] |
/* File:Global.asax.cs */ public class MvcApplication : System.Web.HttpApplication { protected void Session_Start(object sender, EventArgs e) { Session["CartItemNumArray"] = new ArrayList(); Session["salestaxrate"] = 0.2; } }
<div> Today is <%=DateTime.Now.ToString("dd-MMM-yyyy")%> <%=DateTime.Now.AddDays(2).ToString("dd-MMM-yyyy")%> </div> <!-- Session Variables must be cast to their type --> <% double salestax = (double)Session["salestaxrate"]; %> <% ArrayList stockPicks = (ArrayList)Session["CartItemNumArray"]; stockPicks.Add("Dog"); stockPicks.Add("Cat"); stockPicks.Add("Goldfish"); int k = stockPicks.Count; %> Value of Session Variable SalesTaxRate is: <%=salestax%><br/> Size Session ArrayList is: <%=k%>
<form id="form1" runat="server"> <div> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:montegodataContext %>" SelectCommand="SELECT [TRADE], [TODAY], [CLASS], [RULE], [CATEGORY], [LEGEND], [AMOUNT] FROM [FUNDING]"> </asp:SqlDataSource> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="TRADE" HeaderText="Trade" SortExpression="TRADE" /> <asp:BoundField DataField="TODAY" HeaderText="TODAY" SortExpression="TODAY" /> <asp:BoundField DataField="CLASS" HeaderText="CLASS" SortExpression="CLASS" /> <asp:BoundField DataField="RULE" HeaderText="RULE" SortExpression="RULE" /> <asp:BoundField DataField="CATEGORY" HeaderText="CATEGORY" SortExpression="CATEGORY" /> <asp:BoundField DataField="LEGEND" HeaderText="LEGEND" SortExpression="LEGEND" /> <asp:BoundField DataField="AMOUNT" HeaderText="Amount" SortExpression="AMOUNT" /> </Columns> </asp:GridView> </div> </form>