Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 27th, 2005, 07:04 PM
Authorized User
 
Join Date: Jun 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default error when i try to run these files, anyone?

can anyone explain this error i get when i try to run this file?

1st file named RacingForm.aspx contains this code:
<script runat="server" language="vb">
Sub Page_Load()
  Response.write("<b>Name: </b>" + Request.Form("name") + "<br><br>")
  Response.write("<b>Address: </b>" + Request.Form("address") + "<br><br>")
  Response.write("<b>************: </b>" + Request.Form("************") + "<br><br>")
  Response.write("<b>Racing Event: </b>" + Request.Form("race") + "<br><br>")
End Sub
</script>


<html>
  <head>
    <title>Race Form 2005</title>
  </head>
<body>
  <h1>Racing for the 2k5</h1>
  <h3>Brought to you by An</h3>
  <form action="RacingFormResponse.aspx method="post">
    Enter in your racer stats:<br><br>
    Name: <asp:textbox id="name" runat="server" /><br><br>
    Address: <asp:textbox id="address" runat="server" textmode="multiline" rows="5" /><br><br>
    ************: <asp:radiobuttonlist id="************" runat="server">
           <asp:listitem id="option1" value="Male" />
           <asp:listitem id="option2" value="Female" />
         </asp:radiobuttonlist>
    Sign up for the race you want to rip it up on:
    <asp:dropdownlist id="race" runat="server">
      <asp:listitem id="RaceOption1" value="Tasabuka" />
      <asp:listitem id="RaceOption2" value="Cali Speedway" />
      <asp:listitem id="RaceOption3" value="Pike's Peak" />
    </asp:dropdownlist><br>
    <input type="submit">
  </form>


</body>
</html>


second file named RacingFormResponse.aspx contains:

<script runat="server" language="vb">
Sub Page_Load()
  Response.write("<b>Name: </b>" + Request.Form("name") + "<br><br>")
  Response.write("<b>Address: </b>" + Request.Form("address") + "<br><br>")
  Response.write("<b>************: </b>" + Request.Form("************") + "<br><br>")
  Response.write("<b>Racing Event: </b>" + Request.Form("race") + "<br><br>")
End Sub
</script>



<html>
  <head>
    <title>This is your Racing Stats</title>
  </head>
<body>
  <br><Br>
  There you have it... your racing form.

</body>
</html>

the error says that the <asp:textbox...> needs to be contained within the <form> tag and the <form> tag need to be set to the attribute runat="server" but if you do that then doesn't asp.net not allow you to post ot another page because of the processing at the server making asp.net want to return to the original page???

confused here

 
Old June 27th, 2005, 09:16 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Yes, that is how it is designed to work. You are trying to build classic ASP pages with ASP.NET. Pick one method or the other, don't try to mix both.

-Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Write Files in another Domain (Run in Client) Maritza ASP.NET 2.0 Professional 1 February 26th, 2008 01:16 PM
Run same marco in several files together Ivanchan Excel VBA 3 April 4th, 2007 01:16 AM
Problem to run batch files from VB application Dmitriy VB How-To 7 September 13th, 2006 11:42 AM
Problem to run batch files from VB Application Dmitriy Pro VB 6 4 April 13th, 2006 02:27 AM
how to run files like in Windows teominator Beginning VB 6 4 January 23rd, 2005 11:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.