Solved

How to read input textboxes in vb.net

Posted on 2010-09-23
3
462 Views
Last Modified: 2012-06-27
I created an aspx website page with a form and several textboxes inside the form. I used the asp textboxes
<asp:TextBox ID="txtBox1"
        runat="server" Height="20px" Width="150px"></asp:TextBox>
input textboxes

<input name="txtBox1" type="text" id="txtBoxFName" style="height:20px;width:150px;" />

Now, I am not able to refer to the textboxes in the aspx.vb file. The aspx.vb does not recognize the input text boxes. What do I have to change in the aspx.vb ?
0
Comment
Question by:Angel02
3 Comments
 
LVL 15

Accepted Solution

by:
crisco96 earned 400 total points
ID: 33744951
to refer to the input textboxes you have to make them runat="server" then in the code behind you would be able to reference txtBoxFName. Additionally if you couldn't make it runat server you can get the value posted by the textbox with Request.Form("txtBox1")
0
 
LVL 9

Assisted Solution

by:richard_hughes
richard_hughes earned 100 total points
ID: 33745683
Hello Angel02

Unless there is a specific reason, it is best to stick with using <asp:TextBox ...> as the resulting Html is the same.

If you do ever need to refer to a Html control, use the following code:

Thanks,

Richard Hughes
<input id="myInputControl" name="myInputControl" runat="server" ...>

<div id="myDiv" name="myInputControl" runat="server">

You can do this with any Html control, <tr>, <table>, <p> tags etc...

Open in new window

0
 

Author Closing Comment

by:Angel02
ID: 33789348
Includign runat="server" solved the issue. Thank You !
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now