Reputation: 1
I am having an issue with the asp.net button. It is not firing event. I tried setting causes validation to false and removing the java script and validation but it still doesn't work.
<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");
}
Upvotes: 0
Views: 385
Reputation: 1750
You want to check this steps.
EnableEventValidation="false"
' Example :
<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
Upvotes: 0
Reputation: 29006
Change onclick
to OnClick
in the markup of the asp:button
. so the markup will be like this:
<asp:Button ID="Button2" runat="server" Text="Save" OnClick="Button2_Click" />
And an important advise for you: Use css
for styling and arranging elements in your page, giving space using a sequence of
will not be a good design
Upvotes: 1