爲什麼我不能調用ImageButton.ImageUrl?爲什麼圖像按鈕ID不能識別
Default.aspx的:
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="Test1.jpg" CommandName="Delete" OnCommand="ImageButton_Command" />
</asp:Content>
Default.aspx.cs:
void ImageButton_Command(object sender, CommandEventArgs e)
{
string name = ***ImageButton1.ImageUrl***; //(Error)
}
錯誤說的是什麼? – nunespascal 2013-02-18 10:55:45
CS0122:Default2.ImageButton_Command(Object,System.Web.UI.WebControls.CommandEventArgs),因爲安全性不可訪問 – 2013-02-18 11:02:22