J
just.an.imbecile
I have searched alot for this and cannot find an answer. I have a
simple form, and when it submits, I have it posting the data. I have a
simple function to loop through and print out all my form data:
<table class="data" width="90%">
<tr>
<th>Name</th>
<th>Value</th></tr>
<% string val;
foreach ( string name in Request.Form.AllKeys)
{
if (name != "" )
val = Request.Form[ name ] ;
else val = " "; %>
<tr>
<td><%= name %></td>
<td><%= val %></td></tr>
<% } %>
</table>
If that looks familiar, that is because I robbed it from a tutorial
site. Anyway, the problem is that I get garbage that looks like this
when I run it:
Name Value
__VIEWSTATE /wEPDwUJODI3NTcxMjc...
txtFName
txtLName
txtEmailBody
__EVENTVALIDATION wEWBALnqp3/DwK7zqYkArvO7sc...
I realize that I could just use if statements to ignore any names of
"__VIEWSTATE" or "__EVENTVALIDATION", but I was using some VB code
previously called gdform.asp, which did the same exact logic, but it
did not have to account for these two variables. What is going on, and
is there a cleaner way than using if statements to ignore these
variables?
Thanks in advance,
John
simple form, and when it submits, I have it posting the data. I have a
simple function to loop through and print out all my form data:
<table class="data" width="90%">
<tr>
<th>Name</th>
<th>Value</th></tr>
<% string val;
foreach ( string name in Request.Form.AllKeys)
{
if (name != "" )
val = Request.Form[ name ] ;
else val = " "; %>
<tr>
<td><%= name %></td>
<td><%= val %></td></tr>
<% } %>
</table>
If that looks familiar, that is because I robbed it from a tutorial
site. Anyway, the problem is that I get garbage that looks like this
when I run it:
Name Value
__VIEWSTATE /wEPDwUJODI3NTcxMjc...
txtFName
txtLName
txtEmailBody
__EVENTVALIDATION wEWBALnqp3/DwK7zqYkArvO7sc...
I realize that I could just use if statements to ignore any names of
"__VIEWSTATE" or "__EVENTVALIDATION", but I was using some VB code
previously called gdform.asp, which did the same exact logic, but it
did not have to account for these two variables. What is going on, and
is there a cleaner way than using if statements to ignore these
variables?
Thanks in advance,
John