Problem with ASP:Button

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
 
I

Ignacio Machin \( .NET/ C# MVP \)

hi

post some code, both the declaration in the aspx page as the code behind
 
D

DFDavis

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top