473,325 Members | 2,342 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,325 software developers and data experts.

How to convert asp page to .net page - conversion runtime error

120 100+
hi guys

I want to move over my .asp site to .net gradually over time. To start I've renamed the first .asp file extension to .aspx

I've also added below code to the top of the page
<%@ Page Language="VB" Debug="true" %>

page code
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="VB" Debug="true" %> 
  2.  
  3. <html>
  4. <head></head>
  5. <body>
  6.  
  7. &pound;
  8. <%
  9. 'DISPLAY CHEAPEST LGWYYZ PRICE
  10. DIM objConn1
  11. Set objConn1 = Server.CreateObject("ADODB.Connection")
  12. objConn1.ConnectionString = "Provider=SQLOLEDB;Data Source=DBIPGOESHERE;" & _
  13. "Initial Catalog=Prices;User ID=USERNAME;Password=PASSWORDHERE"
  14. objConn1.Open
  15.  
  16. DIM LGWYYZ
  17. LGWYYZ = "Select LGWYYZPrice = MIN(LGWYYZPrice) from (Select MIN(Price_Band_1) As LGWYYZPrice from UK_Specials where Id in (1) UNION ALL " & _ 
  18. "Select MIN(Price_Band_2) from UK_Specials where Id in (1) UNION ALL " & _
  19. "Select MIN(Price_Band_3) from UK_Specials where Id in (1) UNION ALL " & _
  20. "Select MIN(Price_Band_4) from UK_Specials where Id in (1) UNION ALL " & _
  21. "Select MIN(Price_Band_5) from UK_Specials where Id in (1) )x"
  22.  
  23. DIM objRS1
  24. Set objRS1 = Server.CreateObject("ADODB.Recordset")
  25. objRS1.Open LGWYYZ, objConn1
  26.  
  27. Response.Write objRS1 (Trim("LGWYYZPrice"))
  28.  
  29. 'close connection
  30. objRS1.Close
  31. Set objRS1 = Nothing
  32. objConn1.Close
  33. Set objConn1 = Nothing
  34. %>
  35.  
  36. </body>
  37. </html>
  38.  
however im getting a run time error
Expand|Select|Wrap|Line Numbers
  1. Server Error in '/' Application.
  2. Runtime Error
  3. Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
  4.  
  5. Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
  6.  
  7. <!-- Web.Config Configuration File -->
  8.  
  9. <configuration>
  10.     <system.web>
  11.         <customErrors mode="Off"/>
  12.     </system.web>
  13. </configuration>
  14.  
  15.  
  16. Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
  17.  
  18. <!-- Web.Config Configuration File -->
  19.  
  20. <configuration>
  21.     <system.web>
  22.         <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
  23.     </system.web>
  24. </configuration>
  25.  
could someone shed some light please? for the time being i want to make minimal changes to have the asp coded page working as a .aspx page. and then I shall look into rebuilding every individual page in asp .net...

thanks in advance
Omar.
Nov 4 '10 #1
2 1820
if it is just an extention change.. why they released .net frame work... you cannot do like this. I think you can convert old asp page using a tool (100% conversion is not possible, even one version to another version of asp.net(1.1 to 2.0)).
Nov 5 '10 #2
Frinavale
9,735 Expert Mod 8TB
You're missing a few things that are required for ASP.NET web applications to work....like the web.config file for example.

I strongly recommend that you start a new ASP.NET project using Visual Studio and port your code over properly.

-Frinny
Nov 8 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: | last post by:
I am accessing the same error-containing ASP page on an ISP server using w2k IE6 but with different effect. On the first computer I get several line of HTML outputed by ASP, shown correctly by...
9
by: Marina Anufreichik | last post by:
Hi, After deploymnet web application on web server I can access page on local machine and login fine but when I'm trying to access web site from remote machine I can see login page, but when I'm...
6
by: Dan Roberts | last post by:
I am running some off-the-shelf software that is written in ASP, which uses JScript to generate dynamic content within HTML forms. There are several ASP pages which are partially rendering to IE,...
7
by: cppaddict | last post by:
Hi, I've been trying to debug a strange runtime error for the last 5 hours... I'm hoping someone might have an insight about it. I have an application that creates a vector of MyDisplay...
3
by: Dennis Allen | last post by:
Hi. On my copy of IE6, the following web page gives a runtime error, line 185: http://www.calsky.com/?Planets= I've contacted the webmaster, but he doesn't see the error. Is the error real,...
2
by: Aleksandar | last post by:
Hi, I need to convert set of Java classes exported from IBM Modeling environment to C# for implementation. When I invoke JCLA conversion from File->Open->Convert in Visual Studio 2005 it starts...
7
by: Charlie Brookhart | last post by:
I have a program (posted below) that is supposed to take liters, which is the user input, and convert it to pints and gallons. The pints and gallons are displayed in a read only textbox. I don't...
2
by: H | last post by:
Using VS2005 Created new website. Placed one button, one label on the form. In the click event of the button, I set the text of the label to "Clicked!". That's it. It works locally thru...
7
by: John | last post by:
Hi Everyone, I'm having this extremely annoying problem with Internet Explorer 6, giving me an error message saying "unknown runtime error" whenever I try to alter the contents of a <divelement...
2
by: katrinkerber | last post by:
Hello, I need help to solve a runtime error that keeps reocurring every time I try to convert an Excel file into an Acess File. I have looked through many forums trying to find help, but I have...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.