Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Posting to new page?


Message #1 by "Carl Jenkins" <cjnkns@h...> on Wed, 8 Jan 2003 21:08:07
Hi

I have been working out of the Beginning ASP.NET using VB.NET book
the following code is supposed to have the user fill out the fields and 
post it to the next page. I can not get this to work. It keeps telling me 
that i Must have the asp control inside a form tag with the runat 
attribute set. But the book specifically states that i should not set the 
runat attribute or the post to the new page will not work? Any help would 
be fantastic....

<html>
<head>
  <title>Holiday page</title>
</head>
<body>

  <form action="holidayresponse.aspx" method="post">
    <h1>Feiertag Holidays</h1>
    Please enter your details here.
    <br /><br />
    Name:<asp:textbox id="FullName"  />
    <br /><br />
    Address:<asp:textbox id="Address" rows="5" textmode="multiline"  />
    <br /><br />
    Sex - 
    <asp:radiobuttonlist id="sex" >
      <asp:listitem value="Male" />
      <asp:listitem value="Female" />
    </asp:radiobuttonlist>
    Please select the destination you would like details on:
    <asp:dropdownlist id="Destination" >
      <asp:listitem value="Madrid" />
      <asp:listitem value="Barcelona"/>
      <asp:listitem value="Lisbon"/>
      <asp:listitem value="Oslo"/>
      <asp:listitem value="Prague"/>
    </asp:dropdownlist>
    <br /><br />
      <input type="Submit">
    <input type="Reset">
  </form> 
 
</body>
</html>


Supposed to post to this page..

<script runat="server" language="vb">
  Sub Page_Load()
    Response.Write ("<b>Name:</b> " + Request.Form("FullName") + "<br />")
    Response.Write ("<b>Address:</b> " + Request.Form("Address") 
+ "<br />")
    Response.Write ("<b>Sex:</b> " + Request.Form("Sex") + "<br />")
    Response.Write ("<b>Destination:</b> " + Request.Form("Destination") 
+ "<br />")
  End Sub
</script>
<html>
<head>
  <title>Holiday page</title>
</head>
<body>
  <br /><br />
  These details have been entered into our database, you should receive 
a    confirmation email from us shortly.
<br /><br />
</body>
</html>


  Return to Index