ASP.net gather value in input box

Murray Brown
Murray Brown used Ask the Experts™
on
Hi

In my ASP.net I have the following input box
<input type="text" name="txtHeight1" placeholder="From" id="txtHeight1" class="auto-style5"/>

Open in new window


How do I use the value that is input using VB.net?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
What about this code?
Dim s as String
s = Request["txtHeight1"]

Open in new window

or this:
Dim s as String
s = txtHeight1.Text;

Open in new window

Shaun VermaakTechnical Specialist
Awarded 2017
Distinguished Expert 2018

Commented:
txtHeight1.Text in code behind
Murray BrownASP.net/VSTO Developer

Author

Commented:
Thanks Misha. Out of interest how would I set the value too
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Commented:
Try this code:
txtHeight1.Text = "YourText"

Open in new window

Murray BrownASP.net/VSTO Developer

Author

Commented:
I get txtHeigt1 is not declared

Commented:
Rebuild solution? Also try to check your  apsx page and make sure that it contains a txtHeigt1 with that name, and that it is declared as runat="server"
Murray BrownASP.net/VSTO Developer

Author

Commented:
The rebuild unfortunately didn't work
Murray BrownASP.net/VSTO Developer

Author

Commented:
Sorry I missed the Runat="Server". I did a rebuild and this worked
 Height1.Value = "x"
Shaun VermaakTechnical Specialist
Awarded 2017
Distinguished Expert 2018

Commented:
Don't know how I missed that :D
Murray BrownASP.net/VSTO Developer

Author

Commented:
No problem Shaun. Your posts steered me in the right direction

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial