using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;
using System.Data.SqlClient;
using System.Web.UI;
public TextBoxes(string query)
{
String[] Vars = query.Split('@');
for (int x = 1;x < Vars.Length;x++)
{
TextBox tb = (TextBox)FindControl(Vars[x] + "TextBox") as TextBox;
}
}
I receive the error "The name 'FindControl' does not exist in the current context. I am trying to fill an array of textboxes depending on the name provided by the string.
e.g; TextBoxes[2] = Vars[x] + "TextBox";
Is there some NameSpace I am missing? As when I look up FindControl it simply tells me the NameSpace is "System.Web.UI" and I have added "System.web" to my references.