重新设计默认的 asmx 配色方案

发布于 2024-08-12 11:25:54 字数 267 浏览 1 评论 0原文

当您使用 .NET 2.0(或 3.5)创建 Web 服务时,它会为您生成一个 .asmx 文件。当这个 .asmx 在 Web 浏览器中呈现时,它会在顶部显示一个深蓝色边框以及 Web 服务的名称,如下所示: 网络服务屏幕截图

可以重新设置此页面的样式吗?我需要更改深蓝色以匹配客户的颜色。对我来说似乎毫无意义,但这就是客户想要的:-|

When you create a web service using .NET 2.0 (or 3.5), it generates a .asmx file for you. When this .asmx is rendered in a web browser it shows up with a dark blue border at the top and the name of the web service, like so:
web service screenshot

Is it possible to restyle this page? I need to change the dark blue color to match the client's colors. Seems pointless to me but that's what the customer wants :-|

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月竹挽风 2024-08-19 11:25:55

正如 Justin 提供的博客文章中提到的,可以通过修改位于 C:\Windows\Microsoft.NET\Framework\v2 的 DefaultWsdlHelpGenerator.aspx 页面来重新设置 Wsdl 帮助页面的样式。 .0.50727\CONFIG\

然而,还有更多事情可以做 - 博客文章仅提到直接更改此文件并更改它在 machine.config 文件中的位置。这有一个限制,即它适用于服务器上托管的所有 Web 服务。

可以为各个 Web 服务提供定制的帮助页面。

为此,您需要做的就是将上述文件的副本添加到您的 Web 服务项目中,然后从您的 web.config 文件引用该新文件。

您需要添加的配置部分如下所示:

<configuration>
    <system.web>
        <webServices>
          <wsdlHelpGenerator href="MyCustomWsdlHelpGenerator.aspx"/>
        </webServices>
     </system.web>
</configuration>

在浏览器中导航到 asmx,您将看到指定的帮助页面而不是默认的帮助页面。

As mentioned in the blog post provided by Justin, it is possible to restyle the Wsdl help page by modifying the DefaultWsdlHelpGenerator.aspx page that can be found at C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\

There is more that can be done, however - the blog post only mentions directly altering this file and changing where it can be found in the machine.config file. This has the limitation that it applies for all web services that are hosted on a server.

It is possible to provide a customised help page for individual web services.

To do this all you need to do is add a copy of the file mentioned above to your web service's project and then reference that new file from your web.config file.

The config section you need to add is shown below:

<configuration>
    <system.web>
        <webServices>
          <wsdlHelpGenerator href="MyCustomWsdlHelpGenerator.aspx"/>
        </webServices>
     </system.web>
</configuration>

Navigate to the asmx in the browser and you will see the specified help page instead of the default one.

无言温柔 2024-08-19 11:25:55

好消息 - 这是可能的。查看这篇博文了解完整的概要。

Stephen Toub:ASP.NET Web 服务测试页

Good news - 'tis possible. Check out this blog post for the full rundown.

Stephen Toub: ASP.NET Web Services Test Page

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文