<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Index</title>
    <link rel="Stylesheet" href="../../Content/site.css" />

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" 
        type="text/javascript"></script></head>
    <script type="text/javascript">
        $(function () {
            $("form[action$='GetQuote']").submit(function () {
                $.ajax({
                    url: $(this).attr("action"),
                    type: "post",
                    data: $(this).serialize(),
                    success: function (stockData) {
                        $("#openingPrice").html(stockData.OpeningPrice);
                        $("#closingPrice").html(stockData.ClosingPrice);
                        $("#stockRating").html(stockData.Rating);
                    }
                });
                return false;
            }); 

        });
    </script>
<body>
    <div>
<h2>Akcje</h2> 
<% using(Html.BeginForm("GetQuote", "Stocks")) { %> 
    Symbol: 
    <%: Html.TextBox("symbol") %> 
    <input type="submit" /> 
<% } %> 
<table> 
    <tr><td>Cena otwarcia:</td><td><div id="openingPrice" /></td></tr> 
    <tr><td>Cena zamknięcia:</td><td><div id="closingPrice" /></td></tr> 
    <tr><td>Ocena:</td><td><div id="stockRating" /></td></tr> 
</table>  
 
<p><i>Strona wygenerowana o godzinie <%: DateTime.Now.ToLongTimeString() %></i></p> 

    
    </div>
</body>
</html>
