2012-05-31 58 views
0

基本上,我創建了一個搜索工具,它位於每個頁面的導航控件中。我的前任將每一頁都放在一個表格中用於回傳。VB.Net從導航控件提交表單

我需要這些回發才能繼續工作,但是我需要在提交後發佈到單獨頁面併發布數據時進行搜索。 我嘗試過各種方法,如ImageButton上的「postbackURL」,但它沒有做任何事情。

下面是我的navigation.ascx控制我的表單代碼示例:

  <fieldset> 
      <div style="height:8px;"></div> 
       <asp:TextBox Width="116px" CssClass="search-textbox" Text="Search" style="height: 25px; background-color: #FFF; z-index: 1; color:#888;" onfocus="inputFocus(this)" onblur="inputBlur(this)" id="txtCriteria" runat="server" /> 
       <div style="height:10px;"></div> 
       <asp:DropDownList Width="150px" CssClass="searchbox" Visible="true" ID="ddlDatatype" runat="server" > 
         <asp:ListItem Text="All" Value="all"></asp:ListItem> 
         <asp:ListItem Text="Title" Value="title"></asp:ListItem> 
         <asp:ListItem Text="Brand" Value="brand"></asp:ListItem> 
         <asp:ListItem Text="Description" Value="desc"></asp:ListItem> 
       </asp:DropDownList> 
       <div style="height:10px;"></div> 
       <asp:DropDownList Width="150px" CssClass="searchbox" Visible="true" ID="ddlCategory" runat="server" /> 
       <div style="height:14px;"></div> 
       <asp:ImageButton ID="btnSubmitSearch" runat="server" style="margin-top: -2px;" ImageUrl="/images/search-go.png" /> 

      </fieldset> 

這就需要提交到另一個頁面。任何幫助將不勝感激。謝謝

更新:我已經意識到這段代碼現在可以工作,但是它不會提交併移動到下一頁,因爲如果已經在選定的頁面上使用了一個表單,那麼它會被掛起來驗證其他形式的控件。正在使用的驗證的一個例子是:

`<asp:RequiredFieldValidator ID="rfv_txtEmail" runat="server" ControlToValidate="txtEmail" Display="Dynamic">` 

是否有機會繞過如果是實際使用的搜索工具,而不是接觸形式這種形式的驗證?謝謝

回答

0

想通了,只需使用提交按鈕上的CausesValidation="false"屬性。