473,799 Members | 2,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Retrieving form data by name

This will likely be the dumbest question of the day, but:

Me.Request.Form .Item(3) 'works
Me.Request.Form .Item("txtName" ) 'doesn't work

Intellisense shows the full name of the key is:
ctl00$ContentPl aceHolder1$txtN ame

Why is the key not: txtName ?

Master:
<form id="form1" runat="server">
<div>
<asp:ContentPla ceHolder
ID="ContentPlac eHolder1" runat="server">
</asp:ContentPlac eHolder>
</div>
</form>

Page:
<asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1"
runat="server">
<table style="width: 500px; height: 200px">
<tr>
<td style="width: auto;">
Email address:</td>
<td style="width: 192px;">
<asp:TextBox ID="txtEmail" runat="server"
MaxLength="50" Width="264px"></asp:TextBox></td>

Jul 6 '07 #1
5 1924
You could read your value as
txtName.Text
or
Me.Request.Form .Item(txtName.C lientID)

"an******@gmail .com" wrote:
This will likely be the dumbest question of the day, but:

Me.Request.Form .Item(3) 'works
Me.Request.Form .Item("txtName" ) 'doesn't work

Intellisense shows the full name of the key is:
ctl00$ContentPl aceHolder1$txtN ame

Why is the key not: txtName ?

Master:
<form id="form1" runat="server">
<div>
<asp:ContentPla ceHolder
ID="ContentPlac eHolder1" runat="server">
</asp:ContentPlac eHolder>
</div>
</form>

Page:
<asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1"
runat="server">
<table style="width: 500px; height: 200px">
<tr>
<td style="width: auto;">
Email address:</td>
<td style="width: 192px;">
<asp:TextBox ID="txtEmail" runat="server"
MaxLength="50" Width="264px"></asp:TextBox></td>

Jul 6 '07 #2
Thanks!

Jul 6 '07 #3
Or just use

txtName.Text

if viewstate is enabled.

"Sergey Poberezovskiy" <Se************ *****@discussio ns.microsoft.co mwrote
in message news:31******** *************** ***********@mic rosoft.com...
You could read your value as
txtName.Text
or
Me.Request.Form .Item(txtName.C lientID)

"an******@gmail .com" wrote:
>This will likely be the dumbest question of the day, but:

Me.Request.For m.Item(3) 'works
Me.Request.For m.Item("txtName ") 'doesn't work

Intellisense shows the full name of the key is:
ctl00$ContentP laceHolder1$txt Name

Why is the key not: txtName ?

Master:
<form id="form1" runat="server">
<div>
<asp:ContentPla ceHolder
ID="ContentPla ceHolder1" runat="server">
</asp:ContentPlac eHolder>
</div>
</form>

Page:
<asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1"
runat="server" >
<table style="width: 500px; height: 200px">
<tr>
<td style="width: auto;">
Email address:</td>
<td style="width: 192px;">
<asp:TextBox ID="txtEmail" runat="server"
MaxLength="5 0" Width="264px"></asp:TextBox></td>


Jul 6 '07 #4
Howdy Aidy,

Why if viewstate is enabled? It works even if ViewState is disabled, because
it's equivalent to Request.Form[txt.UniqueID]. TextBox uses viewstate only to
raise OnTextChanged event.

Regards
--
Milosz
"Aidy" wrote:
Or just use

txtName.Text

if viewstate is enabled.

"Sergey Poberezovskiy" <Se************ *****@discussio ns.microsoft.co mwrote
in message news:31******** *************** ***********@mic rosoft.com...
You could read your value as
txtName.Text
or
Me.Request.Form .Item(txtName.C lientID)

"an******@gmail .com" wrote:
This will likely be the dumbest question of the day, but:

Me.Request.Form .Item(3) 'works
Me.Request.Form .Item("txtName" ) 'doesn't work

Intellisense shows the full name of the key is:
ctl00$ContentPl aceHolder1$txtN ame

Why is the key not: txtName ?

Master:
<form id="form1" runat="server">
<div>
<asp:ContentPla ceHolder
ID="ContentPlac eHolder1" runat="server">
</asp:ContentPlac eHolder>
</div>
</form>

Page:
<asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1"
runat="server">
<table style="width: 500px; height: 200px">
<tr>
<td style="width: auto;">
Email address:</td>
<td style="width: 192px;">
<asp:TextBox ID="txtEmail" runat="server"
MaxLength="50" Width="264px"></asp:TextBox></td>



Jul 6 '07 #5
I have to admit as I was typing I doubted that you needed the viewstate
enabled. As you said, it is needed for comparisons for raising events and
seld-populating but no much else

"Milosz Skalecki [MCAD]" <mi*****@DONTLI KESPAMwp.plwrot e in message
news:79******** *************** ***********@mic rosoft.com...
Howdy Aidy,

Why if viewstate is enabled? It works even if ViewState is disabled,
because
it's equivalent to Request.Form[txt.UniqueID]. TextBox uses viewstate only
to
raise OnTextChanged event.

Regards
--
Milosz
"Aidy" wrote:
>Or just use

txtName.Text

if viewstate is enabled.

"Sergey Poberezovskiy" <Se************ *****@discussio ns.microsoft.co m>
wrote
in message news:31******** *************** ***********@mic rosoft.com...
You could read your value as
txtName.Text
or
Me.Request.Form .Item(txtName.C lientID)

"an******@gmail .com" wrote:

This will likely be the dumbest question of the day, but:

Me.Request.For m.Item(3) 'works
Me.Request.For m.Item("txtName ") 'doesn't work

Intellisense shows the full name of the key is:
ctl00$ContentP laceHolder1$txt Name

Why is the key not: txtName ?

Master:
<form id="form1" runat="server">
<div>
<asp:ContentPla ceHolder
ID="ContentPla ceHolder1" runat="server">
</asp:ContentPlac eHolder>
</div>
</form>

Page:
<asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1"
runat="server" >
<table style="width: 500px; height: 200px">
<tr>
<td style="width: auto;">
Email address:</td>
<td style="width: 192px;">
<asp:TextBox ID="txtEmail" runat="server"
MaxLength="5 0" Width="264px"></asp:TextBox></td>




Jul 6 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1586
by: Alistair | last post by:
Hi all, I am creating a database based site that keeps track of books, who has read them and the comments they have. After a little help in M.P.I.asp.DB I managed to create a database (access 2000) as follows USERS TABLE
35
2555
by: NickName | last post by:
I understand it's easy to list all saved queries of a given Access database via Msysobjects system table. However, I have not seen any posting over this NG or other similar ones that also include SQL statement(content) of these queries, though I've noticed some VB code for that. Is that because it's simply impossible to get a query content (not query resultset) from a SQL stmt? Thanks in advance.
0
2073
by: Andy | last post by:
Hi All. I'm working for a company that has set out a guideline for retrieving data from a database. Nobody can explain to me the reason for the following. When retrieving a set of records from database to a VB.net app, they retrieve the database fields as a record set eg. "select name, suburb from myTable"
10
3701
by: Girish | last post by:
Hi Everyone, I am passing a form to a php script for further processing. I am able to retrieve the last value set for that given form variable using $variable=$_REQUEST;
7
4707
by: rfinch | last post by:
Very new to this but using the MS working with dynamics CRM 3.0 book to run web application to retrieve lead records from CRM 3.0. Have followed the book instructions on page 380-382. But am getting the following in ie 7. Compiler Error Message: CS0234: The type or namespace name 'CrmSdk' does not exist in the class or namespace 'WorkingWithCrm' (are you missing an assembly reference?)
2
1892
by: Hyperion | last post by:
Hello all, Im very new to php ,when I check execute this progrm the values from the database are retrieving and didplyed in a row.When I click the particul;ar edit button of a row ,I should take a vlue($id),by which I can edit that prticula data.what i should do? plese help. <html> <body> <table width="53%" border="0" cellspacing="5" cellpadding="0" align="left"> <form method='post'> <?php include("dbconnect.php");...
2
2008
by: 4Ankit | last post by:
hello all, i am having some difficulty retrieving information from my form. I want to add content in my table but the content i want to add to the table is what the user inputs in my form. Basically i want to know how i retrieve information from the form so i can disaply it in the table. i have put the code i am using below, the feature i cannot get to work is the change content function. I want the email address entered by the...
0
3399
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options within options. I have everything being dynamically named from the previously dynamically named element. (I hope this makes sense.) I am not able to retrieve any of the dynamically created values. I can view them on the source page but can't pull them...
34
2585
by: vpriya6 | last post by:
Hi guys, I am new to Ajax, xml and javascript. I want to know how can I retrieve data from xml and display in the html page? please help me out. suppose my xml file is customer.xml the code is below: <CUSTOMER>
2
2824
by: phpnewbie26 | last post by:
I currently have two drop down menus where the second one is populated from the first one. My second drop down menu should be able to do multiple selection. I have searched online and found out how to do so (add in multiple and put brackets after name), but unfortunately when I retrieve the data on the next page, it seems that none of the selections were added to the variable array. On the other hand, it "POST"-ed the null value which is 1. My...
0
10491
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10268
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10031
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9079
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5593
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.