I have a form (testform.html)as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>test</title>
</head>
<body>
    <form id="form1" method="post" action="datareturn.aspx" >
    <input type="text" id="FoxyData" name="FoxyData" />
    <input id="Submit" type="submit" value="submit" name="submit"  />
    </form>
</body>
</html>

When I enter data into the form field and click submit then the datareturn.aspx page opens but the Request.Form collection is empty. I I change "post" to "get" and click submit the Request.Querystring collection correctly contains the data.

I have used request.form() many times and although I'm sure it's something silly, i just can't work out why the POST is not working.

Any Ideas anyone?

Thanks,

Terry

Recommended Answers

All 4 Replies

I also add one other comment..

The receiving page says that the REQUEST_METHOD is set to get not post, but I don't know why

Terry

datareturn.aspx page

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    Sub page_load()
        Dim data = Request.Form("FoxyData")
        Response.Write(data)
    End Sub
</script>

Yes, I have tried this code and Response.Write(Data) returns nothing

Terry

I found the answer.

i was running in debug mode in visual studio.net. When I uploaded to a real web server, it posted correctly.

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.