Shoukat_1983 Posted April 3, 2006 Share Posted April 3, 2006 I need your help regarding the w3schools ASP .Net tutorials. I am reading w3schools ASP .Net tutorials regularly but i am facing many problems like when i follow the instructions and type the code as provided in the tutorials in Visual Studio .Net 2003 and execute my ASP web application it gives errors. Forexample the code provided in Dynamic Page in ASP .NET that is<html><body bgcolor="yellow"><center><h2>Hello W3Schools!</h2><p><%Response.Write(now())%></p></center></body></html>cann't be executed on VS .Net 2003 and there are many problems with HTML, Web and Validation Server Controls. So plz do reply to me soon. Link to comment Share on other sites More sharing options...
pulpfiction Posted April 3, 2006 Share Posted April 3, 2006 hi ShoukatIt seems to be working fine for me. what kind of error ru getting, pls post the error, it might be helpful. Link to comment Share on other sites More sharing options...
Shoukat_1983 Posted April 4, 2006 Author Share Posted April 4, 2006 When i execute the web page(containing the exact code provided in the tutorial) get the following error messageDescription: 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: CS1002: ; expectedSource Error: <p><%Response.Write(now())%></p> Link to comment Share on other sites More sharing options...
pulpfiction Posted April 5, 2006 Share Posted April 5, 2006 (edited) Hi Shoukat,From the error I am guessing, your code behind file is not vb but c#, i.e., the extention is not filename.aspx.vb but filename.aspx.cs, this must be the reason why it says "; expected".I am not really sure if this would work but try adding this to your code.<%@ Language="VB" %>Hope it will work.. Edited April 5, 2006 by pulpfiction Link to comment Share on other sites More sharing options...
aspnetguy Posted April 5, 2006 Share Posted April 5, 2006 Hi Shoukat,From the error I am guessing, your code behind file is not vb but c#, i.e., the extention is not filename.aspx.vb but filename.aspx.cs, this must be the reason why it says "; expected".I am not really sure if this would work but try adding this to your code.<%@ Language="VBScript" %>Hope it will work..<{POST_SNAPBACK}> Close but not quite,Make sure the langauge is always set to VBeg<%@ Page Language="VB"....or <script language="vb" runat="server">...These are only guesses. If you post your full code we can give you a better answer. Link to comment Share on other sites More sharing options...
Shoukat_1983 Posted April 5, 2006 Author Share Posted April 5, 2006 Guys, first thanks for reply and secondly yeah I am working on C#.Net and i want to run this code on C# not on VB.Net so Plz tell me solution for C# . By the way it wasn't mentioned in the tutorials that these code run for VB.Net Link to comment Share on other sites More sharing options...
pulpfiction Posted April 5, 2006 Share Posted April 5, 2006 Try this....<%@ Page Language="C#" %><html><body bgcolor="yellow"><center><h2>Hello W3Schools!</h2><p><% Response.Write(System.DateTime.Now.ToString()); %></p></center></body></html> Link to comment Share on other sites More sharing options...
aspnetguy Posted April 6, 2006 Share Posted April 6, 2006 Some people do get confused when you tell them ASP.Net can be written 2 different ways (C# or VB)All the tutorials are written in VB so you will need to either write VB or convert them.This utility will convert the code for you.http://www.developerfusion.co.uk/utilities...vbtocsharp.aspx Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now