小编D.F*_*est的帖子

如何以编程方式创建此自定义绑定?

我们必须访问使用soap11的Web服务...没问题我只需将绑定设置为:

BasicHttpBinding wsBinding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
Run Code Online (Sandbox Code Playgroud)

不.没有骰子.所以我问服务主机为什么我们遇到身份验证问题,他说我们的配置需要这个自定义绑定:

<bindings>
    <customBinding>
        <binding name="lbinding">
            <security  authenticationMode="UserNameOverTransport" 
                messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11" 
                securityHeaderLayout="Strict" 
                includeTimestamp="false"
                requireDerivedKeys="true" 
                keyEntropyMode="ServerEntropy">
            </security>
            <textMessageEncoding messageVersion="Soap11" />
            <httpsTransport authenticationScheme ="Negotiate" requireClientCertificate ="false" realm =""/>
        </binding>
    </customBinding>
</bindings>
Run Code Online (Sandbox Code Playgroud)

唯一的问题是我们是以编程方式创建绑定而不是通过配置.因此,如果有人可以指出我正确的方向,将我的BasicHttpBinding更改为符合.config值的自定义绑定,我会给他们一个闪亮的金色星星.

wcf basichttpbinding wcf-binding

19
推荐指数
2
解决办法
2万
查看次数

如何将主机名包含在MVC2路由映射中?

我有3个域名都指向同一个MVC2应用程序.我现在所拥有的是作为交通警察的家庭控制器,并重定向到控制器和特定主机名的视图.但我不喜欢这导致的URI结果......

例如:www.webhost1.com/webhost1/imagegallery www.webhost2.com/webhost2/imagegallery

我更喜欢:

www.webhost1.com/imagegallery

有没有办法在global.asax中定义路由,包括路由评估中的主机名,以便URI看起来不那么多余?

asp.net-mvc-2

1
推荐指数
1
解决办法
1340
查看次数

模板控制 - 开始和结束标记之间不允许使用内容

我正在尝试运行MSDN提供的模板化用户控件示例.代码如下:

所以根据MSDN,这应该实现如下:

<%@ Register Assembly="MyAssembly" Namespace="MyAssembly.Controls" TagPrefix="abs" %>
<abs:TemplatedFirstControl id = "First"  runat=server
                           Text= "The time on the server is "  >
      <FirstTemplate>
          <h3><font face="Verdana" color = "red">
                 <%# Container.Text %> <%# Container.DateTime %>
              </font>
          </h3>
      </FirstTemplate>      
    </abs:TemplatedFirstControl>
Run Code Online (Sandbox Code Playgroud)

设计者抱怨在开始和结束标记之间不允许内容,TemplatedFirstControl并且FirstTemplate不支持.那么缺少什么?我逐字复制了MSDN的代码

MSDN文章:http://msdn.microsoft.com/en-us/library/aa720695%28v=VS.71%29.aspx

c# asp.net controls

0
推荐指数
1
解决办法
1833
查看次数