Error in this page

S

Seetharam K

Hi I got the following error. Can anybody please help me.



Server Error in '/' Application.
--------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'spanComment'
could not be found (are you missing a using directive or an assembly
reference?)

Source Error:



Line 4: <SCRIPT LANGUAGE ="C#" RUNAT ="Server">
Line 5: void SubmitBtn_Click(Object sender, EventArgs e){
Line 6: spanComment.innerHtml = "Here are the details we
received:<BR/><BR/>" +
Line 7: "First Name: " + textboxFirstName.Text+ "<BR/>" +
Line 8: "Last Name:" + textboxLastName.Text+ "<BR/>" +


Source File: C:\Inetpub\wwwroot\dotnet\SubmitReceiveComments.aspx
Line: 6


My program is ::

<%@Page Language = "C#"%>
<html>
<head>
<SCRIPT LANGUAGE ="C#" RUNAT ="Server">
void SubmitBtn_Click(Object sender, EventArgs e){
spanComment.innerHtml = "Here are the details we received:<BR/><BR/>" +
"First Name: " + textboxFirstName.Text+ "<BR/>" +
"Last Name:" + textboxLastName.Text+ "<BR/>" +
"Comments:" + textareaComments.Value+ "<BR/>" ;
}
</SCRIPT>
</head>
<body>


<font face="Verdana">
<h3> Welcome to my web page</h3>
Do you have any comments for our web page?
<Form action="SubmitReceiveComments.aspx" method = "POST"
RUNAT="Server"/>
First Name:<asp:textbox id="textboxFirstName" RUNAT="Server"/><BR/>
Last Name:<asp:textbox id="textboxLastName" RUNAT="Server"/><P/>
Comments:<P/>
<textarea cols="50" Rows="5" id="textareaComments" RUNAT="Server">
</textarea><P/>
<asp:button text="Send Comments" ONCLICK=" SubmitBtn_Click"
RUNAT="Server"/>

<h3> Thank You Your Comments were received.</h3>
Here are the details we received<BR/><BR/>
First Name. <%=Request.Form("textFirstName")%><BR/>
Last Name. <%=Request.Form("textLastName")%><BR/>
Comments. <%=Request.Form("textareaComments")%><BR/>
</font>

</body>
</html>
 
J

Jon Skeet

Seetharam K said:
Hi I got the following error. Can anybody please help me.

Well, the error message seems fairly clear - it doesn't understand what
you mean by 'spanComment'. So, how are you *expecting* it to understand
that, and have you checked that out?
 
C

CT

Your spanComment object, is it properly referenced? Can you compile, if you
prefix with the name of a Form it might belong to?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top