I
Ing. Rajesh Kumar
I have a UserControl with a TextBox "TextBox_1" and a ReadOnly Property "myText" in it. I am using this in a file (no Code Behind) as follows :
HTML:
<My:Control ID="txtName" runat="server" />
VB:
Dim var_1 as String = txtName.myText
Till here everything works fine.
Now I am trying to convert my file to a Code Behind file and here starts my problem.
<My:Control ID="txtName" runat="server" /> is in WebForm1.aspx now and
Dim var_1 as String = txtName.myText is in WebForm1.aspx.vb.
During the compilation it says "txtName is not declared", which I understand because I cannot declare it using the similar command as follows:
Protected txtNotes As System.Web.UI.WebControls.TextBox
So my question is how should I declare "txtName" to use it in a CodeBehind ?
I read a lot in MSDN but could not find the answer.
Thanks in advance
Raja
HTML:
<My:Control ID="txtName" runat="server" />
VB:
Dim var_1 as String = txtName.myText
Till here everything works fine.
Now I am trying to convert my file to a Code Behind file and here starts my problem.
<My:Control ID="txtName" runat="server" /> is in WebForm1.aspx now and
Dim var_1 as String = txtName.myText is in WebForm1.aspx.vb.
During the compilation it says "txtName is not declared", which I understand because I cannot declare it using the similar command as follows:
Protected txtNotes As System.Web.UI.WebControls.TextBox
So my question is how should I declare "txtName" to use it in a CodeBehind ?
I read a lot in MSDN but could not find the answer.
Thanks in advance
Raja