2012-04-26 12 views
1

私は、以下のようにボタンフィールドを含む私のアプリケーションでGridviewを使用しています。グリッドビューボタンからフォームを呼び出す方法をクリックしますか?

<asp:GridView ID="grvAccrualData" runat="server" AutoGenerateColumns="False" ForeColor="Black" Font-Names="Arial" 

         BackColor="#B10633" __designer:wfdid="w9" AllowPaging="True" Width="100%" OnRowCommand="grvAccrualData_RowCommand"> 
         <PagerSettings FirstPageText="&amp;lt;&amp;lt; First" LastPageText="Last &amp;gt;&amp;gt;" 
          Mode="NextPreviousFirstLast" NextPageText="Next &amp;gt;" PreviousPageText="Prev &amp;lt;"> 
         </PagerSettings> 
         <FooterStyle BackColor="#B10633" Font-Bold="True" ForeColor="White"></FooterStyle> 
         <RowStyle Font-Names="Arial" Font-Size="8pt" HorizontalAlign="Left" VerticalAlign="Middle" BackColor="Ivory" /> 
         <Columns> 
          <asp:BoundField DataField="AccrlHeaderAccrualNo" HeaderText="Accrual Number"> 
           <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle"></ItemStyle> 
          </asp:BoundField> 
          <asp:ButtonField ButtonType="button" CommandName="AccrualDetail" HeaderText="Debit Generation" Text="Account" /> 
         </Columns> 
         <PagerStyle HorizontalAlign="Center" BackColor="#B10633" ForeColor="Black"></PagerStyle> 
         <HeaderStyle BackColor="#B10633" Font-Names="Arial" Font-Size="8pt" ForeColor="White"> 
         </HeaderStyle> 
         <AlternatingRowStyle BackColor="#FFC0C0"></AlternatingRowStyle> 
        </asp:GridView> 

そして、私のサーバー側のコードは次のとおりです。

このサーバーコードで
protected void grvAccrualData_RowCommand(object sender, GridViewCommandEventArgs e) 
{ 
    if (e.CommandName == "AccrualDetail") 
    { 

    } 
} 

私は、フォームやボタンのクリックでWebページを呼び出したいです。

このターゲットを達成する方法を教えてください。

答えて

0

使用

Response.Redirect("~/WebPage.aspx"); 

それとも、これに伴ってパラメータを渡したい場合は、その後のQueryStringを使用することを意味します。

関連する問題