1

First off , I know the question looks very similar to the question here

But somehow the fixes suggested there arent working for me. So here goes. I have the following code in my aspx page :

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

But when I try the following code in my code behind:

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

I get the error saying that 'txtinput1' does not exist in the context. For sake of completion here's my default.aspx https://gist.github.com/KodeSeeker/5217410.

P.S. Im a C# noob, so I may be missing something obvious.

EDIT: Designer.cs https://gist.github.com/KodeSeeker/5217484

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

Community
  • 1
  • 1
seeker
  • 6,841
  • 24
  • 64
  • 100

1 Answers1

3

Your designer.cs seems lacking of the proper declaration of the namespace

 namespace Project3_ConsumptionApplication
 {
     ...
 }
Steve
  • 213,761
  • 22
  • 232
  • 286
  • Thanks for the answer, the code doesnt seem to show any compile time errors but Intellisense still doesnt seem to detect the field, is this normal ? or will there be problems later? – seeker Mar 21 '13 at 22:59
  • when I add the namespace the error disappears. I dont know for sure whether it will run properly though. Here's the modified designer (you may double check)https://gist.github.com/KodeSeeker/5217607 – seeker Mar 21 '13 at 23:02
  • So the error is solved, 'the program runs properly' is another matter :-) – Steve Mar 21 '13 at 23:04