<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-GB link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span lang=CS>Zdravím,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=CS>Hraju si s IronPython a ASP.NET.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=CS><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=CS>V default.aspx mám:<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";background:yellow;mso-highlight:yellow'><%</span><span
style='font-size:10.0pt;font-family:"Courier New";color:blue'>@</span><span
style='font-size:10.0pt;font-family:"Courier New"'> <span style='color:#A31515'>Page</span>
<span style='color:red'>Language</span><span style='color:blue'>="IronPython"</span>
<span style='color:red'>CodeFile</span><span style='color:blue'>="Default.aspx.py"</span>
<span style='background:yellow;mso-highlight:yellow'>%><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";background:yellow;mso-highlight:yellow'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'><!</span><span style='font-size:10.0pt;
font-family:"Courier New";color:#A31515'>DOCTYPE</span><span style='font-size:
10.0pt;font-family:"Courier New"'> <span style='color:red'>html</span> <span
style='color:red'>PUBLIC</span> <span style='color:blue'>"-//W3C//DTD
XHTML 1.0 Transitional//EN"</span> <span style='color:blue'>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'><</span><span style='font-size:10.0pt;
font-family:"Courier New";color:#A31515'>html</span><span style='font-size:
10.0pt;font-family:"Courier New"'> <span style='color:red'>xmlns</span><span
style='color:blue'>="http://www.w3.org/1999/xhtml"</span> <span
style='color:blue'>><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'><</span><span style='font-size:10.0pt;
font-family:"Courier New";color:#A31515'>head</span><span style='font-size:
10.0pt;font-family:"Courier New"'> <span style='color:red'>runat</span><span
style='color:blue'>="server"><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:blue'><</span><span
style='color:#A31515'>title</span><span style='color:blue'>></span>Untitled
Page<span style='color:blue'></</span><span style='color:#A31515'>title</span><span
style='color:blue'>><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'></</span><span style='font-size:10.0pt;
font-family:"Courier New";color:#A31515'>head</span><span style='font-size:
10.0pt;font-family:"Courier New";color:blue'>><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'><</span><span style='font-size:10.0pt;
font-family:"Courier New";color:#A31515'>body</span><span style='font-size:
10.0pt;font-family:"Courier New";color:blue'>><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:blue'><</span><span
style='color:#A31515'>form</span> <span style='color:red'>id</span><span
style='color:blue'>="form1"</span> <span style='color:red'>runat</span><span
style='color:blue'>="server"><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:blue'><</span><span
style='color:#A31515'>div</span><span style='color:blue'>><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:blue'><</span><span
style='color:#A31515'>asp</span><span style='color:blue'>:</span><span
style='color:#A31515'>Label</span> <span style='color:red'>ID</span><span
style='color:blue'>="Label1"</span> <span style='color:red'>runat</span><span
style='color:blue'>="server"</span> <span style='color:red'>Text</span><span
style='color:blue'>="Label"></</span><span style='color:#A31515'>asp</span><span
style='color:blue'>:</span><span style='color:#A31515'>Label</span><span
style='color:blue'>><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:blue'><</span><span
style='color:#A31515'>asp</span><span style='color:blue'>:</span><span
style='color:#A31515'>Button</span> <span style='color:red'>ID</span><span
style='color:blue'>="Button1"</span> <span style='color:red'>runat</span><span
style='color:blue'>="server"</span> <span style='color:red'>Text</span><span
style='color:blue'>="Button"</span> <span style='color:red'>OnClick</span><span
style='color:blue'>="Button1_OnClick"</span> <span style='color:blue'>/><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:blue'></</span><span
style='color:#A31515'>div</span><span style='color:blue'>><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:blue'></</span><span
style='color:#A31515'>form</span><span style='color:blue'>><o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'></</span><span style='font-size:10.0pt;
font-family:"Courier New";color:#A31515'>body</span><span style='font-size:
10.0pt;font-family:"Courier New";color:blue'>><o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'></</span><span style='font-size:10.0pt;
font-family:"Courier New";color:#A31515'>html</span><span style='font-size:
10.0pt;font-family:"Courier New";color:blue'>><o:p></o:p></span></p>
<p class=MsoNormal><span lang=CS><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=CS>V default.aspx.py mám:<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>import</span><span style='font-size:10.0pt;
font-family:"Courier New"'> clr<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>clr.AddReference(<span style='color:maroon'>'System.Data'</span>)<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>clr.AddReference(<span style='color:maroon'>'System.Configuration'</span>)<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>clr.AddReference(<span style='color:maroon'>'System.Web'</span>)<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>from</span><span style='font-size:10.0pt;
font-family:"Courier New"'> System.Data <span style='color:blue'>import</span>
*<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>from</span><span style='font-size:10.0pt;
font-family:"Courier New"'> System.Configuration <span style='color:blue'>import</span>
*<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>from</span><span style='font-size:10.0pt;
font-family:"Courier New"'> System.Web <span style='color:blue'>import</span> *<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>from</span><span style='font-size:10.0pt;
font-family:"Courier New"'> System.Web.Security <span style='color:blue'>import</span>
*<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>from</span><span style='font-size:10.0pt;
font-family:"Courier New"'> System.Web.UI <span style='color:blue'>import</span>
*<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>from</span><span style='font-size:10.0pt;
font-family:"Courier New"'> System.Web.UI.WebControls <span style='color:blue'>import</span>
*<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>from</span><span style='font-size:10.0pt;
font-family:"Courier New"'> System.Web.UI.WebControls.WebParts <span
style='color:blue'>import</span> *<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>from</span><span style='font-size:10.0pt;
font-family:"Courier New"'> System.Web.UI.HtmlControls <span style='color:blue'>import</span>
* <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>class</span><span style='font-size:10.0pt;
font-family:"Courier New"'> utils(object):<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> f = file(<span style='color:maroon'>'c:\\test.txt'</span>,<span
style='color:maroon'>'a'</span>)<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> c = 0<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>def</span><span style='font-size:10.0pt;
font-family:"Courier New"'> Page_Load(sender, e):<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span style='color:blue'>pass<o:p></o:p></span></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:blue'>def</span><span style='font-size:10.0pt;
font-family:"Courier New"'> Button1_OnClick(sender, e):<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> u = utils()<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> u.c = u.c + 1<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> Label1.Text = <span style='color:maroon'>"Hello
World: "</span> + str(u.c)<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>
u.f.write(<span style='color:maroon'>"Hello World: "</span> +
str(u.c) + <span style='color:maroon'>"\n"</span>)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=CS><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=CS>Problém je, že hodnota proměné „c“
je stále 1. Chci dosáhnout toho, aby se mi při klikání na tlačítko
vždy zvýšila o jednu. Nevíte někdo jak toho dosáhnout?<o:p></o:p></span></p>
<p class=MsoNormal><span lang=CS><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=CS>Díky,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=CS>David<o:p></o:p></span></p>
<p class=MsoNormal><span lang=CS><o:p> </o:p></span></p>
</div>
</body>
</html>