Solved

How to read input textboxes in vb.net

Posted on 2010-09-23
3
470 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 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