473,394 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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$ContentPlaceHolder1$txtName

Why is the key not: txtName ?

Master:
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder
ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>

Page:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
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 1905
You could read your value as
txtName.Text
or
Me.Request.Form.Item(txtName.ClientID)

"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$ContentPlaceHolder1$txtName

Why is the key not: txtName ?

Master:
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder
ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>

Page:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
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*****************@discussions.microsoft.comwrot e
in message news:31**********************************@microsof t.com...
You could read your value as
txtName.Text
or
Me.Request.Form.Item(txtName.ClientID)

"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$ContentPlaceHolder1$txtName

Why is the key not: txtName ?

Master:
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder
ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>

Page:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
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 #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*****************@discussions.microsoft.comwrot e
in message news:31**********************************@microsof t.com...
You could read your value as
txtName.Text
or
Me.Request.Form.Item(txtName.ClientID)

"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$ContentPlaceHolder1$txtName

Why is the key not: txtName ?

Master:
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder
ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>

Page:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
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*****@DONTLIKESPAMwp.plwrote in message
news:79**********************************@microsof t.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*****************@discussions.microsoft.com>
wrote
in message news:31**********************************@microsof t.com...
You could read your value as
txtName.Text
or
Me.Request.Form.Item(txtName.ClientID)

"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$ContentPlaceHolder1$txtName

Why is the key not: txtName ?

Master:
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder
ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>

Page:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
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 #6

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

Similar topics

0
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...
35
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...
0
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...
10
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
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...
2
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...
2
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. ...
0
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...
34
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...

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.