473,413 Members | 2,044 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,413 software developers and data experts.

Request.form isn't working

I have 2 pages. Page1 is a .html page with a form, hidden input, and a
submit button. I have the action set to Post.

<form id="form1" action="paymentcatch.aspx" method="post">

<input id="wtf" type="text" value="thisisnotworking" />
<input id="Submit1" type="submit" value="submit" />

</form>

Page 2 is ASPX (c#). On the page load I want to read the value from the
hidden input on Page1.

I'm trying to read the hidden input like this: Reques.Form["wtf"]

Everytime the result is null. Has anyone else had this issue?

Thanks In Advance
Scott
Feb 27 '06 #1
4 1545
forms are submitted based on the NAME field, not the IDfield..

try
<input id="wtf" name="wtf" type="text".../>

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Scott Durrett" <kc****@durrettonline.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have 2 pages. Page1 is a .html page with a form, hidden input, and a
submit button. I have the action set to Post.

<form id="form1" action="paymentcatch.aspx" method="post">

<input id="wtf" type="text" value="thisisnotworking" />
<input id="Submit1" type="submit" value="submit" />

</form>

Page 2 is ASPX (c#). On the page load I want to read the value from the
hidden input on Page1.

I'm trying to read the hidden input like this: Reques.Form["wtf"]

Everytime the result is null. Has anyone else had this issue?

Thanks In Advance
Scott

Feb 27 '06 #2
Karl,

Thank for the suggestion. Looks like the Request object is coming in blank
on my aspx catch page. I cannot figure this darn thing out. :)

Scott

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:uD**************@TK2MSFTNGP15.phx.gbl...
forms are submitted based on the NAME field, not the IDfield..

try
<input id="wtf" name="wtf" type="text".../>

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Scott Durrett" <kc****@durrettonline.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have 2 pages. Page1 is a .html page with a form, hidden input, and a
submit button. I have the action set to Post.

<form id="form1" action="paymentcatch.aspx" method="post">

<input id="wtf" type="text" value="thisisnotworking" />
<input id="Submit1" type="submit" value="submit" />

</form>

Page 2 is ASPX (c#). On the page load I want to read the value from the
hidden input on Page1.

I'm trying to read the hidden input like this: Reques.Form["wtf"]

Everytime the result is null. Has anyone else had this issue?

Thanks In Advance
Scott


Feb 27 '06 #3
Karl,

You were correct :) it's working now. The problem is when I was trying
everything I had changed my action from Post to Get... and never changed it
back. So back to the main problem. I was missing the Name tag.

Thanks
Scott

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:uD**************@TK2MSFTNGP15.phx.gbl...
forms are submitted based on the NAME field, not the IDfield..

try
<input id="wtf" name="wtf" type="text".../>

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Scott Durrett" <kc****@durrettonline.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have 2 pages. Page1 is a .html page with a form, hidden input, and a
submit button. I have the action set to Post.

<form id="form1" action="paymentcatch.aspx" method="post">

<input id="wtf" type="text" value="thisisnotworking" />
<input id="Submit1" type="submit" value="submit" />

</form>

Page 2 is ASPX (c#). On the page load I want to read the value from the
hidden input on Page1.

I'm trying to read the hidden input like this: Reques.Form["wtf"]

Everytime the result is null. Has anyone else had this issue?

Thanks In Advance
Scott


Feb 27 '06 #4
Hi, Scott.

You can find out real easy by using Request.Params.

Run this :
---------
requestparams.aspx
---------
<%@ Page Language="C#"%>
<script runat="server">
private void Page_Load(object sender, EventArgs e)
{
string paramInfo = "";
NameValueCollection pColl = Request.Params;
for(int i = 0; i <= pColl.Count - 1; i++)
{
paramInfo += "Key: " + pColl.GetKey(i) + "<br>";

string[] pValues = pColl.GetValues(i);

for(int j = 0; j <= pValues.Length - 1; j++)
{
paramInfo += "Value:" + pValues[j] + "<br><br>";
}
}
lblValues.Text = paramInfo;
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Label id="lblValues" runat="server" />
</form>
</body>
</html>
----------

That will iterate through all the request parameters.

If you use : <input id="wtf" name="wtf" type="text".../>

You could also, simply use :

Page.Request.Params["wtf"];


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Scott Durrett" <kc****@durrettonline.com> wrote in message
news:e9*************@TK2MSFTNGP12.phx.gbl...
Karl,

Thank for the suggestion. Looks like the Request object is coming in blank on my aspx catch page.
I cannot figure this darn thing out. :)

Scott

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message
news:uD**************@TK2MSFTNGP15.phx.gbl...
forms are submitted based on the NAME field, not the IDfield..

try
<input id="wtf" name="wtf" type="text".../>

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Scott Durrett" <kc****@durrettonline.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have 2 pages. Page1 is a .html page with a form, hidden input, and a submit button. I have
the action set to Post.

<form id="form1" action="paymentcatch.aspx" method="post">

<input id="wtf" type="text" value="thisisnotworking" />
<input id="Submit1" type="submit" value="submit" />

</form>

Page 2 is ASPX (c#). On the page load I want to read the value from the hidden input on Page1.

I'm trying to read the hidden input like this: Reques.Form["wtf"]

Everytime the result is null. Has anyone else had this issue?

Thanks In Advance
Scott




Feb 27 '06 #5

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

Similar topics

1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
4
by: Pavils Jurjans | last post by:
Hallo, I am working on multilingual web-application, and I have to be very sure about how the international characters are encoded and decoded in the client-server form requests. There's a...
5
by: Wayne Wengert | last post by:
I am trying to use Request.Form to differentiate between when a page containing a form is first loaded and when it is reloaded as a result of the user clicking on the Submit button. Things are not...
6
by: Andy | last post by:
hI, wOULD PLEASE HELP ME. I AM GETTIGN THE REQUEST OBJECT ERROS ASP 0105: 80004005 INDEX OUT OF RANGE ERROR. HERE IS THE SNIPPET OF CODE THAT I AM USING. WHAT IS WRONG HERE? YOU CAN SEE WHAT I AM...
2
by: Moheb | last post by:
I've got the following code: <%= "myText = " + Request.Form %> <form id="Form1" method="post" runat="server"> <input type="text" id="myText"> <input type="button" value="submit"> </form> ...
7
by: eric.goforth | last post by:
Hello, I'm working with a classic asp page that calls another classic asp page. The html in my calling page looks like: <form method="post"...
5
by: Drew | last post by:
I am having an issue with an app that I built, it seems that Request.Form doesn't want to work sometimes, and only sometimes. For instance, I got a call last week about an error, I had the user...
12
by: Mark Rae | last post by:
Hi, See the previous thread Request.Form abuse in this newsgroup... I'm looking for a simple and efficient way to prevent people hijacking the <formtags on my websites and using them to send...
0
by: bolinc | last post by:
Can someone tell me why this isn't working? <Script language="JavaScript"><!--// var bJavaEnabled = Boolean(clientInformation.javaEnabled()); if (bJavaEnabled){ document.write('<form...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
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...

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.