View Single Post
  #1 (permalink)  
Old August 26th, 2008, 05:06 PM
JoshuaZ JoshuaZ is offline
Registered User
 
Join Date: Aug 2008
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default textbox viewstate missing on postback

I'm an asp.net user and just came across a problem in an old classic asp page so I'm not familiar.
I'm dealing with a form that's being posted back to itself and all the forms inputs are lost. In the page load i can access them through the Request[] object.

The page looks something like the following:
<% Import statements %>
<html>
<head>
<some javascript/>
</head>
<C# script>
void page_load(object, sender)
{
   //checks form input and does some database stuff
}
</script>
<body>
<form name="reg" onsubmit="return checkForm()" action="contact-regform.aspx" method="post" style="margin: 0; padding: 0">
<input name="firstname" size="34" style="margin: 4px 0px; width: 90%" />
<...some more inputs>
</html>

I've tried adding runat="server" to the form and input.
I've tried changing the input to an asp:textbox
I've tried adding value='<%= Request["firstname"] %>
but no matter what I do, the input are always blank on postback!

Please help.

Reply With Quote