Solved

How to read input textboxes in vb.net

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

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.…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 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