ASP.net gather value in input box

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?
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MishaProgrammerCommented:
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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Shaun VermaakTechnical Specialist/DeveloperCommented:
txtHeight1.Text in code behind
0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks Misha. Out of interest how would I set the value too
0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

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

Open in new window

0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
I get txtHeigt1 is not declared
0
MishaProgrammerCommented:
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"
0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
The rebuild unfortunately didn't work
0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Sorry I missed the Runat="Server". I did a rebuild and this worked
 Height1.Value = "x"
1
Shaun VermaakTechnical Specialist/DeveloperCommented:
Don't know how I missed that :D
0
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
No problem Shaun. Your posts steered me in the right direction
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.