Solved

How to read input textboxes in vb.net

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 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