问题描述
我正在开发一个使用 .aspx 作为页面的移动网站;但是,我正在从旧的 .asp 页面传输信息.这些 .asp 页面正在读取数据库连接,我不清楚如何将它们转换为 .aspx 页面而不会遇到我在修复时不清楚的配置错误.
I am working on a mobile site that uses .aspx for the pages; however, I am transferring information from older .asp pages. These .asp pages are reading database connections, and I am not clear how to convert these into .aspx pages without running into config errors that are unclear to me in fixing.
在一个站点中混合使用 .asp 和 .aspx 页面是不是不好? 如果不是,我如何才能更好地理解从 .asp 数据库连接到 .aspx 的转换差异?这是我目前在这个网站上遇到的唯一障碍,我很想尽快找到解决方案,因为我已经在这里停留了一段时间.
Is it bad practice to mix .asp and .aspx pages in a site? If not, how can I learn to better understand the conversion differences from .asp database connections to .aspx? This is the only obstacle I have going on at the moment with this site, and I would love to find a solution soon as I've been stuck here for a while.
该站点有效,但我希望与页面中设置的 .aspx 保持一致.感谢您提供的任何帮助,谢谢.
The site works, but I would like to be consistent with the .aspx set up in pages. I appreciate any help you may have to offer, thank you.
推荐答案
您绝对可以将 ASP 页面与 ASP.NET 页面混合使用.我已经为我们没有时间重新设计但需要添加一些功能的内部站点完成了它.请注意,您不能在两种类型的页面之间共享会话状态(我使用 cookie 解决了这个问题),但是这两个页面可以在同一个网站中一起存在而不会出现问题.
You can absolutely mix ASP pages with ASP.NET pages. I've done it for internal sites where we didn't have time to redesign, but needed to add some functionality. Note that you can't share session state between the two types of pages (I worked around this using cookies) but the two pages can live together in the same web site without an issue.
ASP 页面通常会将数据库连接保存在 global.asa 文件中,或者可能保存在包含文件中,甚至就在 asp 页面本身中.当您迁移功能以将所有这些连接放在一个合乎逻辑的位置时,这将很有帮助.
Often ASP pages will have database connections kept in the global.asa file or perhaps in an include file, or even right within the asp pages themselves. It would be helpful as you migrate functionality to have all those connections in one logical place.
没有从 ASP 到 ASP.NET 的直接转换,如果您对 ASP.NET 还没有太多经验,那么值得探索一些示例/教程以了解 ASP.NET Web 的原理网站工程.连接到数据库的方式有很多选择.查看 www.asp.net 以了解它们.
There is no straight conversion to ASP.NET from ASP, and if you don't have much experience yet with ASP.NET it would be worthwhile to explore some samples / tutorials to get an understanding of how an ASP.NET Web site works. There are lots of options for how you connect to your database. Have a look at www.asp.net to learn about them.
这篇关于可以混合使用 ASP 和 ASP.NET 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!