Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 6th, 2003, 01:08 AM
Registered User
 
Join Date: Dec 2003
Location: , , China.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default a problem in book<<beginning asp.net using vb>>

  Two days ago I begined to study this book and then meeted a problem .
  After I executed the holidaypage.aspx with webbrower ,it said that:"Control 'address' of type 'TextBox' must be placed inside a form tag with runat=server ".
  But if place "runat=server" into the form tag of "hoidaypage.aspx",my brower will not auto go to the "holidayresponse.aspx" after click submit button.It also display "hoidaypage.aspx". The point is that I want it to auto display "holidayresponse.aspx" after click submit button!

Below is the origin code:
-------------------------------------------------------------------
1.holidaypage.aspx:
 <html>
  <head>
    <title>Holiday page</title>
  </head>
  <body>
   <form action="holidayresponse.aspx" method="post">
      Please enter your name:
      <asp:textbox id="fullname" />
      <br /><br />
      Please enter your address:
      <asp:textbox runat="server" id="address" rows=5 textmode="multiline" />
      <br /><br />
      please choose ************:
      <asp:radiobuttonlist id="************" runat="server">
        <asp:listitem id="option1" value="Male" />
        <asp:listitem id="option2" value="Female" />
      </asp:radiobuttonlist>
      <br /><br />
      Please select the destination you would like details on:
      <asp:dropdownlist id="destination" runat="server">
         <asp:listitem value="madrid"/>
         <asp:listitem value="oslo"/>
         <asp:listitem value="prague"/>
         <asp:listitem value="lisbon"/>
      </asp:dropdownlist>
      <br/><br/>
      <input type="Submit">
        <input type="reset">
    </form>
</body>
</html>

2.holidayresponse.aspx:
 <script runat="server" language="vb">
  Sub Page_Load()
        response.write("<b>Name:</b>"+request.form("fullname")+"<br/>")
        response.write("<b>Adrress:</b>"+request.form("address")+"<br/>")
        response.write("<b>************:</b>"+request.form("************")+"<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 will receive a confirmation email from us shortly.
   <br/><br/>
</body>
</html>
-------------------------------------------------------------------
  help!thanks!

  #2 (permalink)  
Old December 7th, 2003, 02:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Asp.net pages don't work the same way classic ASP pages did. The form will always be posted back to the original page. It was created that way to act more like Windows forms.

If you want move to a different page, you will have to pass those values a different way like in a querystring. However, in my opinion, this kind of defeats the purpose of using .net.

J
  #3 (permalink)  
Old December 8th, 2003, 03:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,111
Thanks: 0
Thanked 3 Times in 3 Posts
Default

if you are passing values to a different page you can't retrieve that information by using asp.net controls. instead, you need to use the Params collection from the HTTPRequest class.

ex. Request.Params("fullname")

  #4 (permalink)  
Old December 8th, 2003, 08:32 PM
Authorized User
 
Join Date: Jun 2003
Location: Melbourne, Victoria, Australia.
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tdaustin Send a message via Yahoo to tdaustin
Default

Alternatively the old ASP collections are still supported.
eg. Request.QueryString("fullname")
    Request.Form("fullname")

:)

TDA
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274) epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:37 AM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 07:50 AM
<marquee><b>About CHAT App. in PHP4</b></marquee> Ramkrishna PHP How-To 1 September 11th, 2004 07:01 AM
the book <<Data-Centric.net programing with c#>> jamxx All Other Wrox Books 0 November 18th, 2003 09:56 PM
<<ASP.NET Security>>,download files in chapter 8 alaix All Other Wrox Books 1 July 24th, 2003 10:29 AM



All times are GMT -4. The time now is 05:54 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.