Problem with ASP:Button

  • Thread starter Thread starter DFDavis
  • Start date Start date
D

DFDavis

I have a set of code that updates to a div tag through javascript
whenever a checkbox is checked, however I need a way to get that
information to the server side when the user uses the submit button.
So I created an asp:button on the page, but for some reason, everytime
I press the submit button, the page tries to reload and I get an error
page, not an error from the program itself, just a normal error page
for explorer.

I've noticed that when I create the event handler it will create the
method submit_click but inside the initialize component of the web
generated code, it doesn't initialize the handler. How can I fix this
so I can read in from the div tag when they press the button?

Thanks,

Dan
 
hi

post some code, both the declaration in the aspx page as the code behind
 
This is from the aspx declaration:

<asp:Button ID="Button1" runat="server"
Text="Submit" />

And here is the handler and init code from the code behind:

private void InitializeComponent()
{
this.btn_logout.Click += new
System.Web.UI.ImageClickEventHandler(this.btn_logout_Click);
this.Button1.Click += new EventHandler(Button1_Click);
this.TextBox1.TextChanged += new
EventHandler(TextBox1_TextChanged);
}

protected void Button1_Click(object sender, EventArgs e)
{
throw new Exception("The method or operation is not
implemented.");
}

Still haven't figured out how to get it to work for me so any help
would be appreciated.

Thanks,

Dan
 
Back
Top