質問編集履歴
4
タグを一つ修正しました
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
3
コードの改行
test
CHANGED
File without changes
|
test
CHANGED
@@ -34,9 +34,11 @@
|
|
34
34
|
|
35
35
|
|
36
36
|
|
37
|
-
<ASP:CheckBoxList ID="chl1" runat="server" DataSourceID="sdschl1" DataTextField="item_text"
|
37
|
+
<ASP:CheckBoxList ID="chl1" runat="server" DataSourceID="sdschl1" DataTextField="item_text"
|
38
38
|
|
39
|
+
DataValueField="item_value" RepeatDirection="Horizontal" ondatabound="chlchl1_DataBound"
|
40
|
+
|
39
|
-
|
41
|
+
OnSelectedIndexChanged="chl1_SelectedIndexChanged" AutoPostBack="True" />
|
40
42
|
|
41
43
|
|
42
44
|
|
2
コードの改行
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,15 +28,21 @@
|
|
28
28
|
|
29
29
|
```C#
|
30
30
|
|
31
|
+
<ASP:SqlDataSource ID="sds1" runat="server"
|
32
|
+
|
31
|
-
|
33
|
+
SelectCommand="<%$ Resources:sds1_SelectCommand %>" CancelSelectOnNullParameter="false" />
|
32
34
|
|
33
35
|
|
34
36
|
|
35
|
-
<ASP:CheckBoxList ID="chl1" runat="server" DataSourceID="sdschl1" DataTextField="item_text" DataValueField="item_value" RepeatDirection="Horizontal"
|
37
|
+
<ASP:CheckBoxList ID="chl1" runat="server" DataSourceID="sdschl1" DataTextField="item_text" DataValueField="item_value" RepeatDirection="Horizontal"
|
38
|
+
|
39
|
+
ondatabound="chlchl1_DataBound" OnSelectedIndexChanged="chl1_SelectedIndexChanged" AutoPostBack="True" />
|
36
40
|
|
37
41
|
|
38
42
|
|
39
|
-
<ASP:CustomValidator ID="cuschl1" runat="server" text="<%$ Resources:lblMessage_chl1Error %>"
|
43
|
+
<ASP:CustomValidator ID="cuschl1" runat="server" text="<%$ Resources:lblMessage_chl1Error %>"
|
44
|
+
|
45
|
+
OnServerValidate="cuschl1_ServerValidate" ValidateEmptyText="True" Visible="True" />
|
40
46
|
|
41
47
|
<!-- Resources:lblMessage_chl1Error にはエラー文言が入っています。-->
|
42
48
|
|
1
頂いた修正点(コードに適宜改行、参考YRLへのリンク)を修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -30,11 +30,15 @@
|
|
30
30
|
|
31
31
|
<ASP:SqlDataSource ID="sds1" runat="server" SelectCommand="<%$ Resources:sds1_SelectCommand %>" CancelSelectOnNullParameter="false" />
|
32
32
|
|
33
|
+
|
34
|
+
|
33
35
|
<ASP:CheckBoxList ID="chl1" runat="server" DataSourceID="sdschl1" DataTextField="item_text" DataValueField="item_value" RepeatDirection="Horizontal" ondatabound="chlchl1_DataBound" OnSelectedIndexChanged="chl1_SelectedIndexChanged" AutoPostBack="True" />
|
34
36
|
|
35
|
-
<asp:CustomValidator ID="cuschl1" runat="server" text="<%$ Resources:lblMessage_chl1Error %>" OnServerValidate="cuschl1_ServerValidate" ValidateEmptyText="True" Visible="True" />
|
36
37
|
|
38
|
+
|
39
|
+
<ASP:CustomValidator ID="cuschl1" runat="server" text="<%$ Resources:lblMessage_chl1Error %>" OnServerValidate="cuschl1_ServerValidate" ValidateEmptyText="True" Visible="True" />
|
40
|
+
|
37
|
-
|
41
|
+
<!-- Resources:lblMessage_chl1Error にはエラー文言が入っています。-->
|
38
42
|
|
39
43
|
```
|
40
44
|
|
@@ -52,7 +56,7 @@
|
|
52
56
|
|
53
57
|
args.IsValid = true;
|
54
58
|
|
55
|
-
|
59
|
+
|
56
60
|
|
57
61
|
if (chl1.SelectedIndex == -1)
|
58
62
|
|
@@ -96,7 +100,7 @@
|
|
96
100
|
|
97
101
|
以下は現状と相似したケースだと思いますが、解決法がよくわからなかったものです。
|
98
102
|
|
99
|
-
https://stackoverrun.com/ja/q/1933414
|
103
|
+
[https://stackoverrun.com/ja/q/1933414](https://stackoverrun.com/ja/q/1933414)
|
100
104
|
|
101
105
|
|
102
106
|
|