Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to read input textboxes in vb.net

Posted on 2010-09-23
3
Medium Priority
?
476 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
crisco96 earned 1600 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 400 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

722 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