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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error while running an ASP page

Status
Not open for further replies.

bangaram27

Programmer
Jul 14, 2007
2
US
Hi,

Iam new to ASP.NET.

I'm trying to run a simple ASP page.

which has following code

1
2 <!DOCTYPE html
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "5 <SCRIPT Language="vbscript" Runat="Server">
6
7 Sub Page_Load
8 DateOut.Text = "The current date and time are " & Now & "."
9 End Sub
10
11 Sub Display_Welcome (Src as Object, Args As EventArgs)
12 If NameIn.Text <> "" Then
13 WelcomeOut.Text = "Welcome, " & NameIn.Text & ", to the world of ASP.NET."
14 End If
15 End Sub
16 </SCRIPT>
17 <html xmlns=" xml:lang="en">
18 <body>
19 <form Runat="Server">
20
21 <asp:Label id="DateOut" Runat="Server"/><br/>
22 <br/>
23 Enter your first name: <br/>
24 <asp:TextBox id="NameIn" Runat="Server"/>
25 <asp:Button Text="Click Me" OnClick="Display_Welcome" Runat="Server"/><br/>
26 <br/>
27 <asp:Label id="WelcomeOut" Runat="Server"/>
28
29 </form>
30 </body>
31 </html>

I named it as ASPPage2.asp and copied it to C:\Inetpub\
And accessed as
I got following error

Error Type:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/ASPPage2.asp, line 12, column 25
Sub Display_Welcome (Src As Object, Args As EventArgs)
------------------------^


Can any one please help me?

Thanks,

Sindhu
 
First,I believe the error is because you do not have a handles clause for the sub.

Second. You are coding in classic ASP style with script embedded in the HTML page. Use the code behind page to place any code that will be run.
 
<SCRIPT Language="vbscript" Runat="Server">
vbscript is a cient-side, Internet Explorer only language. ASP.NET is a server-side language.

ASPPage2.asp
Also, the above shows that you are running an asp page, not an ASP.NET one.




____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top