Server Side Controls in ASP.NET

K

Kerri

Hi,

I have an aspx page with some server side textboxes.

I have a button onmy page which allows users to add data
to a database.

In my onclick event for my button when I try and get teh
value from the textbox using..

Dim myString as String = textbox1.text

...it is blank.

When I do a..

Dim myString = Request.Form("textbox1")

...I get the value the user enetered.

I have declared my textbox as a control in my codebehind.

And it is an asp.net textbox.

Any ideas why this is?

This is baffling me.

Kerri.
 
K

Kevin Spencer

Have you added the "runat=server" attribute to the template HTML for the
text box?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top