1

まず、質問がここの質問と非常によく似ていることを知ってい ます

しかし、どういうわけか、修正は私のために働いていないことを示唆していました。だからここに行きます。aspx ページに次のコードがあります。

  <asp:TextBox ID="txtinput1" runat="server" Width="200px" 
       ontextchanged="txtinput1_TextChanged"></asp:TextBox>

しかし、コードビハインドで次のコードを試すと:

 protected void Page_Load(object sender, EventArgs e)
        {
            StemService.ServiceClient myClient = new StemService.ServiceClient();
            string input = txtinput1.Text;
        }

「txtinput1」がコンテキストに存在しないというエラーが表示されます。完了するために、ここに私の default.aspx https://gist.github.com/KodeSeeker/5217410があります。

PS Im は C# noobであるため、明らかな何かが欠けている可能性があります。

編集: Designer.cs https://gist.github.com/KodeSeeker/5217484

編集 2: Default.aspx.cs: https://gist.github.com/KodeSeeker/5217517

4

1 に答える 1

3

あなたの designer.cs は、名前空間の適切な宣言が欠けているようです

 namespace Project3_ConsumptionApplication
 {
     ...
 }
于 2013-03-21T22:53:31.340 に答える