私は aspx の開発にまったく慣れていないので、aspx コードと aspx.cs の接続に苦労しています。正確には、次の問題に従っています。
DisplayChars.aspx :
<form id="form1" runat="server">
<div>
<div>Champion name: </div> <div><input id="Champ_name" type="text" /></div>
<div>Champion Icon URL: </div> <div><input id="Champ_icon" type="text" /></div>
<div>Champion Subtext: </div> <div><input id="Champ_subtext" type="text" /></div>
<div> Free to play :</div><div><input id="Champ_freetoplay" type="checkbox" />
</div>
<div>Positions:</div>
<div>
<input id="Top" type="checkbox" /> Top
<input id="Mid" type="checkbox" /> Mid
<input id="Jungle" type="checkbox" /> Jungle
<input id="Carry" type="checkbox" /> Carry
<input id="Support" type="checkbox" /> Support
</div>
</div>
<input id="Champ_Submit" type="submit" value="submit" />
DisplayChars.aspx.cs
if (IsPostBack)
{
//NameValueCollection nvc = Request.Form.GetValues
//Champion t1 = new Champion(Request.Form.Get("Champ_Name"), Int32.Parse(Request.Form.Get("Champ_freetoplay")), Request.Form.Get("Champ_subtext"), Request.Form.Get("Champ_description"), "10110");
//t1.persistChampion();
string temp = Request["Champ_name"];
そのため、フォーム値を取得するのに苦労しています。私も試しましRequest.Form.GetValues
た。Request.Form.Get
Request["Form_id_Name"]
問題は、私がオブジェクト指向プログラミングで経験したように、このアプローチが正しいかどうかですが、HTML aspx 疑似サーバー コードとその背後にある cs ファイルの組み合わせではそうではありません。