<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="Default_aspx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
   <title>Kontrolka Required Field Validation</title>
</head>
<body>
   <h3>
      <font face="Verdana">Zgaszanie bdw</font>
   </h3>
   <form runat="server" ID="frmBugs">
      <div>
         <table bgcolor="gainsboro" cellpadding="10">
            <tr valign="top">
               <td colspan="3">
                  <!-- Wywietlenie komunikatw bdw -->
                  <asp:Label ID="lblMsg"
                  Text="Prosz poniej umieci informacje dotyczce bdu"
                  ForeColor="red" Font-Name="Verdana"
                  Font-Size="10" runat="server" />
                  <br>
               </td>
            </tr>
            <tr>
               <td align="right">
                  <font face=Verdana size="2">Ksika</font>
               </td>
               <td>
               <!-- Rozwijana lista ksiek (musi zosta wybrana jedna) -->
                  <ASP:DropDownList id=ddlBooks runat=server>
                     <asp:ListItem>-- Prosz zaznaczy ksik --</asp:ListItem>
                     <asp:ListItem>Programming ASP.NET</asp:ListItem>
                     <asp:ListItem>Programming .NET Windows Applications</asp:ListItem>
                     <asp:ListItem>Programming C#</asp:ListItem>
                     <asp:ListItem>Programming Visual Basic 2005</asp:ListItem>
                     <asp:ListItem>
                        Teach Yourself C++ In 21 Days
                     </asp:ListItem>
                     <asp:ListItem>
                        Teach Yourself C++ In 24 Hours
                     </asp:ListItem>
                     <asp:ListItem>TY C++ In 10 Minutes</asp:ListItem>
                     <asp:ListItem>TY More C++ In 21 Days</asp:ListItem>
                     <asp:ListItem>C++ Unleashed</asp:ListItem>
                  </ASP:DropDownList>
               </td>
               <!-- Sprawdzanie poprawnoci rozwijanej listy -->
               <td align="center" rowspan="1">
                  <asp:RequiredFieldValidator
                  id="reqFieldBooks"
                  ControlToValidate="ddlBooks"
                  Display="Static"
                  InitialValue="-- Prosz zaznaczy ksik --"
                  Width="100%" runat="server"
                     Prosz wybra ksik
                  </asp:RequiredFieldValidator>
               </td>
            </tr>
            <tr>
               <td align="right">
               <!-- Przyciski opcji dotyczce numeru edycji ksiki -->
                  <font face="Verdana" size="2">Edycja:</font>
               </td>
               <td>
                  <ASP:RadioButtonList id=rblEdition
                  RepeatLayout="Flow" runat="server">
                     <asp:ListItem>pierwsza</asp:ListItem>
                     <asp:ListItem>druga</asp:ListItem>
                     <asp:ListItem>trzecia</asp:ListItem>
                     <asp:ListItem>czwarta</asp:ListItem>
                  </ASP:RadioButtonList>
               </td>
               <!-- Sprawdzanie poprawnoci edycji ksiki -->
               <td align="middle" rowspan="1">
                  <asp:RequiredFieldValidator
                  id="reqFieldEdition"
                  ControlToValidate="rblEdition"
                  Display="Static"
                  InitialValue=""
                  Width="100%" runat="server">
                     Prosz wybra edycj ksiki
                  </asp:RequiredFieldValidator>
               </td>
            </tr>
            <tr>
               <td align="right" style="HEIGHT: 97px">
                  <font face="Verdana" size="2">Bd:</font>
               </td>
               <!-- Wielowierszowe pole tekstowe na opis bdu -->
               <td style="HEIGHT: 97px">
                  <ASP:TextBox id="txtBug" runat="server" width="183px"
                  textmode="MultiLine" height="68px"/>
               </td>
               <!-- Sprawdzanie poprawnoci pola tekstowego -->
               <td style="HEIGHT: 97px">
                  <asp:RequiredFieldValidator
                  id="reqFieldBug"
                  ControlToValidate="txtBug"
                  Display="Static"
                  Width="100%" runat="server">
                     Prosz poda informacje o bdzie
                  </asp:RequiredFieldValidator>
               </td>
            </tr>
            <tr>
               <td>
               </td>
               <td>
                  <ASP:Button id="btnSubmit"
                  text="Zgo bd" runat="server" OnClick="btnSubmit_Click" />
               </td>
               <td>
               </td>
            </tr>
         </table>
      </div>
   </form>
</body>
</html>
