hello!
i've created an instance of a class within an .aspx.
the class that i've instantiated has a method that contains the following code:
TextBox myTextBox = new TextBox();
myTextBox.Text = "Sample Text";
whenever i call this method i receive no errors, but i don't achieve the desired result either (no web control appears).
(note: i can print text from this method, so i'm fairly sure that there's nothing wrong with the way i'm using the class)
i'm basically trying to create a class that i can call from a web form in order to programmatically create a web server control (textbox in this case) inside the same web form.
the basic rationale behind this is that i will eventually be able to build the contents of web forms dynamically, rather than having to hard-code page designs.
i'm new to asp.net, and so i'm assuming that i'm misunderstanding something fairly fundamental here.
can anyone help me out?
i've created an instance of a class within an .aspx.
the class that i've instantiated has a method that contains the following code:
TextBox myTextBox = new TextBox();
myTextBox.Text = "Sample Text";
whenever i call this method i receive no errors, but i don't achieve the desired result either (no web control appears).
(note: i can print text from this method, so i'm fairly sure that there's nothing wrong with the way i'm using the class)
i'm basically trying to create a class that i can call from a web form in order to programmatically create a web server control (textbox in this case) inside the same web form.
the basic rationale behind this is that i will eventually be able to build the contents of web forms dynamically, rather than having to hard-code page designs.
i'm new to asp.net, and so i'm assuming that i'm misunderstanding something fairly fundamental here.
can anyone help me out?