2013-01-04 21 views

回答

1

嘗試ItemCommand事件。這是如何使用它。我只知道C#,但我認爲你可以掌握它。背後

代碼:

protected void DetailsView_ItemCommand(object sender, DetailsViewCommandEventArgs e) 
{ 
    if (e.CommandName == "New") 
    { 
     // Your code here 
    } 
} 

標記:

<asp:DetailsView ID="DetailsView" runat="server" OnItemCommand="DetailsView_ItemCommand" ... 
+0

感謝您的答覆。我會嘗試這個事件,並讓你知道它我工作。 –

+0

我發現當點擊「插入」按鈕時,一個很好。你知道哪一個適合「新建」按鈕嗎? –

+0

使用ItemCommand是要走的路。謝謝。我試圖讓DropDownList使用下面的代碼選擇值,但列表仍然沒有顯示數據。你能告訴我額外需要的編碼來使它起作用嗎? Case「New」 Dim drpValue As DropDownList drpValue = DetailsView.FindControl(「DropDownListClass」) drpValue.SelectedValue = StrListValueToSelect –

相關問題