473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Class getting values from code behind

Hutt
5
Hello,
I'm fairly new to vb.net and have a question I can't find an answer to. The site I'm working on is complex, but to keep things simple here's the basic problem.
I have a site designed with a textbox on the default.aspx page, and I have a class in the App_Code folder (class1.vb). When the class1.vb code runs I need it to read the text from the textbox (i.e. theText = TextBox1.Text), but Visual Studio underlines TextBox1 in blue saying 'Name 'TextBox1' is not declared'. I understand that TextBox1 exists on the default.asp page and the class obviously can't see it. My question is, how can I make the class1.vb code see the textbox so I can retrieve text from it? Ultimately I will need to get all sorts of information from default.aspx when the class runs, but finding a solution to this one textbox should allow me to 'connect' to all the other controls on my page and make use of their values with the class runs. Thanks. Mark.
Jan 4 '08 #1
2 1282
Plater
7,872 Expert 4TB
Whoever runs class1 from the code_behind page of default.aspx should pass the value of textbox.Text to the class/function that needs it.
Jan 4 '08 #2
Hutt
5
Hi,
Thanks for the reply. That clears up that I cannot access the textbox directly from the class code (which I didn't know), so thanks.
Jan 4 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

50
by: Dan Perl | last post by:
There is something with initializing mutable class attributes that I am struggling with. I'll use an example to explain: class Father: attr1=None # this is OK attr2= # this is wrong...
7
by: Dan Trowbridge | last post by:
He everyone, I am just getting started with .NET and I am having a porting problem. I get and error in code that lookssomething like this (really stripped down but you get the idea)... class...
2
by: Chris | last post by:
Hi, I am building a single webform/webpage asp.net application using VB.NET. I have created lots of classes for this web application. On page load I use a facade controller pattern class to...
16
by: pawel.pabich | last post by:
Hajo, I would like to have 2 my own partial classes. For example: Default.aspx.cs Default2.aspx.cs and they both will relate to Default.aspx page.
8
by: Joel Reinford | last post by:
I would like to build a class that has properties which can be accessed by string names or index numbers in the form of MyClass.Item("LastName"). The string names or item index values would be...
16
by: Allen | last post by:
I have a class that returns an arraylist. How do I fill a list box from what is returned? It returns customers which is a arraylist but I cant seem to get the stuff to fill a list box. I just...
6
by: Adam | last post by:
Hi everyone, I figured by doing a larger project, I could start to learn how objects and classes work in PHP, but I am running into a problem. I am trying to write a sudoku generator. I was...
15
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
0
by: anileshlakhtakia | last post by:
Hi, I am getting this problem and i am not able to understand what is the logic behind this.My Problem is i have 2 user controls on my application having same namespace lets say...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.