Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.0
This is the forum to discuss the Wrox book Beginning ASP.NET 1.0 with C# by Chris Goode, John Kauffman, Christopher L. Miller, Neil Raybould, S. Srinivasa Sivakumar, Dave Sussman, Ollie Cornes, Rob Birdwell, Matt Butler, Gary Johnson, Ajoy Krishnamoorthy, Juan T. Llibre, Chris Ullman; ISBN: 9780764543708
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.0 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 December 7th, 2004, 08:09 AM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help Me!

Help!
Where here a mistake?

It is written: Server Error in '/5040 ' Application.

Control 'FullName' of type 'TextBox' must be placed inside a form tag with runat=server.

holidaypage.aspx
---------------------------------------
<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" runat="server" />
<br /><br />
Address:<asp:textbox id="Address" rows="5" textmode="multiline" runat="server" />
<br /><br />
************ -
<asp:radiobuttonlist id="************" runat="server">
<asp:listitem value="Male" />
<asp:listitem value="Female" />
</asp:radiobuttonlist>
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="Barcelona" />
</asp:dropdownlist>
<br /><br />
<input type="Submit">
<input type="Reset">
</form>
</body>
</html>




> holidayresponse.aspx
>------------------------
> <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> ************: </b> " Request. Form ("************") " <br/> ")
> Response. Write (" <b> Destination: </b> " Request. Form ("Destination") " <br
>/> ")
> End Sub
> </script>
> <html>
> <head> <title> Response </title>
> </head>
> <body>
> <br/>
> <br/>
> 1111111111111111
> </body>
> </html>
>------------------------

-----------
Yours faithfully
Andrey Vloshchinsky
House-page http://av140285.narod.ru


 
Old December 7th, 2004, 09:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

First, why are you coding with old ASP but using ASP.NET? Have you not read anything about ASP.Net?
Second, try putting <form runat="server"> after the <body> tag and </form> before </body>.

You need to read how ASP.NET works before using it.

 
Old December 7th, 2004, 02:57 PM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

From the book which I have bought this example:
" Beginning ASP.NET 1.0 with Visual Basic. NET "
The book is transferred to Russian, as I from Moldova!

I started to learn ASP.NET and while, that actually I understand nothing!
The book begins with the most simple examples.

And unless these scripts are written on old ASP?

Help me advice if can!
And in general I want to write a script for search on a site and registration!


 
Old December 9th, 2004, 08:10 AM
Friend of Wrox
 
Join Date: May 2003
Posts: 229
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What this code is trying to achieve is to post the data to a different page while using the server ASP.NET web form controls by defining the “runat=server” in the form tag.

If we are using this attribute with the form tag, the values of form will always be posted to the same page, you can check it by changing the “method=post” to “method=get”. There is no use of “action” attribute while using the “runat=server” attribute with the form tag. If you need to post the data to a different page you need to use HTML controls in ASP.NET. However I have modified the code for your convenience


<%@ Page Language="vb" %>
<script runat="server">

    Sub Page_Load()
      Response.Write ("<b>Name:</b> " + Request.Form("FullName") + "<br />")
      Response.Write ("<b>Address:</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>
    <form action="holidayresponse.aspx" runat="server">
        <h1>Feiertag Holidays
        </h1>
        Please enter your details here.
        <br />
        <br />
        Name:<asp:textbox id="FullName" runat="server"></asp:textbox>
        <br />
        <br />
        Address:<asp:textbox id="Address" runat="server" textmode="multiline" rows="5"></asp:textbox>
        <br />
        <br />
        ************ -
        <asp:radiobuttonlist id="************" runat="server">
            <asp:listitem value="Male" />
            <asp:listitem value="Female" />
        </asp:radiobuttonlist>
        Please select the destination you would like details on:
        <asp:dropdownlist id="Destination" runat="server">
            <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" value="Submit Query" />
        <input type="reset" value="Reset" />
    </form>
</body>
</html>

Charul Shukla
 
Old December 9th, 2004, 04:15 PM
Registered User
 
Join Date: Dec 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks you Charul Shukla, and I after I have seen that, that at me it turns out wanted to throw nothing studying ASP.NET!

And why it so writes:
-------------------------------
First, why are you coding with old ASP but using ASP.NET? Have you not read anything about ASP.Net?
-------------------------------
Unless it at me not scripts ASP.NET? And what then ASP.Net? Whether it is possible though something for the beginning to teach on the book " Beginning ASP.NET 1.0 with Visual Basic. NET "?


Charul Shukla I can hope in the future for your help in some questions on ASP.Net?
Thanks!











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