Hello everybody
I`ve created a WebForms applications for learning purposes. I`ve placed two TextBoxes on my WebForm1 using the Visual Studio toolbox. The code is shown below :
Now in the corresponding WebForm1.aspx.cs coding file I`m trying to export the functionality of these two controls by creating the attribute FullNameCode:<asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox> <br /> Last Name: <asp:TextBox ID="txtLastName" runat="server"></asp:TextBox> <br />
Unfortunately, when I compile my code I get the error :Code:public string FullName { get { return txtFirstName.Text + " " + txtLastName.Text; } }
Shouldn`t the control be in context since I`m placing it on the same WebForm1 as the corresponding cs file?Code:Error 1 The name 'txtFirstName' does not exist in the current context




Reply With Quote