Event not firing
-
I have a UC for editing users (EditUsers.ascx). The data is loaded into EditUsers.ascx with (plain) AJAX. EdiUsers.ascx consists of editing form, close btn and submit button (Save)... Because I have three different types of users (with small differences between them), I have copied (to save time) the code from one UC to another and set it to be special to that type of users. I have created (double click) event handler for Save button:
<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
And in code behind:
protected void btnSave_Click(object sender, EventArgs e)
{
// Call the save function....
}And this doesn't seem to work... I submit a form and nothing happens, no save function call. I also tried this:
protected override void OnInit(EventArgs e)
{
btnSave.Click += new EventHandler(btnSave_Click);//base.OnInit(e);
}
protected void btnSave_Click(object sender, EventArgs e)
{
// Call the save function....
}And this doesn't work either. Can anyone tell me what is the problem and am I missing something?
-
I have a UC for editing users (EditUsers.ascx). The data is loaded into EditUsers.ascx with (plain) AJAX. EdiUsers.ascx consists of editing form, close btn and submit button (Save)... Because I have three different types of users (with small differences between them), I have copied (to save time) the code from one UC to another and set it to be special to that type of users. I have created (double click) event handler for Save button:
<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
And in code behind:
protected void btnSave_Click(object sender, EventArgs e)
{
// Call the save function....
}And this doesn't seem to work... I submit a form and nothing happens, no save function call. I also tried this:
protected override void OnInit(EventArgs e)
{
btnSave.Click += new EventHandler(btnSave_Click);//base.OnInit(e);
}
protected void btnSave_Click(object sender, EventArgs e)
{
// Call the save function....
}And this doesn't work either. Can anyone tell me what is the problem and am I missing something?
Checked <%@Page CodeFile="" Inherits="" %> ,maybe these properties don't correct.
-
Checked <%@Page CodeFile="" Inherits="" %> ,maybe these properties don't correct.
VS.net has generated this and I didn't modify this and namespace is ePoslovi.Module and EditUsers is a class inherited from UserControl how it should be.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EditUsers.ascx.cs" Inherits="ePoslovi.Module.EditUsers" %>
Any clue?
-
Checked <%@Page CodeFile="" Inherits="" %> ,maybe these properties don't correct.
Debugger says that, when I click on submit button, Page.IsPostBack is false?! Hows that possible? I even add a new button, and tried with it and same thing.