|
1 | 1 | <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="StudentControl.ascx.cs" Inherits="L08.StudentControl" %>
|
2 |
| -<div "> |
| 2 | +<script type="text/javascript"> |
| 3 | + function LookUpStock() { |
| 4 | + if (Page_ClientValidate()) { |
| 5 | + let list = document.getElementById("MainContent_StudentControl_RadioButtonListSex"); |
| 6 | + let inputs = list.getElementsByTagName("input"); |
| 7 | + let selected; |
| 8 | + for (var i = 0; i < inputs.length; i++) { |
| 9 | + if (inputs[i].checked) { |
| 10 | + selected = inputs[i]; |
| 11 | + break; |
| 12 | + } |
| 13 | + } |
| 14 | + let data = JSON.stringify( |
| 15 | + { |
| 16 | + "Family": $get("MainContent_StudentControl_TextBoxFamily").value, |
| 17 | + "Name": $get("MainContent_StudentControl_TextBoxName").value, |
| 18 | + "Patro": $get("MainContent_StudentControl_TextBoxPatro").value, |
| 19 | + "Date": $get("MainContent_StudentControl_TextBoxDate").value, |
| 20 | + "Sex": selected.value, |
| 21 | + "Name": $get("MainContent_StudentControl_TextBoxName").value, |
| 22 | + "Faculty": $get("MainContent_StudentControl_DropDownListFaculty").value, |
| 23 | + "Year": Number($get("MainContent_StudentControl_TextBoxYear").value), |
| 24 | + "Group": Number($get("MainContent_StudentControl_TextBoxGroup").value) |
| 25 | + }); |
| 26 | + CallServer(data, ""); |
| 27 | + } |
| 28 | + return false; |
| 29 | + } |
| 30 | + function ReceiveServerData(rValue) { |
| 31 | + $get("MainContent_StudentControl_LabelResult").textContent = rValue; |
| 32 | + } |
| 33 | +</script> |
| 34 | +<asp:FormView ID="FormView1" runat="server"></asp:FormView> |
| 35 | +<div> |
3 | 36 | <h1>StudentInfo</h1>
|
4 | 37 | <p>
|
5 | 38 | <asp:TextBox ID="TextBoxFamily" runat="server" placeholder="Фамилия"></asp:TextBox>
|
6 |
| - <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Введите фамилию" ControlToValidate="TextBoxFamily" Display="None"></asp:RequiredFieldValidator> |
7 | 39 | </p>
|
8 | 40 | <p>
|
9 | 41 | <asp:TextBox ID="TextBoxName" runat="server" placeholder="Имя"></asp:TextBox>
|
|
15 | 47 | <asp:TextBox ID="TextBoxDate" runat="server" placeholder="Дата рождения"></asp:TextBox>
|
16 | 48 | </p>
|
17 | 49 | <p>
|
18 |
| - <asp:RadioButtonList ID="RadioButtonListSex" runat="server" RepeatDirection="Horizontal" > |
19 |
| - <asp:ListItem Value="0" Text="Ж" ></asp:ListItem> |
| 50 | + <asp:RadioButtonList ID="RadioButtonListSex" runat="server" RepeatDirection="Horizontal"> |
| 51 | + <asp:ListItem Value="0" Text="Ж"></asp:ListItem> |
20 | 52 | <asp:ListItem Value="1" Text="М" Selected="true"></asp:ListItem>
|
21 | 53 | </asp:RadioButtonList>
|
22 | 54 | </p>
|
23 |
| - |
24 |
| - <p>Факультет |
25 |
| - <asp:DropDownList ID="DropDownListFaculty" runat="server" > |
| 55 | + <p> |
| 56 | + Факультет |
| 57 | + <asp:DropDownList ID="DropDownListFaculty" runat="server"> |
26 | 58 | <asp:ListItem Value="ИТ"></asp:ListItem>
|
27 | 59 | <asp:ListItem Value="ПИМ"></asp:ListItem>
|
28 | 60 | <asp:ListItem Value="ХТиТ"></asp:ListItem>
|
|
31 | 63 | <p>
|
32 | 64 | <asp:TextBox ID="TextBoxYear" runat="server" placeholder="Год поступления"></asp:TextBox>
|
33 | 65 | </p>
|
34 |
| -<p> |
| 66 | + <p> |
35 | 67 | <asp:TextBox ID="TextBoxGroup" runat="server" placeholder="Группа"></asp:TextBox>
|
36 |
| - <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="Группа не в диапазоне 1 100" Font-Overline="False" ControlToValidate="TextBoxGroup" MaximumValue="100" MinimumValue="1" Type="Integer" Display="None"></asp:RangeValidator> |
37 |
| -</p> |
38 |
| - <p><asp:Button ID="ButtonCancel" runat="server" Text="Отказаться" /><asp:Button ID="ButtonEnter" runat="server" Text="Ввод" /> |
39 | 68 | </p>
|
40 |
| - <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="ValidGr1" /> |
| 69 | + <p> |
| 70 | + <asp:Button ID="ButtonCancel" runat="server" Text="Отказаться" CausesValidation="false" UseSubmitBehavior="false" Visible="false"/> |
| 71 | + <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Введите фаилию" ControlToValidate="TextBoxFamily" Display="None"></asp:RequiredFieldValidator> |
| 72 | + <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Введите № группы" ControlToValidate="TextBoxGroup" Display="None"></asp:RequiredFieldValidator> |
| 73 | + <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Введите Имя" ControlToValidate="TextBoxName" Display="None"></asp:RequiredFieldValidator> |
| 74 | + <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="введите отчество" ControlToValidate="TextBoxPatro" Display="None"></asp:RequiredFieldValidator> |
| 75 | + <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Введите дату рождения" ControlToValidate="TextBoxDate" Display="None"></asp:RequiredFieldValidator> |
| 76 | + <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Введите год поступления" ControlToValidate="TextBoxYear" Display="None"></asp:RequiredFieldValidator> |
| 77 | + <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="день рождения error" Display="None" Operator="LessThan" Type="Date" ControlToValidate="TextBoxDate"></asp:CompareValidator> |
| 78 | + |
| 79 | + |
| 80 | + <asp:RangeValidator ID="RangeValidatorTextBoxGroup" runat="server" ErrorMessage="№ группы в диапазоне 1 100" ControlToValidate="TextBoxGroup" MaximumValue="100" MinimumValue="1" Type="Integer" Display="None"></asp:RangeValidator> |
| 81 | + <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> |
| 82 | + <asp:Button runat="server" ID="ButtonEnter" OnClientClick="LookUpStock();return false;" UseSubmitBehavior="false" Text="Async"/> |
41 | 83 |
|
| 84 | + <asp:Label ID="LabelResult" runat="server" Text="Label"></asp:Label> |
42 | 85 | </div>
|
0 commit comments