我有一个位于母版页上的搜索框。我使用 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