如何在web项目中添加.asmx文件(asp.net)C#

如何在web项目中添加.asmx文件(asp.net)C#

问题描述:

我想在我的项目中添加一个Webservice.asmx文件,在App_Code文件夹中添加它的codebehid(Webservice.cs)文件,该文件可以在我项目的所有页面中访问。但我不知道我该怎么办。请帮忙。







提前感谢

i want to add a Webservice.asmx file in my project and its's codebehid(Webservice.cs) file in App_Code folder, which is accessible in all pages of my project. but i don't know how can i do. please help.



thanks in advance

请看下面的链接:



http://msdn.microsoft.com/en-us/library/ywx7tzs7(v = vs.90).aspx [ ^ ]



http://*.com / questions / 20281144 / create-a-asmx-web-service-in-visual-studio-2013 [ ^ ]



但是,你应该避免使用ASMX。它现在被认为是旧的遗产。



较新的Microsoft平台甚至不支持ASMX(例如SharePoint 2013)。



你应该考虑转移到 WCF [ ^ ]或 Rest API [ ^ ]。
Look at the links below:

http://msdn.microsoft.com/en-us/library/ywx7tzs7(v=vs.90).aspx[^]

http://*.com/questions/20281144/create-a-asmx-web-service-in-visual-studio-2013[^]

However, you should avoid to use ASMX. It's considered as old legacy now.

The newer Microsoft Platforms don't even support ASMX (such as SharePoint 2013).

You should consider moving to WCF [^]or Rest APIs[^].