2

我有一个位于母版页上的搜索框。我使用 request.form 来获取要搜索的值。当上一页不是安全页面但例如登录页面和其他安全网页时,它工作正常,我没有任何价值。关于我如何解决这个问题的任何想法?

我忘了提到我正在使用 postbackurl 转到目标页面。

<div class="search-div">
   <asp:TextBox ID="searchBox" runat="server" Text="Type Part Number Here" style="font-weight: lighter; font-style: normal; color: #C0C0C0" onfocus="OnSearchBoxFocus('searchBox');" onblur="OnSearchBoxLostFocus('searchBox');"></asp:TextBox>

  <asp:ImageButton ID="searchButton" runat="server" EnableViewState="false" CssClass="search-button" ImageUrl="~/images/search.png" BorderWidth="0px" Width="32" Height="28" type="submit" PostBackUrl="~/SearchResults.aspx" />
</div>


If Not IsPostBack Then
  Dim strBoxName As String = PublicVariables.webSearchBoxControlName
  Dim strSearchValue As String = Request.Form(strBoxName)
End If
4

1 回答 1

0

原因是您使用了某种不是自动重定向的https方式http,并且无法处理发布数据。

解决方案是将帖子从 https 直接发送到 http 页面,例如更改此:

 PostBackUrl="~/SearchResults.aspx"

 PostBackUrl="http://example.com/dir/SearchResults.aspx"

我对此进行了测试并且正在工作,从一个 https 页面帖子到一个新的不同 http 页面。

于 2014-09-15T16:51:29.763 回答