2011-05-14 81 views
0

我的源代碼是:如何訪問vb.net按鈕點擊事件對模式彈出按鈕點擊事件?在設計部分

 
<asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup"> 
      <asp:Panel ID="Panel3" runat="server" Style="cursor: move;background-color:#DDDDDD;border:solid 1px Gray;color:Black"> 
       <div> 
        <p>Would you like to book the seat?</p> 
       </div> 
      </asp:Panel> 
       <div> 
        <p style="text-align: center;"> 
         <asp:Button ID="OkButton" runat="server" Text="OK" OnClick="OkButton_Click" />      
         <asp:Button ID="CancelButton" runat="server" Text="Cancel" /> 
        </p> 
       </div>     
     </asp:Panel> 

我要訪問OkButton_Click在vb.net 的代碼如下:

 
Protected Sub OkButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OkButton.Click 
     Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0 ;data source=" & Server.MapPath(".\App_Data\IFFI.mdb") & ";") 
     Dim Cmd As OleDbCommand 
     Dim Qry As String 
     con.Open() 
     Qry = "update seat_layout set lock_status=1,booked_status=1 where theatre_id='" + ddl_theatre.SelectedValue.ToString() + "' and seat_id='" + Session("seat_id").ToString() + "'" 
     Dim img As Button 
     img.BackColor = Drawing.Color.Purple 
     img.Enabled = False 
     Cmd = New OleDbCommand(Qry, con) 
     Cmd.ExecuteNonQuery() 
     con.Close() 
    End Sub 

確定按鈕單擊未訪問點擊事件。請幫助

回答

1

嘗試更改爲「公共」而不是「保護」的子。 (我很抱歉,如果這個問題太舊了,我現在不能回答)。