001  <% @Page Language="C#" %>
002  <HTML>
003  <HEAD>
004  <title>Page Counter Test</title>
005  </HEAD>
006  <BODY bgcolor="#fffff">
007  
008  <form runat="server">
009  <p>Schriftart:
010  <asp:DropDownList id=fontSelection runat="SERVER">
011   <asp:ListItem Value="Times New Roman" >Times New Roman</asp:ListItem>
012   <asp:ListItem Value="Lucida Sans Unicode" >Lucida Sans Unicode</asp:ListItem>
013   <asp:ListItem Value="Arial" >Arial</asp:ListItem>
014   <asp:ListItem Value="Courier" >Courier New</asp:ListItem>
015   <asp:ListItem Value="Verdana" >Verdana</asp:ListItem>
016  </asp:DropDownList>
017  </p>
018  
019  <p>
020  Schriftgröße: <asp:TextBox id=txtFontSize runat="SERVER" size=10 />
021  </p>
022  
023  <p>
024  Text: <asp:TextBox id=txtHitValue value="99" runat="SERVER" />
025  </p>
026  
027  <p>Hintergrundfarbe:
028  <asp:DropDownList id=bgclrSelection runat="SERVER">
029   <asp:ListItem Value="ffffff" >Weiß</asp:ListItem>
030   <asp:ListItem Value="ff0000" >Rot</asp:ListItem>
031   <asp:ListItem Value="ffff00" >Gelb</asp:ListItem>
032  </asp:DropDownList>
033  </p>
034  
035  <p>Schriftfarbe:
036  <asp:DropDownList id=fontclrSelection runat="SERVER">
037   <asp:ListItem Value="000000" >Schwarz</asp:ListItem>
038   <asp:ListItem Value="0000ff" >Blau</asp:ListItem>
039   <asp:ListItem Value="00ff00" >Grün</asp:ListItem>
040  </asp:DropDownList>
041  </p>
042  
043  <asp:Button id=btnSubmit text="Abschicken"
044   runat="SERVER"
045   OnClick="btn_OnClick"
046   />

047  
048  </form>
049  
050  <asp:Image id=PageCounter runat="server" imageurl="pagecounter.aspx" />
051  
052  <script language="c#" runat="server">
053  void btn_OnClick(Object src,EventArgs e)
054  {
055   if (Page.IsValid)
056   {
057   string strUrl = "pagecounter.aspx?";
058   strUrl += "HitFontName=" + Server.UrlEncode(fontSelection.SelectedItem.Text);
059   strUrl += "&HitFontSize=" + txtFontSize.Text;
060   strUrl += "&HitCount=" + txtHitValue.Text;
061   strUrl += "&HitBackgroundColor=" + Server.UrlEncode("#" + bgclrSelection.SelectedItem.Value);
062   strUrl += "&HitFontColor=" + Server.UrlEncode("#" + fontclrSelection.SelectedItem.Value);
063   PageCounter.ImageUrl = strUrl;
064   }
065  }
066  </script>
067  
068  </BODY>
069  </HTML>