Rather than storing data in an asp:TextBox
, you should consider some other methods of storing values.
For example, you can use the HttpApplicationState
class in System.Web
to store a variety of different data types. If you wanted to store a DataTable
using this method, you could do so by doing something like this in C#:
Application["data"] = x;
(x being a DataTable
)
DataTable y = (DataTable)Application["data"];
Another way of storing data can be using HttpSession
variables which can be done in the same way using C#:
Session["name"] = "TestUserName";
String x = Session["name"].ToString();
More information about:
HttpApplicationState
HttpSessionState
solved In .net store the data in textboxes [closed]