Asp:code
<asp:TextBox ID="TextBox1" runat="server" ReadOnly="true"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server" ReadOnly="true"></asp:TextBox>
C#:
[System.Web.Services.WebMethod]
public static Array LoadAssetAssignView() {
string sql = "SELECT Time,Inuse FROM table4";
using(SqlConnection Connection = new SqlConnection((@ "Data Source"))) {
using(SqlCommand myCommand = new SqlCommand(sql, Connection)) {
Connection.Open();
using(SqlDataReader myReader = myCommand.ExecuteReader()) {
DataTable dt = new DataTable();
dt.Load(myReader);
Connection.Close();
Num1 = textbox1.text; //Error(Can't access my asp control)
Num2 = textbox2.text;
}
}
}
}
In my Asp Page I involved Two textbox for my requirement.But In my back end,I Can't Access the textbox in Static method .Suggest Some Ideas. Answer rather than Comments are Appreciated.