473,387 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

First asp.net error. Pl help

I get the following error. Please help

c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6 ,38): error CS1001:
Identifier expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6 ,52): error CS1002:
; expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(7 ,19): error CS1519:
Invalid token '(' in class, struct, or interface member declaration
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(9 ,2): error CS0116: A
namespace does not directly contain members such as fields or methods
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(69,16): error
CS1518: Expected class, delegate, enum, interface, or struct
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(93,25): error
CS1518: Expected class, delegate, enum, interface, or struct
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(173,25): error
CS1518: Expected class, delegate, enum, interface, or struct
c:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET
Files\webapplication1\8dd84b00\b065eec7\lohccsx9.0 .cs(177,1): error
CS1022: Type or namespace definition, or end-of-file expected

<%@ Page language="c#" Codebehind="WebForm2.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication1.WebForm2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<html>
<head><script runat=server>
protected void WebForm2_Load(Object 0, EventArgs e){
Response.Write("Message from Load Event Handler <br>");
}
protected void WebForm2_Init(Object 0, EventArgs e){
Response.Write("Message from Init Event Handler <br>");
}

protected void WebForm2_PreRender(Object 0,EventArgs e){
Response.Write("Message from PreRender Event Handler <br>");
}

protected override void OnInit(EventArgs e){
this.load new EventHander(WebForm2_Load);
this.load new EventHander(WebForm2_Init);
this.load new EventHander(WebForm2_Render);
base.OnInit(e);

}
</script>

<title>WebForm2</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">

<form id="Form1" method="post" runat="server">


</form>

</body>
</html>
Nov 18 '05 #1
1 2260
<%@ Page language="c#" Codebehind="WebForm2.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication1.WebForm2" %>

+ where is your code behind - >WebForm2.aspx.cs ??? I
cannot found it here. Check again syntax in your code
behind files

+ if you are not gonna use code behind (instead of using
visual tools, you like to just hands in on Notepad, then
it should be like this) :

-- delete this lines --<%@ Page language="c#" Codebehind="WebForm2.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication1.WebForm2" %>
---------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head><script runat=server>
--change to this ------------------------------------------
<head><script language="cs" runat=server>
protected void WebForm2_Load(Object 0, EventArgs e){
Response.Write("Message from Load Event Handler <br>"); }
protected void WebForm2_Init(Object 0, EventArgs e){
Response.Write("Message from Init Event Handler <br>"); }

protected void WebForm2_PreRender(Object 0,EventArgs e){
Response.Write("Message from PreRender Event Handler <br>"); }

protected override void OnInit(EventArgs e){
this.load new EventHander(WebForm2_Load);
this.load new EventHander(WebForm2_Init);
this.load new EventHander(WebForm2_Render);
base.OnInit(e);

}
</script>
Hope this helps :)

Jody Ananda
MCAD.NET,MCSD.NET
"All programs are poems, it just not all programmers are
poets."

-----Original Message-----
I get the following error. Please help

c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx( 6,38): error CS1001:Identifier expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx( 6,52): error CS1002:; expected
c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx( 7,19): error CS1519:Invalid token '(' in class, struct, or interface member declarationc:\inetpub\wwwroot\WebApplication1\WebForm2.aspx( 9,2): error CS0116: Anamespace does not directly contain members such as fields or methodsc:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempor ary ASP.NETFiles\webapplication1\8dd84b00\b065eec7\lohccsx9. 0.cs (69,16): errorCS1518: Expected class, delegate, enum, interface, or structc:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempor ary ASP.NETFiles\webapplication1\8dd84b00\b065eec7\lohccsx9. 0.cs (93,25): errorCS1518: Expected class, delegate, enum, interface, or structc:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempor ary ASP.NETFiles\webapplication1\8dd84b00\b065eec7\lohccsx9. 0.cs (173,25): errorCS1518: Expected class, delegate, enum, interface, or structc:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempor ary ASP.NETFiles\webapplication1\8dd84b00\b065eec7\lohccsx9. 0.cs (177,1): errorCS1022: Type or namespace definition, or end-of-file expected


<%@ Page language="c#" Codebehind="WebForm2.aspx.cs"
AutoEventWireup="false" Inherits="WebApplication1.WebForm2" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head><script runat=server>
protected void WebForm2_Load(Object 0, EventArgs e){
Response.Write("Message from Load Event Handler <br>"); }
protected void WebForm2_Init(Object 0, EventArgs e){
Response.Write("Message from Init Event Handler <br>"); }

protected void WebForm2_PreRender(Object 0,EventArgs e){
Response.Write("Message from PreRender Event Handler <br>"); }

protected override void OnInit(EventArgs e){
this.load new EventHander(WebForm2_Load);
this.load new EventHander(WebForm2_Init);
this.load new EventHander(WebForm2_Render);
base.OnInit(e);

}
</script>

<title>WebForm2</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" Content="C#">
<meta name=vs_defaultClientScript content="JavaScript"> <meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">

<form id="Form1" method="post" runat="server">


</form>

</body>
</html>
.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Rene | last post by:
Hi, I'm spend many hour to fix this problem, read many articles about it but no article gave a solution. To isolate the problem I've created in IIS6 (WServer2003) a virtual directory test to...
15
by: Rob Nicholson | last post by:
I'm starting to worry a bit now. We're getting the above error when two users hit the same database/page on an ASP.NET application using ADO.NET, talking to a SQL 7 server. The error is perfectly...
4
by: Peter Rothenbuecher | last post by:
Hello, when I try to compile the following code: /* This fragment of code is taken from an online tutorial */ #include<stdio.h> #include<fcntl.h> #include<stdlib.h> float bigbuff;
6
by: Peter Rothenbuecher | last post by:
Hello, when I try to compile the following code with g++ -o client client.c #include<sys/socket.h> #include<stdio.h> #include<stdlib.h> #define ADDRESS "mysocket"; #define MAXLEN 200;
8
by: y1799 | last post by:
I have a problem with creating new Web project I use Win XP pro. I installed VS 2003 and after installation ran "aspnet_regiis.exe /i " I got error message: "The web server reported the...
0
by: Christopher H. Laco | last post by:
I'm in a strange situation. I have a dataset that uses it own connection string from MySettings. All is well. This thing works in .NET just dandy. If I reference this dataset from another...
4
by: News | last post by:
Hi Everyone, The attached code creates client connections to websphere queue managers and then processes an inquiry against them. The program functions when it gets options from the command...
6
by: alho | last post by:
The web service is called by a program running on pocket pc. When to call the web service, the first call is still ok, but for the second or later calls, it will throw "403 Forbidden" WebException....
6
by: Doug Ferguson | last post by:
I am using a webservice client that was created from a WSDL file in .Net 1.1. The client ALWAYS works the first time I call it. The second call returns one of two exceptions. It either returns...
0
by: Eric von Horst | last post by:
Hi, we have a third-party product that has a C++ api on HP-UX. I would like be able to use the API in Python (as I remember Python is good at doing this). I have no experience with this so...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.