ServiceStack webservice工作ie9或IE10使用本地主机作为地址,但不是与IP地址作为地址

问题描述:

我遇到了一个问题,其中铬和歌剧工作正常,但有一种形式扔在适当的Internet Explorer 9和10当我在URL中使用主机名或IP而不是本地主机。还有另一个表单对象适用于只有文本框和提交按钮的所有内容。ServiceStack webservice工作ie9或IE10使用本地主机作为地址,但不是与IP地址作为地址

我遇到问题的表单有文本字段,选择列表,下拉列表和复选框。

我没有收到从Internet Explorer中的提交按钮的事件,但我在其他浏览器中。

错误:

Error Code: 
RequestBindingException: Unable to bind request 
Stack: 
at ServiceStack.WebHost.Endpoints.RestHandler.GetRequest(IHttpRequest httpReq, IRestPath restPath) at ServiceStack.WebHost.Endpoints.RestHandler.ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, String operationName) 

代码:

<form style="width:inherit; margin:4px" action="/search" method="post"><label style="color: white;">Quick Search</label><br> 
       <label style="color: white;">Colors:</label> 
       <br/> 
       @*<input style="width:100px;" name="Colors" type="text"><br>*@ 
       <select name="Colors" style="height:200px; width:100px;" multiple> 
        @{ 
         @:<option value ="Any">Any</option> 
         foreach(Color colors in Repositories.TypeGetters.GetAllColors()) 
         { 
          @:<option value ="@colors.Description">@colors.Description</option> 
         } 
        } 
       </select><br> 
       <input style="color: white; font-size:small" type="checkbox" name="PredominantColor" value="1" /> 
       <label style="color: white;">Predominant Color?</label><br /> 
       <label style="color: white; width:30px">D1</label><label style="color: white; width:30px">xD2:</label><br /> 
       <input style="width:30px" name="D1" type="text"><label style="color: white;">mm. X </label> 
       <input style="width:30px" name="D2" type="text"><label style="color: white;">mm.</label><br /> 
       <label style="color: white;">Number of Layers:</label><br> 
       <input style="width:30px" name="LayersCount" type="text"><br> 
       <label style="color: white; width:100px">Flexibility:</label><br/> 
       <select style="width:100px" name="Flexibility"> 
        @{ 
         @:<option value ="Any">Any</option> 
         foreach(FlexibilityType flex in Repositories.TypeGetters.GetAllFlexTypes()) 
         { 
          @:<option value ="@flex.Description">@flex.Description</option> 
         } 
        } 
       </select> <br /> 
       <button name="SearchType" type="submit" value="2" style="float:right; margin-right:20px;">Submit</button><br /> 
      </form> 

由于事情我花了一整天关于这一点,我想出一个解决方案。而是采用了

<button name="SearchType" type="submit" value="2" style="float:right; margin-right:20px;">Submit</button>

标签我用

<input name="SearchType" type="submit" value="2" style="float:right; margin-right:20px;" /><br />

,并解决了该问题。

我无法理解或解释为什么Internet Explorer无法以其他方式工作,但这是有效的。我会猜测这是由于IE的html5支持问题。