Click here to Skip to main content
15,898,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

i have this textbox in a aspx page:

<asp:TextBox ID=fname_txt runat="server" >


i tried to call the textbox by the page name it did not work so how can i call this textbox from a class that i created in vb.net?

thank you :)
Posted

Call your TextBox with its ID.

Mostly in TextBoxes we need to get/set Data.

so in the code behid file (.aspx.vb) you can call it with ID e.g.

Dim data as String
data= fname_txt.Text

now pass the "data" variable to another class
 
Share this answer
 
I declared the variable as public and the data variable is still inaccessible from the class :(
 
Share this answer
 
Comments
Saqib Mobeen 16-Aug-13 5:59am    
create a function to get the variable as argument in 2nd class
then
Add the reference of your 2nd class (where you want to use the data variable) in (.aspx.vb).
Create the object for the 2nd class in .aspx.vb
now call the function of 2nd class through the object and pass the data as parameter to that function

Best of Luck..!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900