Wrox Programmer Forums
|
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 November 11th, 2004, 11:16 PM
Registered User
 
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Runat = Server

I am a newbee of .NET C#. I've coded as below:

<form action="second.aspx" method="post">
  <P>What Martial Art do you like?
    <asp:radiobuttonlist id="radio1" runat="server">
        <asp:listitem value="Capoeira"/>
        <asp:listitem value="Shaolin"/>
        <asp:listitem value="JKD"/>
    </asp:radiobuttonlist>
  </P>
  <P><input type="submit" value="Submit"></P>
</form>

According to "Beginning ASP.NET using C#" page 131 said, no need to put "runat=server" at "<form>", but the page totally can't be loaded and errors have come out: "Control 'radio1_0' of type 'RadioButton' must be placed inside a form tag with runat=server."...

Could anyone tell me what's wrong?

 
Old November 12th, 2004, 12:19 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Server controls have to be inside a form with runat="server". On the other hand, if you are using only HTML (client Side) controls, ruat="server" is not needed. There can be only one form in a page with runat="server".

Regards
Ganesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
Runat server dilemma ? rsearing ASP.NET 2.0 Basics 1 November 24th, 2006 04:10 AM
<form runat="server"> gopi2008 ASP.NET 1.0 and 1.1 Basics 3 May 21st, 2006 11:07 PM
SQL Server sync with net server and browser server ne SQL Server DTS 0 June 13th, 2005 06:29 PM
HTML Control "select" runat="server" hamid HTML Code Clinic 3 October 13th, 2004 09:19 AM
[000] Unable to connect to server 'SERVER\SQL'; SQ ctanchan SQL Server 2000 1 August 15th, 2003 07:18 AM





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