質問編集履歴

2

わかりやすいように修正

2018/09/30 05:23

投稿

pomu.pomupomu
pomu.pomupomu

スコア18

test CHANGED
File without changes
test CHANGED
@@ -16,11 +16,9 @@
16
16
 
17
17
 
18
18
 
19
- 具体的には左の画面はALLのタブを押しているので全件表示されていますが、右側の画面のように芝をクリックするとカテゴリーが芝のものを表示したいです。
19
+
20
-
21
- タブをクリックすることで表示するものが切り替わるようになっているため、最終的にはViewにはカテゴリーの数(今回は6種)だけデータベースから引っ張った値を挿入したいです。
20
+
22
-
23
- ![イメージ説明](78a2b3abcf5f0a9cca5207968b2b60f0.png) ![イメージ説明](9008c3b7f85510eaa0601aef43560a09.png)
21
+
24
22
 
25
23
 
26
24
 
@@ -106,20 +104,6 @@
106
104
 
107
105
  <input id="turf" type="radio" name="tab_item">
108
106
 
109
- <label class="tab_item tab_item_truf" for="turf">芝</label>
110
-
111
- <input id="fertilizer" type="radio" name="tab_item">
112
-
113
- <label class="tab_item tab_item_fertilizer" for="fertilizer">薬</label>
114
-
115
- <input id="machine" type="radio" name="tab_item">
116
-
117
- <label class="tab_item tab_item_machine" for="machine">機械</label>
118
-
119
- <input id="labor" type="radio" name="tab_item">
120
-
121
- <label class="tab_item tab_item_labor" for="labor">人</label>
122
-
123
107
  <input id="otherwise" type="radio" name="tab_item">
124
108
 
125
109
  <label class="tab_item tab_item_otherwise" for="otherwise">その他</label>
@@ -184,51 +168,7 @@
184
168
 
185
169
 
186
170
 
187
- <table border="0"><!-- ここから芝のカテゴリーを全件表示(ここはHTMLの手打ちのため繰り返しは省略してます) -->
171
+
188
-
189
- <tr class="note">
190
-
191
- <th>NO.</th>
192
-
193
- <th>タイトル</th>
194
-
195
- <th>レス数</th>
196
-
197
- <th>HN</th>
198
-
199
- <th colspan="2">最終コメント日時</th>
200
-
201
- <th>カテゴリー</th>
202
-
203
- <th>地域</th>
204
-
205
- <th>閲覧数</th>
206
-
207
- </tr><!--/.note-->
208
-
209
- <tr class="bbs_line">
210
-
211
- <td class="bbs_number">112</td>
212
-
213
- <td class="bbs_title"><a href="forum_topic/forum_topic.html">芝タイトル芝タイトル芝タイトル</a></td>
214
-
215
- <td class="bbs_comment_count">15</td>
216
-
217
- <td class="bbs_name"><a href="forum_profile/forum_profile.html">ニックネーム</a></td>
218
-
219
- <td class="bbs_date">1111/11/11</td>
220
-
221
- <td class="bbs_time">11:11</td>
222
-
223
- <td class="bbs_category">芝</td>
224
-
225
- <td class="bbs_region">鹿児島</td>
226
-
227
- <td class="bbs_reading_count">999</td>
228
-
229
- </tr>
230
-
231
- </table><!-- ここまで芝のカテゴリーを全件表示 -->
232
172
 
233
173
 
234
174
 

1

文章の途切れを修正

2018/09/30 05:23

投稿

pomu.pomupomu
pomu.pomupomu

スコア18

test CHANGED
File without changes
test CHANGED
@@ -244,11 +244,31 @@
244
244
 
245
245
 
246
246
 
247
- View側がエラーを起こしてるのでどうしようないのですが、もし、View受け渡しに成功した場合は、
247
+ もし、Controllerのreturn View()扱いに成功した場合は、foreachの引数のModelにより詳細な名前となるプロパティを加えるのではないかと考えました
248
-
248
+
249
- ```c#
249
+ ```c#
250
+
251
+
252
+
253
+
254
+
250
-
255
+ @foreach (var item in Model.All)
256
+
251
-
257
+ {
258
+
259
+ (省略)
260
+
261
+ }
262
+
263
+
264
+
265
+ @foreach (var item in Model.turf)
266
+
267
+ {
268
+
269
+ (省略)
270
+
271
+ }
252
272
 
253
273
  ```
254
274
 
@@ -259,3 +279,11 @@
259
279
 
260
280
 
261
281
  ### 補足情報(FW/ツールのバージョンなど)
282
+
283
+ VS2017
284
+
285
+ Windows7
286
+
287
+ .Net Framework 4.6.1
288
+
289
+ MVC5