[英]Asp.net button is not firing event
我的asp.net按鈕有問題。 這不是觸發事件。 我嘗試將導致驗證的設置設置為false並刪除了Java腳本和驗證,但仍然無法正常工作。
<asp:Button ID="Button2" runat="server" Text="Save" onclick="Button2_Click" />
protected void Button2_Click(object sender, EventArgs e)
{
std.AddGuardianInfo(
Convert.ToInt16(DropDownList1.SelectedValue),
TextBox6.Text,
TextBox7.Text,
TextBox8.Text,
TextBox9.Text,
TextBox10.Text);
Response.Redirect("Std_FeeInfo.aspx");
}
在asp:button
的標記中將onclick
更改為OnClick
。 因此標記將如下所示:
<asp:Button ID="Button2" runat="server" Text="Save" OnClick="Button2_Click" />
並為您提供了一個重要的建議: 使用css
設置頁面中元素的樣式和排列方式,並使用一系列
不會是一個好的設計
您要檢查此步驟。
EnableEventValidation="false"
' 范例:
<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.