Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.NET 2.0 error message help

Status
Not open for further replies.

maanwar

IS-IT--Management
Oct 10, 2009
1
CA
Hello all:

I am new to ASP.NET and I am getting the following error.
I am using the SITEPOINT book Titled-->Build your own ASP.NET 2.0 web site using VB 7 C#.

Any web help in understanding the error would be greatly appreciated.

===================================================

Compiler Error Message: BC30456: 'Submit' is not a member of 'ASP.survey_aspx'.

Source Error:

Line 41: <!-- Display confirmation button -->
Line 42: <p>
Line 43: <button id="confirmButton" onserverclick="Submit"
Line 44: runat="server">Confirm </button>
Line 45: </p>


Source File: C:\Documents and Settings\Adnan Anwar\My Documents\Visual Studio 2005\Learning\Chap4\Survey.aspx Line: 43
=====================================================
SOURCE CODE:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
<html>
<head>
<title>Using ASP.NET HTML Server Controls</title>
<!-- Code will go here -->
</head>
<body>
<form runat="server">
<h2> Take the survey</h2>
<!-- Display user name -->
<p>
Name: <br />
<input type="text" id="name" runat="server" />
</p>
<!-- Display email -->
<p>
Email:<br />
<input type="text" id="email" runat="server" />
</p>
<!-- Display technology options -->
<p>
Which server technologies do you use? <br />
<select id="serverModel" runat="server" multiple="True">
<option>ASP.NET</option>
<option>PHP</option>
<option>JSP</option>
<option>CGI</option>
<option>ColdFusion</option>
</select>
</p>
<!-- Display .NET preference options -->
<p>
Do you like .NET preference so far? <br />
<select id="LikeDotNet" runat="server" >
<option>Yes</option>
<option>No</option>
</select>
</p>
<!-- Display confirmation button -->
<p>
<button id="confirmButton" onserverclick="Submit"
runat="server">Confirm </button>
</p>
<!-- Confirmation label -->
<p>
<asp:Label ID="feebackLabel" runat="server" />
</p>
</form>
</body>
</html>

Thanks!

Adnan A.
 
is onserverclick an event? I didn't think it was. However, you need to define a member for Submit. it will most likely look like this
Code:
public partial class Survey: Page
{
   public void Submit(object sender, EventArgs e)
   {
   }
}

you are also mixing web server controls <asp:... runat="server" /> with html controls <input />, <select />. while you can do this I would pick one or the other for consistency.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top